ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ltiregend.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 require_once("../vendor/composer/vendor/autoload.php");
23 
24 
26 $clientId = (ilSession::has('lti_dynamic_registration_client_id')) ? (string) ilSession::get('lti_dynamic_registration_client_id') : '';
27 $response = [];
28 if (empty($clientId)) {
29  $response["providerId"] = 0;
30  $response["error"] = "could not find created client_id";
31 } else {
32  try {
34  $response["error"] = "";
35  } catch (\ILIAS\Filesystem\Exception\IOException $e) {
36  $response["providerId"] = 0;
37  $response["error"] = $e->getMessage();
38  }
39 }
40 header('Content-Type: application/json; charset=utf-8');
41 echo json_encode($response, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
static get(string $a_var)
Interface Observer Contains several chained tasks and infos about them.
$clientId
Definition: ltiregend.php:26
static getProviderIdFromClientId(string $clientId)
static initILIAS()
ilias initialisation
static has($a_var)
$response
Definition: ltiregend.php:27
header()
expected output: > ILIAS shows the rendered Component.
Definition: header.php:13