19declare(strict_types=1);
34 'session_allow_client_maintenance',
72 case isset($_ENV[
'SHELL']):
90 self::debug(__METHOD__ .
' --> update sessions type to (' . $type .
')');
113 $query =
'SELECT count(session_id) AS num_sessions FROM usr_session ' .
114 'WHERE expires > %s ' .
115 'AND ' .
$ilDB->in(
'type', $a_types,
false,
'integer');
117 $res =
$ilDB->queryF($query, [
'integer'], [$ts]);
127 $query =
'SELECT session_id, expires FROM usr_session ' .
128 'WHERE session_id = %s';
130 $res =
$ilDB->queryF($query, [
'text'], [$a_sid]);
137 if ($row[
'expires'] > $ts) {
138 self::debug(__METHOD__ .
' --> Found a valid session with id (' . $a_sid .
')');
141 self::debug(__METHOD__ .
' --> Found an expired session with id (' . $a_sid .
')');
145 if (count($sessions) === 1) {
146 self::debug(__METHOD__ .
' --> Exact one valid session found for session id (' . $a_sid .
')');
151 if (count($sessions) > 1) {
152 self::debug(__METHOD__ .
' --> Strange!!! More than one sessions found for given session id! (' . $a_sid .
')');
154 self::debug(__METHOD__ .
' --> No valid session found for session id (' . $a_sid .
')');
174 $rbacsystem =
$DIC[
'rbacsystem'];
176 $access = $rbacsystem->checkAccessOfUser(
185 private static function debug(
string $a_debug_log_message): void
189 $logger =
$DIC->logger()->auth();
191 $logger->debug($a_debug_log_message);
static _lookupId(string|array $a_user_str)
const int SESSION_TYPE_ANONYM
static array $setting_fields
const int DEFAULT_MIN_IDLE
default value for settings that have not been defined in setup or administration yet
const string SESSION_TYPE_KEY
static handleLogoutEvent()
reset sessions type to unknown
static array $session_types_not_controlled
all session types that will be involved when count of sessions will be determined or when idleing ses...
static handleLoginEvent(string $a_login, ilAuthSession $auth_session)
static isValidSession(string $a_sid)
const int SESSION_TYPE_USER
static checkAdministrationPermission(int $a_user_id)
const int SESSION_TYPE_SYSTEM
static debug(string $a_debug_log_message)
static getSettingFields()
static getExistingSessionCount(array $a_types)
static removeSessionCookie()
static array $session_types_controlled
const int SESSION_TYPE_ADMIN
const int SESSION_TYPE_UNKNOWN
session types from which one is assigned to each session
const int DEFAULT_ALLOW_CLIENT_MAINTENANCE
static set(string $a_var, $a_val)
Set a value.
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)