From 3d3205e23d58f4fbce50ad34f93ef4a8ff3f0f80 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 7 Feb 2011 16:07:29 +0100 Subject: [PATCH] Adding string "lp_autolunch_" in the session key see BT#1909 --- main/course_home/course_home.php | 4 ++-- main/inc/local.inc.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php index edf0f0636d..064ecdd945 100755 --- a/main/course_home/course_home.php +++ b/main/course_home/course_home.php @@ -184,7 +184,7 @@ if (!isset($coursesAlreadyVisited[$_cid])) { /*Auto lunch code */ $show_autolunch_lp_warning = false; -if (api_get_course_setting('enable_lp_auto_launch') && api_get_session_id()==0 ) { +if (api_get_course_setting('enable_lp_auto_launch')) { $lp_table = Database::get_course_table(TABLE_LP_MAIN); $session_id = api_get_session_id(); $condition = ''; @@ -209,7 +209,7 @@ if (api_get_course_setting('enable_lp_auto_launch') && api_get_session_id()==0 ) if (api_is_platform_admin() || api_is_allowed_to_edit()) { $show_autolunch_lp_warning = true; } else { - $session_key = $session_id.'_'.api_get_course_int_id().api_get_user_id(); + $session_key = 'lp_autolunch_'.$session_id.'_'.api_get_course_int_id().'_'.api_get_user_id(); if (!isset($_SESSION[$session_key])) { //redirecting to the LP $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$lp_data['id']; diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index 9a6ac0f649..582bfca1cc 100755 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -722,6 +722,17 @@ if (isset($cidReset) && $cidReset) { // course session data refresh requested or api_session_unregister('_real_cid'); api_session_unregister('_course'); + if (!empty($_SESSION)) { + foreach($_SESSION as $key=>$session_item) { + if (strpos($key,'lp_autolunch_') === false) { + continue; + } else { + if(isset($_SESSION[$key])) { + api_session_unregister($key); + } + } + } + } //Deleting session info if (api_get_session_id()) { api_session_unregister('id_session');