|
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 13 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 63 of file class.ilOnlineTracking.php.
References $DIC, $ilDB, $ilSetting, $query, $res, ilObject\getId(), and ILIAS\Repository\int().
Referenced by ilInitialisation\initUserAccount(), and ilInitialisation\resumeUserSession().
67 $ilDB = $DIC->database();
70 if (null === self::$last_access_time) {
71 $query =
'SELECT access_time FROM ut_online WHERE usr_id = ' .
$ilDB->quote(
80 self::$last_access_time = (
int) $row[
'access_time'];
83 $time_span = (
int)
$ilSetting->get(
'tracking_time_span',
'300');
84 if (($diff = time() - self::$last_access_time) <= $time_span) {
86 'UPDATE ut_online SET online_time = online_time + %s, access_time = %s WHERE usr_id = %s',
87 array(
'integer',
'integer',
'integer'),
88 array($diff, time(), $user->
getId())
92 'UPDATE ut_online SET access_time = %s WHERE usr_id = %s',
93 array(
'integer',
'integer'),
94 array(time(), $user->
getId())
◆ $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 18 of file class.ilOnlineTracking.php.
The documentation for this class was generated from the following file: