ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
storeScorm.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
20 require_once __DIR__ . "/../vendor/composer/vendor/autoload.php";
21 
24 
25 global $DIC;
26 $packageId = $DIC->http()->wrapper()->query()->retrieve('package_id', $DIC->refinery()->kindlyTo()->int());
27 
28 $doUnload = false;
29 if ($DIC->http()->wrapper()->query()->has('do')) {
30  if ($DIC->http()->wrapper()->query()->retrieve('do', $DIC->refinery()->kindlyTo()->string()) == "unload") {
31  $doUnload = true;
32  }
33 }
34 
35 if ($doUnload) {
36  $p = $DIC->http()->wrapper()->query()->retrieve('p', $DIC->refinery()->kindlyTo()->int());
37  $hash = $DIC->http()->wrapper()->query()->retrieve('hash', $DIC->refinery()->kindlyTo()->int());
40 } else {
41  global $ilUser;
42  $data = json_decode(file_get_contents('php://input'));
43  $ilUser->setId((int) $data->p);
46 }
global $DIC
Definition: storeScorm.php:25
$data
Definition: storeScorm.php:42
$packageId
Definition: storeScorm.php:26
const CONTEXT_SCORM
static initILIAS()
ilias initialisation
$doUnload
Definition: storeScorm.php:28
static init(string $a_type)
Init context by type.
static checkIfAllowed(int $packageId, int $userId, int $hash)