Fixing redirection see BT#8207 and #6768

1.9.x
Julio Montoya 12 years ago
parent 9b1ddc01c4
commit 82df5fb74a
  1. 19
      main/inc/local.inc.php

@ -1239,22 +1239,25 @@ if (isset($_cid)) {
Database::query($sql);
}
// direct login to course
if ((isset($cas_login) && $cas_login && exist_firstpage_parameter())
|| ($logging_in && exist_firstpage_parameter())) {
if ((isset($cas_login) && $cas_login && exist_firstpage_parameter()) ||
($logging_in && exist_firstpage_parameter())
) {
$redirectCourseDir = api_get_firstpage_parameter();
api_delete_firstpage_parameter(); // delete the cookie
if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
$_SESSION['noredirection'] = false;
$_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir;
if (!isset($_SESSION['request_uri'])) {
if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
$_SESSION['noredirection'] = false;
$_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir;
}
}
} elseif (api_user_is_login() && exist_firstpage_parameter()) {
$redirectCourseDir = api_get_firstpage_parameter();
api_delete_firstpage_parameter(); // delete the cookie
api_delete_firstpage_parameter(); // delete the cookie
if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
$_SESSION['noredirection'] = false;
$_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir;
$_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir;
}
}

Loading…
Cancel
Save