19 declare(strict_types=1);
    39         'session_allow_client_maintenance',
    60         self::SESSION_TYPE_USER,
    61         self::SESSION_TYPE_ANONYM
    71         self::SESSION_TYPE_UNKNOWN,
    72         self::SESSION_TYPE_SYSTEM,
    73         self::SESSION_TYPE_ADMIN
    92             case isset($_ENV[
'SHELL']):
    93                 $type = self::SESSION_TYPE_SYSTEM;
    97                 $type = self::SESSION_TYPE_ANONYM;
   100             case self::checkAdministrationPermission(
$user_id):
   101                 $type = self::SESSION_TYPE_ADMIN;
   105                 $type = self::SESSION_TYPE_USER;
   110         self::debug(__METHOD__ . 
" --> update sessions type to (" . $type . 
")");
   129         $ilDB = $DIC[
'ilDB'];
   133         $query = 
"SELECT count(session_id) AS num_sessions FROM usr_session " .
   134                     "WHERE expires > %s " .
   135                     "AND " . 
$ilDB->in(
'type', $a_types, 
false, 
'integer');
   137         $res = 
$ilDB->queryF($query, array(
'integer'), array($ts));
   151         $ilDB = $DIC[
'ilDB'];
   153         $query = 
"SELECT session_id, expires FROM usr_session " .
   154                     "WHERE session_id = %s";
   156         $res = 
$ilDB->queryF($query, array(
'text'), array($a_sid));
   163             if ($row[
'expires'] > $ts) {
   164                 self::debug(__METHOD__ . 
' --> Found a valid session with id (' . $a_sid . 
')');
   167                 self::debug(__METHOD__ . 
' --> Found an expired session with id (' . $a_sid . 
')');
   171         if (count($sessions) === 1) {
   172             self::debug(__METHOD__ . 
' --> Exact one valid session found for session id (' . $a_sid . 
')');
   177         if (count($sessions) > 1) {
   178             self::debug(__METHOD__ . 
' --> Strange!!! More than one sessions found for given session id! (' . $a_sid . 
')');
   180             self::debug(__METHOD__ . 
' --> No valid session found for session id (' . $a_sid . 
')');
   192         self::debug(
'Session cookie has been removed');
   210         $rbacsystem = $DIC[
'rbacsystem'];
   212         $access = $rbacsystem->checkAccessOfUser(
   226     private static function debug(
string $a_debug_log_message): void
   230         $logger = $DIC->logger()->auth();
   232         $logger->debug($a_debug_log_message);
   242         return self::$setting_fields;
 static array $setting_fields
all fieldnames that are saved in settings table 
 
static removeSessionCookie()
removes a session cookie, so it is not sent by browser anymore 
 
static checkAdministrationPermission(int $a_user_id)
checks wether a given user login relates to an user with administrative permissions ...
 
static _lookupId($a_user_str)
 
static getSettingFields()
returns the array of setting fields 
 
const DEFAULT_MIN_IDLE
default value for settings that have not been defined in setup or administration yet ...
 
const SESSION_TYPE_ANONYM
 
static setCookie(string $a_cookie_name, string $a_cookie_value='', bool $a_also_set_super_global=true, bool $a_set_cookie_invalid=false)
 
static isValidSession(string $a_sid)
checks if session exists for given id and if it is still valid 
 
static getExistingSessionCount(array $a_types)
returns number of valid sessions relating to given session types 
 
static handleLoginEvent(string $a_login, ilAuthSession $auth_session)
when current session is allowed to be created it marks it with type regarding to the sessions user co...
 
static array $session_types_controlled
 
const SESSION_TYPE_SYSTEM
 
static array $session_types_not_controlled
all session types that will be involved when count of sessions will be determined or when idleing ses...
 
const DEFAULT_ALLOW_CLIENT_MAINTENANCE
 
static handleLogoutEvent()
reset sessions type to unknown 
 
static set(string $a_var, $a_val)
Set a value. 
 
static debug(string $a_debug_log_message)
logs the given debug message in  
 
const SESSION_TYPE_UNKNOWN
session types from which one is assigned to each session