Browse Source

Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into 1.9.x

Yannick Warnier 10 years ago
parent
commit
b4dabb5734
1 changed files with 7 additions and 2 deletions
  1. 7 2
      main/auth/inscription.php

+ 7 - 2
main/auth/inscription.php

@@ -19,7 +19,12 @@ 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') {
+// User is not allowed if Terms and Conditions are disabled and
+// registration is disabled too.
+$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 +290,7 @@ if (!CustomPages::enabled()) {
     }
 
     // Forbidden to self-register
-    if (api_get_setting('allow_registration') == 'false') {
+    if ($isNotAllowedHere) {
         api_not_allowed(true,get_lang('RegistrationDisabled'));
     }