ILIAS  release_8 Revision v8.24
ilSessionReminderCheck Class Reference
+ Collaboration diagram for ilSessionReminderCheck:

Public Member Functions

 __construct (GlobalHttpState $http, Refinery $refinery, ilLanguage $lng, ilDBInterface $db, ilIniFile $clientIni, ilLogger $logger, ClockInterface $utcClock)
 

Private Member Functions

 toJsonResponse ($data)
 
 isSessionAlreadyExpired (int $expirationTime)
 
 isAuthenticatedUsrSession (?array $data)
 

Private Attributes

GlobalHttpState $http
 
Refinery $refinery
 
ilLanguage $lng
 
ilDBInterface $db
 
ilIniFile $clientIni
 
ilLogger $logger
 
ClockInterface $clock
 

Detailed Description

Definition at line 28 of file class.ilSessionReminderCheck.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionReminderCheck::__construct ( GlobalHttpState  $http,
Refinery  $refinery,
ilLanguage  $lng,
ilDBInterface  $db,
ilIniFile  $clientIni,
ilLogger  $logger,
ClockInterface  $utcClock 
)

Definition at line 38 of file class.ilSessionReminderCheck.php.

46 {
47 $this->http = $http;
48 $this->refinery = $refinery;
49 $this->lng = $lng;
50 $this->db = $db;
51 $this->clientIni = $clientIni;
52 $this->logger = $logger;
53 $this->clock = $utcClock;
54 }
static http()
Fetches the global http state from ILIAS.

References $clientIni, $db, $http, $lng, $logger, $refinery, ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ isAuthenticatedUsrSession()

ilSessionReminderCheck::isAuthenticatedUsrSession ( ?array  $data)
private

Definition at line 171 of file class.ilSessionReminderCheck.php.

171 : bool
172 {
173 return (
174 is_array($data) &&
175 isset($data['user_id']) &&
176 (int) $data['user_id'] > 0 &&
177 (int) $data['user_id'] !== ANONYMOUS_USER_ID
178 );
179 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References $data, and ANONYMOUS_USER_ID.

◆ isSessionAlreadyExpired()

ilSessionReminderCheck::isSessionAlreadyExpired ( int  $expirationTime)
private

Definition at line 166 of file class.ilSessionReminderCheck.php.

166 : bool
167 {
168 return $expirationTime < $this->clock->now()->getTimestamp();
169 }

◆ toJsonResponse()

ilSessionReminderCheck::toJsonResponse (   $data)
private
Parameters
mixed$data
Returns
ResponseInterface

Definition at line 159 of file class.ilSessionReminderCheck.php.

159 : ResponseInterface
160 {
161 return $this->http->response()
162 ->withHeader(ResponseHeader::CONTENT_TYPE, 'application/json')
163 ->withBody(Streams::ofString(json_encode($data, JSON_THROW_ON_ERROR)));
164 }

References $data, and ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

Field Documentation

◆ $clientIni

ilIniFile ilSessionReminderCheck::$clientIni
private

Definition at line 34 of file class.ilSessionReminderCheck.php.

Referenced by __construct().

◆ $clock

ClockInterface ilSessionReminderCheck::$clock
private

Definition at line 36 of file class.ilSessionReminderCheck.php.

◆ $db

ilDBInterface ilSessionReminderCheck::$db
private

Definition at line 33 of file class.ilSessionReminderCheck.php.

Referenced by __construct().

◆ $http

GlobalHttpState ilSessionReminderCheck::$http
private

Definition at line 30 of file class.ilSessionReminderCheck.php.

Referenced by __construct().

◆ $lng

ilLanguage ilSessionReminderCheck::$lng
private

Definition at line 32 of file class.ilSessionReminderCheck.php.

Referenced by __construct().

◆ $logger

ilLogger ilSessionReminderCheck::$logger
private

Definition at line 35 of file class.ilSessionReminderCheck.php.

Referenced by __construct().

◆ $refinery

Refinery ilSessionReminderCheck::$refinery
private

Definition at line 31 of file class.ilSessionReminderCheck.php.

Referenced by __construct().


The documentation for this class was generated from the following file: