|
static int | $last_access_time = null |
| This static variable is used to prevent two database request (addUser and updateAccess) on login. More...
|
|
Definition at line 27 of file class.ilOnlineTracking.php.
◆ addUser()
static ilOnlineTracking::addUser |
( |
int |
$a_user_id | ) |
|
|
static |
◆ getOnlineTime()
static ilOnlineTracking::getOnlineTime |
( |
int |
$a_user_id | ) |
|
|
static |
◆ updateAccess()
static ilOnlineTracking::updateAccess |
( |
ilObjUser |
$user | ) |
|
|
static |
Definition at line 77 of file class.ilOnlineTracking.php.
References $DIC, $ilDB, $ilSetting, $res, ilObject\getId(), ILIAS\Repository\int(), and null.
Referenced by ilInitialisation\initUserAccount(), and ilInitialisation\resumeUserSession().
81 $ilDB = $DIC->database();
84 if (
null === self::$last_access_time) {
85 $query =
'SELECT access_time FROM ut_online WHERE usr_id = ' .
$ilDB->quote(
94 self::$last_access_time = (
int) $row[
'access_time'];
97 $time_span = (
int)
$ilSetting->get(
'tracking_time_span',
'300');
98 if (($diff = time() - self::$last_access_time) <= $time_span) {
100 'UPDATE ut_online SET online_time = online_time + %s, access_time = %s WHERE usr_id = %s',
101 array(
'integer',
'integer',
'integer'),
102 array($diff, time(), $user->
getId())
106 'UPDATE ut_online SET access_time = %s WHERE usr_id = %s',
107 array(
'integer',
'integer'),
108 array(time(), $user->
getId())
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ $last_access_time
int ilOnlineTracking::$last_access_time = null |
|
staticprotected |
This static variable is used to prevent two database request (addUser and updateAccess) on login.
Definition at line 32 of file class.ilOnlineTracking.php.
The documentation for this class was generated from the following file: