Public Member Functions | |
| _getOnlineTime ($a_user_id) | |
| _addUser ($a_user_id) | |
| _updateAccess ($a_usr_id) | |
Definition at line 38 of file class.ilOnlineTracking.php.
| ilOnlineTracking::_addUser | ( | $ | a_user_id | ) |
Definition at line 57 of file class.ilOnlineTracking.php.
References $res.
Referenced by ilStartUpGUI::showLogin().
{
global $ilDB;
$query = "SELECT * FROM ut_online WHERE usr_id = '".$a_user_id."'";
$res = $ilDB->query($query);
if($res->numRows())
{
return false;
}
$query = "INSERT INTO ut_online SET usr_id = '".$a_user_id."', access_time = '".time()."'";
$ilDB->query($query);
return true;
}
Here is the caller graph for this function:| ilOnlineTracking::_getOnlineTime | ( | $ | a_user_id | ) |
Definition at line 41 of file class.ilOnlineTracking.php.
References $res.
Referenced by ilLPListOfProgressGUI::__appendUserInfo(), and ilLPItemListGUI::renderObjectInfoXML().
{
global $ilDB;
$query = "SELECT * FROM ut_online WHERE usr_id = '".$a_user_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$access_time = $row->access_time;
$online_time = $row->online_time;
}
return (int) $online_time;
}
Here is the caller graph for this function:| ilOnlineTracking::_updateAccess | ( | $ | a_usr_id | ) |
Definition at line 74 of file class.ilOnlineTracking.php.
Referenced by ilInitialisation::initILIAS().
{
global $ilDB,$ilias;
$query = "SELECT * FROM ut_online WHERE usr_id = '".$a_usr_id."'";
$res = $ilDB->query($query);
if(!$res->numRows())
{
return false;
}
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$access_time = $row->access_time;
$online_time = $row->online_time;
}
$time_span = (int) $ilias->getSetting("tracking_time_span",300);
if(($diff = time() - $access_time) <= $time_span)
{
$query = "UPDATE ut_online SET online_time = online_time + '".$diff."', access_time = '".time().
"' WHERE usr_id = '".$a_usr_id."'";
$ilDB->query($query);
}
else
{
$query = "UPDATE ut_online SET access_time = '".time().
"' WHERE usr_id = '".$a_usr_id."'";
$ilDB->query($query);
}
return true;
}
Here is the caller graph for this function:
1.7.1