Fixing issue with registration disabled and invitations

This will fix an issue with certain combinations of registration and/or
invitations being enabled or disabled.

Addresses #330
This commit is contained in:
Sebastian Grewe 2013-07-15 13:44:22 +02:00
parent bf3cd25326
commit 8f72062558
2 changed files with 6 additions and 1 deletions

View File

@ -3,9 +3,12 @@
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
if ($setting->getValue('lock_registration') && !$config['accounts']['invitations']['enabled']) {
if ($setting->getValue('lock_registration') && $setting->getValue('disable_invitations')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "disabled.tpl");
} else if (!$setting->getValue('disable_invitations') && !isset($_GET['token'])) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Only invited users are allowed to register.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "disabled.tpl");
} else {
if ($config['recaptcha']['enabled']) {
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');

View File

@ -15,6 +15,8 @@ if ($config['recaptcha']['enabled']) {
if ($setting->getValue('disable_invitations') && $setting->getValue('lock_registration')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
} else if (!$setting->getValue('disable_invitations') && !isset($_POST['token'])) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Only invited users are allowed to register.', 'TYPE' => 'errormsg');
} else {
// Check if recaptcha is enabled, process form data if valid
if($config['recaptcha']['enabled'] && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){