4 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
43 $q =
"SELECT data FROM usr_session WHERE session_id = ".
44 $ilDB->quote($a_session_id,
"text");
45 $set = $ilDB->query($q);
46 $rec = $ilDB->fetchAssoc($set);
61 if (
$GLOBALS[
'WEB_ACCESS_WITHOUT_SESSION'])
82 if ($ilClientIniFile->readVariable(
"session",
"save_ip"))
84 $ilDB->update(
"usr_session", array(
85 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
86 "expires" => array(
"integer", $expires),
87 "data" => array(
"clob", $a_data),
88 "ctime" => array(
"integer", time()),
89 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"]),
90 "remote_addr" => array(
"text", $_SERVER[
"REMOTE_ADDR"])
92 "session_id" => array(
"text", $a_session_id)
97 $ilDB->update(
"usr_session", array(
98 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
99 "expires" => array(
"integer", $expires),
100 "data" => array(
"clob", $a_data),
101 "ctime" => array(
"integer", time()),
102 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"])
104 "session_id" => array(
"text", $a_session_id)
119 if ($ilClientIniFile->readVariable(
"session",
"save_ip"))
121 $ilDB->insert(
"usr_session", array(
122 "session_id" => array(
"text", $a_session_id),
123 "expires" => array(
"integer", $expires),
124 "data" => array(
"clob", $a_data),
125 "ctime" => array(
"integer", time()),
126 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
127 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"]),
128 "createtime" => array(
"integer", time()),
129 "remote_addr" => array(
"text", $_SERVER[
"REMOTE_ADDR"])
134 $ilDB->insert(
"usr_session", array(
135 "session_id" => array(
"text", $a_session_id),
136 "expires" => array(
"integer", $expires),
137 "data" => array(
"clob", $a_data),
138 "ctime" => array(
"integer", time()),
139 "user_id" => array(
"integer", (
int)
$_SESSION[
"AccountId"]),
140 "type" => array(
"integer", (
int) $_SESSION[
"SessionType"]),
141 "createtime" => array(
"integer", time())
166 $q =
"SELECT session_id FROM usr_session WHERE session_id = ".
167 $ilDB->quote($a_session_id,
"text");
168 $set = $ilDB->query($q);
169 if ($ilDB->fetchAssoc($set))
185 $q =
"DELETE FROM usr_session WHERE session_id = ".
186 $ilDB->quote($a_session_id,
"text");
187 $ilDB->manipulate($q);
201 $q =
"DELETE FROM usr_session WHERE user_id = ".
202 $ilDB->quote($a_user_id,
"integer");
203 $ilDB->manipulate($q);
215 $q =
"DELETE FROM usr_session WHERE expires < ".
216 $ilDB->quote(time(),
"integer");
217 $ilDB->manipulate($q);
233 $new_session = $a_session_id;
236 $new_session = md5($new_session);
237 $q =
"SELECT * FROM usr_session WHERE ".
238 "session_id = ".$ilDB->quote($new_session,
"text");
239 $res = $ilDB->query($q);
240 }
while($ilDB->fetchAssoc(
$res));
242 $query =
"SELECT * FROM usr_session ".
243 "WHERE session_id = ".$ilDB->quote($a_session_id,
"text");
246 while (
$row = $ilDB->fetchObject(
$res))
271 return time() + ini_get(
'session.gc_maxlifetime');
297 return $ilClientIniFile->readVariable(
'session',
'expire');
330 $query =
"SELECT DISTINCT user_id FROM usr_session"
331 .
" WHERE remote_addr = " . $ilDB->quote($a_ip,
"text")
332 .
" AND user_id > 0";
338 $users[] =
$row->user_id;