Public Member Functions | |
| ilTracking () | |
| _getLastAccess () | |
| get last access data of current user | |
| _hasEntry ($a_obj_id, $a_obj_type, $a_sub_id=0, $a_sub_type="") | |
| _trackAccess ($a_obj_id, $a_obj_type, $a_sub_id=0, $a_sub_type="", $a_action_type="read") | |
| track access to an object by current user | |
| TestTitle ($user_id) | |
| numDay ($from, $to) | |
| numHour ($from, $to) | |
| addHour ($time) | |
| addDay ($time) | |
| getSubId ($id) | |
| getSubTest ($id) | |
| getTestId ($id) | |
| countResults ($condition) | |
| searchResults ($condition) | |
| searchTestResults ($condition) | |
| searchUserId ($condition) | |
| searchTestId ($condition) | |
| getPerTestId ($test) | |
| countNum ($from, $from1, $condition) | |
| selectTime ($from, $to, $condition) | |
| getTest ($id) | |
Data Fields | |
| $objId | |
| $userId | |
| $actionType | |
| $phpScript | |
| $clientIp | |
| $accObjType | |
| $accObjId | |
| $accSubType | |
| $accSubId | |
| $lanugage | |
| $browser | |
| $sessionId | |
| $acc_time | |
| $db | |
Definition at line 36 of file class.ilTracking.php.
| ilTracking::_getLastAccess | ( | ) |
get last access data of current user
Definition at line 68 of file class.ilTracking.php.
References $res.
| ilTracking::_hasEntry | ( | $ | a_obj_id, | |
| $ | a_obj_type, | |||
| $ | a_sub_id = 0, |
|||
| $ | a_sub_type = "" | |||
| ) |
Definition at line 80 of file class.ilTracking.php.
References $res.
Referenced by _trackAccess().
{
global $ilDB;
// We query for the session_id since it is more unique than the user_id.
$query = "SELECT COUNT(id) as num_entries FROM ut_access ".
"WHERE session_id = ".$ilDB->quote(session_id())." ".
"AND acc_obj_id = ".$ilDB->quote($a_obj_id)." ".
"AND acc_sub_id = ".$ilDB->quote($a_sub_id);
$res = $ilDB->query($query);
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
return $row->num_entries ? true : false;
}
Here is the caller graph for this function:| ilTracking::_trackAccess | ( | $ | a_obj_id, | |
| $ | a_obj_type, | |||
| $ | a_sub_id = 0, |
|||
| $ | a_sub_type = "", |
|||
| $ | a_action_type = "read" | |||
| ) |
track access to an object by current user
| int | $a_obj_id object id | |
| string | $a_obj_type object type (e.g. "lm") | |
| int | $a_sub_id subobject id | |
| string | $a_sub_type subobject type (e.g. "pg") | |
| string | $a_action_type "read", "write", ... |
Definition at line 105 of file class.ilTracking.php.
References ilObjUserTracking::_enabledLearningProgress(), ilObjUserTracking::_enabledTracking(), ilObjUserTracking::_enabledUserRelatedData(), _hasEntry(), and ilLearningProgress::_tracProgress().
Referenced by ilLMPresentationGUI::ilPage(), and ilObjFileBasedLMGUI::showLearningModule().
{
global $ilUser, $ilDB;
include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
if(!ilObjUserTracking::_enabledTracking() and !ilObjUserTracking::_enabledLearningProgress())
{
return false;
}
include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
ilLearningProgress::_tracProgress($ilUser->getId(),$a_obj_id,$a_obj_type);
if (ilObjUserTracking::_enabledUserRelatedData())
{
$user_id = $ilUser->getId();
}
else
{
$user_id = 0;
}
$client_ip = getenv("REMOTE_ADDR");
$script = substr($_SERVER["SCRIPT_FILENAME"], strlen(IL_ABSOLUTE_PATH) - 1,
strlen($_SERVER["SCRIPT_FILENAME"]) - strlen(IL_ABSOLUTE_PATH) + 1);
$language = $ilUser->getLanguage();
$session_id = session_id();
#$last_access = ilTracking::_getLastAccess();
if(ilTracking::_hasEntry($a_obj_id, $a_obj_type,$a_sub_id, $a_sub_type))
{
return true;
}
$q = "INSERT INTO ut_access ("
."user_id, action_type, php_script, client_ip,"
."acc_obj_type, acc_obj_id, acc_sub_type, acc_sub_id,"
."language, browser, session_id, acc_time"
.") VALUES ("
.$ilDB->quote($user_id).","
.$ilDB->quote($a_action_type).","
.$ilDB->quote($script).","
.$ilDB->quote($client_ip).","
.$ilDB->quote($a_obj_type).","
.$ilDB->quote($a_obj_id).","
.$ilDB->quote($a_sub_type).","
.$ilDB->quote($a_sub_id).","
.$ilDB->quote($language).","
.$ilDB->quote($_SERVER["HTTP_USER_AGENT"]).","
.$ilDB->quote($session_id).", now()"
.")";
$ilDB->query($q);
/*
if(($session_id == $last_access["session_id"]) &&
($a_obj_id == $last_access["acc_obj_id"]) &&
($a_obj_type == $last_access["acc_obj_type"]) &&
($a_sub_id == $last_access["acc_sub_id"]) &&
($a_sub_type == $last_access["acc_sub_type"])
)
{
return true;
}
else
{
$q = "INSERT INTO ut_access ("
."user_id, action_type, php_script, client_ip,"
."acc_obj_type, acc_obj_id, acc_sub_type, acc_sub_id,"
."language, browser, session_id, acc_time"
.") VALUES ("
.$ilDB->quote($user_id).","
.$ilDB->quote($a_action_type).","
.$ilDB->quote($script).","
.$ilDB->quote($client_ip).","
.$ilDB->quote($a_obj_type).","
.$ilDB->quote($a_obj_id).","
.$ilDB->quote($a_sub_type).","
.$ilDB->quote($a_sub_id).","
.$ilDB->quote($language).","
.$ilDB->quote($_SERVER["HTTP_USER_AGENT"]).","
.$ilDB->quote($session_id).", now()"
.")";
$ilDB->query($q);
}
*/
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTracking::addDay | ( | $ | time | ) |
Definition at line 262 of file class.ilTracking.php.
References $ret.
| ilTracking::addHour | ( | $ | time | ) |
Definition at line 249 of file class.ilTracking.php.
References $ret.
| ilTracking::countNum | ( | $ | from, | |
| $ | from1, | |||
| $ | condition | |||
| ) |
Definition at line 377 of file class.ilTracking.php.
References $res.
| ilTracking::countResults | ( | $ | condition | ) |
Definition at line 312 of file class.ilTracking.php.
References $res.
| ilTracking::getPerTestId | ( | $ | test | ) |
Definition at line 370 of file class.ilTracking.php.
References $res.
| ilTracking::getSubId | ( | $ | id | ) |
| ilTracking::getSubTest | ( | $ | id | ) |
| ilTracking::getTest | ( | $ | id | ) |
| ilTracking::getTestId | ( | $ | id | ) |
| ilTracking::ilTracking | ( | ) |
| ilTracking::numDay | ( | $ | from, | |
| $ | to | |||
| ) |
Definition at line 220 of file class.ilTracking.php.
References $ret.
{
$from = strtotime($from);
$to = strtotime($to);
$dayf = date ("d",$from);
$dayt = date ("d",$to);
$yearf = date ("Y",$from);
$yeart = date ("Y",$to);
$montht = date ("m",$to);
$monthf = date ("m",$from);
$ret = ( mktime(0,0,0,$montht,$dayt,$yeart) - mktime(0,0,0,$monthf,$dayf,$yearf))/(3600*24);
return $ret;
}
| ilTracking::numHour | ( | $ | from, | |
| $ | to | |||
| ) |
Definition at line 233 of file class.ilTracking.php.
References $ret.
{
$from = strtotime($from);
$to = strtotime($to);
$dayf = date ("d",$from);
$dayt = date ("d",$to);
$yearf = date ("Y",$from);
$yeart = date ("Y",$to);
$montht = date ("m",$to);
$monthf = date ("m",$from);
$hourt = date ("h",$to);
$hourf = date ("h",$from);
$ret = (mktime($hourt,0,0,$montht,$dayt,$yeart)-mktime($hourf,0,0,$monthf,$dayf,$yearf))/3600;
$ret = strftime($ret);
return $ret;
}
| ilTracking::searchResults | ( | $ | condition | ) |
Definition at line 321 of file class.ilTracking.php.
References $res.
| ilTracking::searchTestId | ( | $ | condition | ) |
| ilTracking::searchTestResults | ( | $ | condition | ) |
Definition at line 335 of file class.ilTracking.php.
References $res.
| ilTracking::searchUserId | ( | $ | condition | ) |
| ilTracking::selectTime | ( | $ | from, | |
| $ | to, | |||
| $ | condition | |||
| ) |
Definition at line 389 of file class.ilTracking.php.
References $res.
| ilTracking::TestTitle | ( | $ | user_id | ) |
| ilTracking::$acc_time |
Definition at line 50 of file class.ilTracking.php.
| ilTracking::$accObjId |
Definition at line 44 of file class.ilTracking.php.
| ilTracking::$accObjType |
Definition at line 43 of file class.ilTracking.php.
| ilTracking::$accSubId |
Definition at line 46 of file class.ilTracking.php.
| ilTracking::$accSubType |
Definition at line 45 of file class.ilTracking.php.
| ilTracking::$actionType |
Definition at line 40 of file class.ilTracking.php.
| ilTracking::$browser |
Definition at line 48 of file class.ilTracking.php.
| ilTracking::$clientIp |
Definition at line 42 of file class.ilTracking.php.
| ilTracking::$db |
Definition at line 52 of file class.ilTracking.php.
| ilTracking::$lanugage |
Definition at line 47 of file class.ilTracking.php.
| ilTracking::$objId |
Definition at line 38 of file class.ilTracking.php.
| ilTracking::$phpScript |
Definition at line 41 of file class.ilTracking.php.
| ilTracking::$sessionId |
Definition at line 49 of file class.ilTracking.php.
| ilTracking::$userId |
Definition at line 39 of file class.ilTracking.php.
1.7.1