From f0c55ab5674a90266b97f5224989ccd3434c5ccb Mon Sep 17 00:00:00 2001 From: Daniel Barreto Date: Fri, 24 Oct 2014 16:23:39 -0500 Subject: [PATCH] Fix when when activate terms and conditions but not allow register - refs BT#8783 --- main/auth/inscription.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/auth/inscription.php b/main/auth/inscription.php index 73b51f3b2c..ff0235f697 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -19,7 +19,10 @@ require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php'; $htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1'); -if (api_get_setting('allow_registration') === 'false') { +$isNotAllowedHere = api_get_setting('allow_terms_conditions') === 'false' && + api_get_setting('allow_registration') === 'false'; + +if ($isNotAllowedHere) { api_not_allowed(true,get_lang('RegistrationDisabled')); } @@ -285,7 +288,7 @@ if (!CustomPages::enabled()) { } // Forbidden to self-register - if (api_get_setting('allow_registration') == 'false') { + if ($isNotAllowedHere) { api_not_allowed(true,get_lang('RegistrationDisabled')); }