19declare(strict_types=1);
21require_once __DIR__ .
'/../vendor/composer/vendor/autoload.php';
37 $error = array(
'error-code' => 3,
'error-text' =>
'invalid request: missing or empty param request parameter');
44 $param = json_decode(openssl_decrypt(
63 $error = array(
'error-code' =>
'3',
'error-text' =>
'internal server error');
71 $tokenCmi5Session =
$token->getCmi5Session();
72 $alreadyReturnedCmi5Session =
$token->getReturnedForCmi5Session();
73 if ($tokenCmi5Session == $alreadyReturnedCmi5Session) {
78 $error = array(
'error-code' =>
'1',
'error-text' =>
'The authorization token has already been returned.');
82 $token->setReturnedForCmi5Session($tokenCmi5Session);
85 if ($object->isBypassProxyEnabled()) {
86 $authToken = $object->getLrsType()->getBasicAuthWithoutBasic();
95 $error = array(
'error-code' =>
'2',
'error-text' =>
'could not create valid session from token.');
101 if (isset($_SERVER[
"HTTP_ORIGIN"]) && $_SERVER[
"HTTP_ORIGIN"] !=
"") {
102 header(
'Access-Control-Allow-Origin: ' . $_SERVER[
"HTTP_ORIGIN"]);
104 header(
'Access-Control-Allow-Credentials: true');
105 header(
'Content-type:application/json;charset=utf-8');
static getInstanceByObjIdAndRefIdAndUsrId(int $objId, int $refId, int $usrId, bool $checkValid=true)
const OPENSSL_ENCRYPTION_METHOD
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
$_GET['cmd']
Endpoint a platform launches ILIAS objects at, with any LTI version: the launch logs the user in thro...
$tokenRestriction
see: https://github.com/AICC/CMI-5_Spec_Current/blob/quartz/cmi5_spec.md#fetch_url response should al...
catch(ilCmiXapiException $e) send($response)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...