Fixing message when registration is disabled -refs #6605

1.9.x
Yoselyn Castillo 12 years ago
parent 84e2298d58
commit 45be43851f
  1. 4
      main/auth/inscription.php
  2. 5
      main/inc/lib/main_api.lib.php

@ -20,7 +20,7 @@ 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') {
api_not_allowed(true);
api_not_allowed(true,get_lang('RegistrationDisabled'));
}
if (!empty($_SESSION['user_language_choice'])) {
@ -258,7 +258,7 @@ if (!CustomPages::enabled()) {
// Forbidden to self-register
if (api_get_setting('allow_registration') == 'false') {
api_not_allowed(true);
api_not_allowed(true,get_lang('RegistrationDisabled'));
}
if (api_get_setting('allow_registration') == 'approval') {

@ -2906,6 +2906,7 @@ function api_not_allowed($print_headers = false, $message = null) {
$origin = isset($_GET['origin']) ? $_GET['origin'] : '';
$msg = null;
if (isset($message)) {
$msg = $message;
} else {
@ -2973,8 +2974,10 @@ function api_not_allowed($print_headers = false, $message = null) {
// Check if the cookies are enabled. If are enabled and if no course ID was included in the requested URL, then the user has either lost his session or is anonymous, so redirect to homepage
if( !isset($_COOKIE['TestCookie']) && empty($_COOKIE['TestCookie']) ) {
$msg = Display::return_message(get_lang('NoCookies').'<br /><br /><a href="'.$home_url.'">'.get_lang('BackTo').' '.get_lang('CampusHomepage').'</a><br />', 'error', false);
} else {
} elseif ($message == null){
$msg = Display::return_message(get_lang('NotAllowed').'<br /><br /><a href="'.$home_url.'">'.get_lang('PleaseLoginAgainFromHomepage').'</a><br />', 'error', false);
} else {
$msg = Display::return_message($message.'&nbsp;<a href="'.$home_url.'">'.get_lang('PleaseLoginAgainFromHomepage').'</a><br />', 'error', false);
}
$msg = Display::div($msg, array('align'=>'center'));
$tpl->assign('content', $msg);

Loading…
Cancel
Save