ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSessionReminderCheck Class Reference
+ Collaboration diagram for ilSessionReminderCheck:

Public Member Functions

 __construct (private GlobalHttpState $http, private Refinery $refinery, private ilLanguage $lng, private ilDBInterface $db, private ilIniFile $client_ini, private ilLogger $logger, private ClockInterface $clock, private ilSetting $settings)
 

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSessionReminderCheck::__construct ( private GlobalHttpState  $http,
private Refinery  $refinery,
private ilLanguage  $lng,
private ilDBInterface  $db,
private ilIniFile  $client_ini,
private ilLogger  $logger,
private ClockInterface  $clock,
private ilSetting  $settings 
)

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

39 {
40 }

Member Function Documentation

◆ isAuthenticatedUsrSession()

ilSessionReminderCheck::isAuthenticatedUsrSession ( ?array  $data)
private

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

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

References $data, and ANONYMOUS_USER_ID.

◆ isSessionAlreadyExpired()

ilSessionReminderCheck::isSessionAlreadyExpired ( int  $expirationTime)
private

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

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

◆ toJsonResponse()

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

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

158 : ResponseInterface
159 {
160 return $this->http->response()
161 ->withHeader(ResponseHeader::CONTENT_TYPE, 'application/json')
162 ->withBody(Streams::ofString(json_encode($data, JSON_THROW_ON_ERROR)));
163 }
static http()
Fetches the global http state from ILIAS.

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

+ Here is the call graph for this function:

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