Removing $_COOKIE['TestCookie'] validation see BT#7355

1.9.x
Julio Montoya 10 years ago
parent c4a25d3875
commit 3bc102535d
  1. 18
      main/inc/lib/main_api.lib.php

@ -3247,21 +3247,7 @@ function api_not_allowed($print_headers = false, $message = 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
*/
if (!isset($_COOKIE['TestCookie']) ||
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
);
// Set cookie again.
setcookie('TestCookie', 'cookies_yes', time()+3600*24*31*12);
} else {
// The session is over and we were not in a course,
// or we try to get directly to a private course without being logged
if (!is_null(api_get_course_int_id())) {
@ -3299,7 +3285,7 @@ function api_not_allowed($print_headers = false, $message = null)
false
);
}
}
$tpl->assign('content', $msg);
$tpl->display_one_col_template();
exit;

Loading…
Cancel
Save