Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/2487/head
jmontoyaa 8 years ago
commit 9691bceb25
  1. 6
      main/inc/lib/online.inc.php
  2. 4
      main/inc/local.inc.php

@ -482,7 +482,7 @@ function who_is_online_in_this_course_count($uid, $time_limit, $coursecode = nul
*/ */
function courseLogout($logoutInfo) function courseLogout($logoutInfo)
{ {
if (empty($logoutInfo['uid']) or empty($logoutInfo['cid'])) { if (empty($logoutInfo['uid']) || empty($logoutInfo['cid'])) {
return; return;
} }
$sessionLifetime = api_get_configuration_value('session_lifetime'); $sessionLifetime = api_get_configuration_value('session_lifetime');
@ -491,7 +491,7 @@ function courseLogout($logoutInfo)
* the function Tracking::get_time_spent_on_the_course() returns larger values (200h) due the condition: * the function Tracking::get_time_spent_on_the_course() returns larger values (200h) due the condition:
* login_course_date > now() - INTERVAL $session_lifetime SECOND * login_course_date > now() - INTERVAL $session_lifetime SECOND
*/ */
if (empty($sessionLifetime) or $sessionLifetime > 86400) { if (empty($sessionLifetime) || $sessionLifetime > 86400) {
$sessionLifetime = 3600; // 1 hour $sessionLifetime = 3600; // 1 hour
} }
if (!empty($logoutInfo) && !empty($logoutInfo['cid'])) { if (!empty($logoutInfo) && !empty($logoutInfo['cid'])) {
@ -527,4 +527,4 @@ function courseLogout($logoutInfo)
Database::query($sql); Database::query($sql);
} }
} }
} }

@ -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 // Keep a trace of the course and session from which we are getting out, to
// enable proper course logout tracking in courseLogout() // enable proper course logout tracking in courseLogout()
$logoutInfo = []; $logoutInfo = [];
if (!empty($logout) or !empty($cidReset)) { if (!empty($logout) || !empty($cidReset)) {
$uid = 0; $uid = 0;
if (!empty($_SESSION['_user']) && !empty($_SESSION['_user']['user_id'])) { if (!empty($_SESSION['_user']) && !empty($_SESSION['_user']['user_id'])) {
$uid = $_SESSION['_user']['user_id']; $uid = $_SESSION['_user']['user_id'];
@ -1017,7 +1017,7 @@ if (isset($cidReset) && $cidReset) {
} }
} }
if (empty($_SESSION['_course']) or empty($_SESSION['_cid'])) { //no previous values... if (empty($_SESSION['_course']) || empty($_SESSION['_cid'])) { //no previous values...
$_cid = -1; // Set default values $_cid = -1; // Set default values
$_course = -1; $_course = -1;
} else { } else {

Loading…
Cancel
Save