forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsessioncheck.php
More file actions
43 lines (37 loc) · 1.38 KB
/
sessioncheck.php
File metadata and controls
43 lines (37 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php declare(strict_types=1);
/******************************************************************************
*
* This file is part of ILIAS, a powerful learning management system.
*
* ILIAS is licensed with the GPL-3.0, you should have received a copy
* of said license along with the source code.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*****************************************************************************/
use ILIAS\Filesystem\Stream\Streams;
use ILIAS\HTTP\Response\ResponseHeader;
if (!file_exists(getcwd() . '/ilias.ini.php')) {
exit();
}
include_once "Services/Context/classes/class.ilContext.php";
ilContext::init(ilContext::CONTEXT_SESSION_REMINDER);
require_once("Services/Init/classes/class.ilInitialisation.php");
ilInitialisation::initILIAS();
/** @var \ILIAS\DI\Container $DIC */
$DIC->http()->saveResponse(
$DIC->http()->response()
->withHeader(ResponseHeader::CONTENT_TYPE, 'application/json')
->withBody(Streams::ofString(
(new ilSessionReminderCheck())->getJsonResponse(
ilUtil::stripSlashes(
$DIC->http()->wrapper()->post()->retrieve('hash', $DIC->refinery()->kindlyTo()->string())
)
)
))
);
$DIC->http()->sendResponse();
$DIC->http()->close();