Fix time recording issue where a user getting out of a course and to a global area did not trigger a logout time update for the track_e_course_access table - refs BT#12939

pull/2487/head
Yannick Warnier 8 years ago
parent 0cab6e44b0
commit fd2d5fea1d
  1. 4
      main/inc/local.inc.php

@ -142,7 +142,7 @@ $gidReq = isset($_GET["gidReq"]) ? intval($_GET["gidReq"]) : '';
// Keep a trace of the course and session from which we are getting out, to
// enable proper course logout tracking in courseLogout()
$logoutInfo = [];
if (!empty($logout)) {
if (!empty($logout) or !empty($cidReset)) {
$uid = 0;
if (!empty($_SESSION['_user']) && !empty($_SESSION['_user']['user_id'])) {
$uid = $_SESSION['_user']['user_id'];
@ -970,6 +970,8 @@ if (isset($cidReset) && $cidReset) {
header('location:'.api_get_path(WEB_PATH));
}
} else {
// Leave a logout time in the track_e_course_access table if we were in a course
courseLogout($logoutInfo);
Session::erase('_cid');
Session::erase('_real_cid');
Session::erase('_course');

Loading…
Cancel
Save