diff --git a/main/inc/lib/events.lib.inc.php b/main/inc/lib/events.lib.inc.php index 1172a1c9d9..f9f3f2be90 100644 --- a/main/inc/lib/events.lib.inc.php +++ b/main/inc/lib/events.lib.inc.php @@ -1472,9 +1472,11 @@ function event_course_login($course_code, $user_id, $session_id) { $user_id = Database::escape_string($user_id); $session_id = Database::escape_string($session_id); + //@TODO: Check if should search for a previous row (LIKE local.inc.php line 880) $sql = "INSERT INTO $course_tracking_table(course_code, user_id, login_course_date, logout_course_date, counter, session_id) VALUES('".$course_code."', '".$user_id."', '$time', '$time', '1', '".$session_id."')"; Database::query($sql); + error_log (__FILE__); // Course catalog stats modifications see #4191 CourseManager::update_course_ranking(null, null, null, null, true, false); diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index 3057650054..6e9eb25b05 100644 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -763,6 +763,7 @@ if (isset($cidReset) && $cidReset) { //Course login if (isset($_user['user_id'])) { event_course_login($_course['code'], $_user['user_id'], api_get_session_id()); + error_log(__FILE__); } } } else { @@ -885,6 +886,7 @@ if (isset($cidReset) && $cidReset) { login_course_date > now() - INTERVAL $session_lifetime SECOND ORDER BY login_course_date DESC LIMIT 0,1"; $result = Database::query($sql); + //error_log(preg_replace('/\s+/',' ',$sql)); if (Database::num_rows($result) > 0) { $i_course_access_id = Database::result($result,0,0); @@ -893,11 +895,13 @@ if (isset($cidReset) && $cidReset) { WHERE course_access_id = ".intval($i_course_access_id)." AND session_id = ".api_get_session_id(); //error_log($sql); Database::query($sql); + //error_log(preg_replace('/\s+/',' ',$sql)); } else { $sql="INSERT INTO $course_tracking_table (course_code, user_id, login_course_date, logout_course_date, counter, session_id)" . "VALUES('".$course_code."', '".$_user['user_id']."', '$time', '$time', '1','".api_get_session_id()."')"; //error_log($sql); Database::query($sql); + //error_log(preg_replace('/\s+/',' ',$sql)); } } }