Skip to content

Commit

Permalink
Fixing redirection see BT#8207 and #6768
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Jun 4, 2014
1 parent 9b1ddc0 commit 82df5fb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions main/inc/local.inc.php
Expand Up @@ -1239,22 +1239,25 @@
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;
}
}

Expand Down

0 comments on commit 82df5fb

Please sign in to comment.