ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
storeScorm.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
20 require_once("Services/Init/classes/class.ilInitialisation.php");
23 
24 global $DIC;
25 $packageId = $DIC->http()->wrapper()->query()->retrieve('package_id', $DIC->refinery()->kindlyTo()->int());
26 
27 $doUnload = false;
28 if ($DIC->http()->wrapper()->query()->has('do')) {
29  if ($DIC->http()->wrapper()->query()->retrieve('do', $DIC->refinery()->kindlyTo()->string()) == "unload") {
30  $doUnload = true;
31  }
32 }
33 
34 if ($doUnload) {
35  $p = $DIC->http()->wrapper()->query()->retrieve('p', $DIC->refinery()->kindlyTo()->int());
36  $hash = $DIC->http()->wrapper()->query()->retrieve('hash', $DIC->refinery()->kindlyTo()->int());
39 } else {
40  global $ilUser;
41  $data = json_decode(file_get_contents('php://input'));
42  $ilUser->setId((int) $data->p);
45 }
global $DIC
Definition: storeScorm.php:24
$data
Definition: storeScorm.php:41
$packageId
Definition: storeScorm.php:25
const CONTEXT_SCORM
static initILIAS()
ilias initialisation
$doUnload
Definition: storeScorm.php:27
static init(string $a_type)
Init context by type.
$ilUser
Definition: imgupload.php:34
static checkIfAllowed(int $packageId, int $userId, int $hash)