see #4797 Session expired wrong message

skala
Laurent Opprecht 14 years ago
parent 5b4aa000e0
commit f6c12b0853
  1. 2
      index.php
  2. 2
      main/inc/lib/main_api.lib.php

@ -43,7 +43,7 @@ $htmlHeadXtra[] ='
</script>'; </script>';
//set cookie for check if client browser are cookies enabled //set cookie for check if client browser are cookies enabled
setcookie("TestCookie", "cookies_yes", time()+3600); setcookie('TestCookie', 'cookies_yes', time()+3600*24*31*12);
$controller = new IndexManager($header_title); $controller = new IndexManager($header_title);

@ -2811,7 +2811,7 @@ function api_not_allowed($print_headers = false, $message = null) {
} }
$msg = null; $msg = 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 // 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"]) ) { 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); $msg = Display::return_message(get_lang('NoCookies').'<br /><br /><a href="'.$home_url.'">'.get_lang('BackTo').' '.get_lang('CampusHomepage').'</a><br />', 'error', false);
} else { } else {
$msg = Display::return_message(get_lang('NotAllowed').'<br /><br /><a href="'.$home_url.'">'.get_lang('PleaseLoginAgainFromHomepage').'</a><br />', 'error', false); $msg = Display::return_message(get_lang('NotAllowed').'<br /><br /><a href="'.$home_url.'">'.get_lang('PleaseLoginAgainFromHomepage').'</a><br />', 'error', false);

Loading…
Cancel
Save