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:
parent
bf3cd25326
commit
8f72062558
@ -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');
|
||||
|
||||
@ -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"]!=''){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user