ILIAS  release_8 Revision v8.24
ILIAS\LTI\ToolProvider\Util Class Reference
+ Collaboration diagram for ILIAS\LTI\ToolProvider\Util:

Static Public Member Functions

static isLtiMessage ()
 Check whether the request received could be an LTI message. More...
 
static getRequestParameters ()
 Return GET and POST request parameters (POST parameters take precedence) More...
 
static logError (string $message, bool $showSource=true)
 Log an error message. More...
 
static logInfo (string $message, bool $showSource=false)
 Log an information message. More...
 
static logDebug (string $message, bool $showSource=false)
 Log a debug message. More...
 
static logRequest (bool $debugLevel=false)
 Log a request received. More...
 
static logForm (string $url, array $params, string $method='POST', bool $debugLevel=false)
 Log a form submission. More...
 
static log (string $message, bool $showSource=false)
 Log an error message irrespective of the logging level. More...
 
static sendForm (string $url, array $params, string $target='')
 Generate a web page containing an auto-submitted form of parameters. More...
 
static redirect (string $url, array $params)
 Redirect to a URL with query parameters. More...
 
static getRandomString (int $length=8)
 Generate a random string. More...
 
static stripHtml (string $html)
 Strip HTML tags from a string. More...
 
static cloneObject (object $obj)
 Clone an object and any objects it contains. More...
 
static logtxt (string $msg)
 

Data Fields

const LTI_VERSION1 = 'LTI-1p0'
 LTI version 1 for messages. More...
 
const LTI_VERSION1P3 = '1.3.0'
 LTI version 1.3 for messages. More...
 
const LTI_VERSION2 = 'LTI-2p0'
 LTI version 2 for messages. More...
 
const JWT_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti'
 Prefix for standard JWT message claims. More...
 
const MESSAGE_TYPE_MAPPING
 Mapping for standard message types. More...
 
const JWT_CLAIM_MAPPING
 Mapping for standard message parameters to JWT claim. More...
 
const LOGLEVEL_NONE = 0
 No logging. More...
 
const LOGLEVEL_ERROR = 1
 Log errors only. More...
 
const LOGLEVEL_INFO = 2
 Log error and information messages. More...
 
const LOGLEVEL_DEBUG = 3
 Log all messages. More...
 

Static Public Attributes

static array $LTI_VERSIONS = array(self::LTI_VERSION1, self::LTI_VERSION1P3, self::LTI_VERSION2)
 Permitted LTI versions for messages. More...
 
static array $METHOD_NAMES
 List of supported message types and associated class methods. More...
 
static array $requestParameters = null
 GET and POST request parameters. More...
 
static int $logLevel = self::LOGLEVEL_NONE
 Current logging level. More...
 

Detailed Description

Definition at line 23 of file Util.php.

Member Function Documentation

◆ cloneObject()

static ILIAS\LTI\ToolProvider\Util::cloneObject ( object  $obj)
static

Clone an object and any objects it contains.

Parameters
object$objObject to be cloned
Returns
object

Definition at line 590 of file Util.php.

590 : object
591 {
592 $clone = clone $obj;
593 $objVars = get_object_vars($clone);
594 foreach ($objVars as $attrName => $attrValue) {
595 if (is_object($clone->$attrName)) {
596 $clone->$attrName = self::cloneObject($clone->$attrName);
597 } elseif (is_array($clone->$attrName)) {
598 foreach ($clone->$attrName as &$attrArrayValue) {
599 if (is_object($attrArrayValue)) {
600 $attrArrayValue = self::cloneObject($attrArrayValue);
601 }
602 unset($attrArrayValue);
603 }
604 }
605 }
606
607 return $clone;
608 }
static cloneObject(object $obj)
Clone an object and any objects it contains.
Definition: Util.php:590

References ILIAS\LTI\ToolProvider\Util\cloneObject().

Referenced by ILIAS\LTI\ToolProvider\Util\cloneObject(), and ILIAS\LTI\ToolProvider\parseClaims().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRandomString()

static ILIAS\LTI\ToolProvider\Util::getRandomString ( int  $length = 8)
static

Generate a random string.

The generated string will only comprise letters (upper- and lower-case) and digits.

Parameters
int$lengthLength of string to be generated (optional, default is 8 characters)
Returns
string Random string

Definition at line 558 of file Util.php.

558 : string
559 {
560 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
561
562 $value = '';
563 $charsLength = strlen($chars) - 1;
564
565 for ($i = 1; $i <= $length; $i++) {
566 $value .= $chars[rand(0, $charsLength)];
567 }
568
569 return $value;
570 }
$i
Definition: metadata.php:41

References $i.

Referenced by ILIAS\LTI\ToolProvider\addJWTSignature(), ilObjLTIConsumer\getNewClientId(), ILIAS\LTI\ToolProvider\ResourceLinkShareKey\save(), ILIAS\LTI\ToolProvider\Tool\sendAuthenticationRequest(), and ILIAS\LTI\ToolProvider\Tool\sendRelaunchRequest().

+ Here is the caller graph for this function:

◆ getRequestParameters()

static ILIAS\LTI\ToolProvider\Util::getRequestParameters ( )
static

Return GET and POST request parameters (POST parameters take precedence)

Returns
array|null

Definition at line 224 of file Util.php.

224 : ?array
225 {
226 if (is_null(self::$requestParameters)) {
227// special for ILIAS instead of
228// self::$requestParameters = array_merge($_GET, $_POST);
229// also not possible
230// self::$requestParameters = array_merge(
231// //Argument 1 passed to Symfony\Component\HttpFoundation\Request::createRequestFromFactory() must be of the type array, object given
232// (array) \Symfony\Component\HttpFoundation\Request::createFromGlobals()->query->all(),
233// (array) \Symfony\Component\HttpFoundation\Request::createFromGlobals()->request->all()
234// (array) $_GET, (array) $_POST
235// );
236 global $DIC;
237 $post = $DIC->http()->wrapper()->post();
238 $query = $DIC->http()->wrapper()->query();
239 $refinery = $DIC->refinery()->kindlyTo()->string();
240
241 $divAr = ['accept_copy_advice',
242 'accept_media_types',
243 'accept_multiple',
244 'accept_presentation_document_targets',
245 'accept_types',
246 'accept_unsigned',
247 'auto_create',
248 'can_confirm',
249 'client_id',
250 'content_item_return_url',
251 'context_id',
252 'context_title',
253 'context_type',
254 'custom_ap_attempt_number',
255 'custom_content_item_id',
256 'custom_share_key',
257 'custom_tc_profile_url',
258 'custom_user_username',
259 'custom_username',
260 'deployment_id',
261 'ext_launch_presentation_css_url',
262 'ext_lms',
263 'ext_user_username',
264 'ext_username',
265 'iss',
266 'launch_presentation_css_url',
267 'launch_presentation_document_target',
268 'launch_presentation_height',
269 'launch_presentation_return_url',
270 'launch_presentation_width',
271 'lis_person_contact_email_primary',
272 'lis_person_name_family',
273 'lis_person_name_full',
274 'lis_person_name_given',
275 'lis_person_sourcedid',
276 'login_hint',
277 'lti_deployment_id',
278 'lti_message_hint',
279 'lti_message_type',
280 'lti_version',
281 'oauth_consumer_key',
282 'oauth_signature_method',
283 'openid_configuration',
284 'platform_state',
285 'reg_key',
286 'reg_password',
287 'registration_token',
288 'relaunch_url',
289 'resource_link_id',
290 'resource_link_title',
291 'roles',
292 'target_link_uri',
293 'tc_profile_url',
294 'tool_consumer_info_product_family_code',
295 'tool_consumer_info_version',
296 'tool_consumer_instance_guid',
297 'tool_consumer_instance_name',
298 'user_id',
299 'user_image'
300 ];
301 $LTI_CONSUMER_SETTING_NAMES = ['custom_tc_profile_url', 'custom_system_setting_url', 'custom_oauth2_access_token_url'];
302 $LTI_CONTEXT_SETTING_NAMES = ['custom_context_setting_url',
303 'ext_ims_lis_memberships_id', 'ext_ims_lis_memberships_url',
304 'custom_context_memberships_url', 'custom_context_memberships_v2_url',
305 'custom_context_group_sets_url', 'custom_context_groups_url',
306 'custom_lineitems_url', 'custom_ags_scopes'
307 ];
308 $LTI_RESOURCE_LINK_SETTING_NAMES = ['lis_result_sourcedid', 'lis_outcome_service_url',
309 'ext_ims_lis_basic_outcome_url', 'ext_ims_lis_resultvalue_sourcedids', 'ext_outcome_data_values_accepted',
310 'ext_ims_lis_memberships_id', 'ext_ims_lis_memberships_url',
311 'ext_ims_lti_tool_setting', 'ext_ims_lti_tool_setting_id', 'ext_ims_lti_tool_setting_url',
312 'custom_link_setting_url', 'custom_link_memberships_url',
313 'custom_lineitems_url', 'custom_lineitem_url', 'custom_ags_scopes',
314 'custom_ap_acs_url'
315 ];
316
317 $requestAr = array_merge($divAr, $LTI_CONSUMER_SETTING_NAMES, $LTI_CONTEXT_SETTING_NAMES, $LTI_RESOURCE_LINK_SETTING_NAMES);
318
319 foreach ($requestAr as $param) {
320 if ($query->has($param)) {
321 self::$requestParameters[$param] = $query->retrieve($param, $refinery);
322 }
323 if ($post->has($param)) {
324 self::$requestParameters[$param] = $post->retrieve($param, $refinery);
325 }
326 }
327 }
329 }
static array $requestParameters
GET and POST request parameters.
Definition: Util.php:182
global $DIC
Definition: feed.php:28
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
$query
$param
Definition: xapitoken.php:46

References $DIC, $param, $post, $query, ILIAS\Repository\$refinery, and ILIAS\LTI\ToolProvider\Util\$requestParameters.

Referenced by ILIAS\LTI\ToolProvider\Tool\getPlatformConfiguration(), ILIAS\LTI\ToolProvider\Platform\handleAuthenticationRequest(), ILIAS\LTI\ToolProvider\Platform\handleRequest(), ILIAS\LTI\ToolProvider\Tool\handleRequest(), ILIAS\LTI\ToolProvider\Platform\onAuthenticate(), and ILIAS\LTI\ToolProvider\Tool\sendRegistration().

+ Here is the caller graph for this function:

◆ isLtiMessage()

static ILIAS\LTI\ToolProvider\Util::isLtiMessage ( )
static

Check whether the request received could be an LTI message.

Returns
bool

Definition at line 196 of file Util.php.

196 : bool
197 {
198// $isLti = ($_SERVER['REQUEST_METHOD'] === 'POST') &&
199// (!empty($_POST['lti_message_type']) || !empty($_POST['id_token']) || !empty($_POST['JWT']) ||
200// !empty($_POST['iss']));
201// if (!$isLti) {
202// $isLti = ($_SERVER['REQUEST_METHOD'] === 'GET') && (!empty($_GET['iss']) || !empty($_GET['openid_configuration']));
203// }
204 global $DIC;
205 $wrapper = $DIC->http()->wrapper()->post();
206 $refString = $DIC->refinery()->kindlyTo()->string();
207 $isLti = ($wrapper->has('lti_message_type') && $wrapper->retrieve('lti_message_type', $refString) != '') ||
208 ($wrapper->has('id_token') && $wrapper->retrieve('id_token', $refString) != '') ||
209 ($wrapper->has('JWT') && $wrapper->retrieve('JWT', $refString) != '') ||
210 ($wrapper->has('iss') && $wrapper->retrieve('iss', $refString) != '');
211 if (!$isLti) {
212 $wrapper = $DIC->http()->wrapper()->query();
213 $isLti = ($wrapper->has('iss') && $wrapper->retrieve('iss', $refString) != '') ||
214 ($wrapper->has('openid_configuration') && $wrapper->retrieve('openid_configuration', $refString) != '');
215 }
216 return $isLti;
217 }

References $DIC.

◆ log()

static ILIAS\LTI\ToolProvider\Util::log ( string  $message,
bool  $showSource = false 
)
static

Log an error message irrespective of the logging level.

Parameters
string$messageMessage to be logged
bool$showSourceTrue if the name and line number of the current file are to be included
Returns
void

Definition at line 439 of file Util.php.

440 {
441 $source = '';
442 if ($showSource) {
443 $backtraces = debug_backtrace();
444 foreach ($backtraces as $backtrace) {
445 if (isset($backtrace['file'])) {
446 $source .= PHP_EOL . " {$backtrace['file']}";
447 if (isset($backtrace['line'])) {
448 $source .= " line {$backtrace['line']}";
449 }
450 }
451 }
452 if (!empty($source)) {
453 $source = PHP_EOL . "See: {$source}";
454 }
455 }
456 error_log($message . $source);
457 }
$source
Definition: metadata.php:93
$message
Definition: xapiexit.php:32

References $message, and $source.

Referenced by ILIAS\LTI\ToolProvider\Util\logDebug(), ILIAS\LTI\ToolProvider\Util\logError(), and ILIAS\LTI\ToolProvider\Util\logInfo().

+ Here is the caller graph for this function:

◆ logDebug()

static ILIAS\LTI\ToolProvider\Util::logDebug ( string  $message,
bool  $showSource = false 
)
static

Log a debug message.

Parameters
string$messageMessage to be logged
bool$showSourceTrue if the name and line number of the current file are to be included
Returns
void

Definition at line 363 of file Util.php.

364 {
365 if (self::$logLevel >= self::LOGLEVEL_DEBUG) {
366 self::log("[DEBUG] {$message}", $showSource);
367 }
368 }
static log(string $message, bool $showSource=false)
Log an error message irrespective of the logging level.
Definition: Util.php:439

References ILIAS\LTI\ToolProvider\Util\log().

Referenced by ILIAS\LTI\ToolProvider\Http\HttpMessage\getHttpClient(), ILIAS\LTI\ToolProvider\Jwt\Jwt\getJwtClient(), ILIAS\LTI\ToolProvider\Context\getMembership(), ILIAS\LTI\ToolProvider\ResourceLink\getMembership(), ILIAS\LTI\ToolProvider\Context\hasMembershipService(), ILIAS\LTI\ToolProvider\ResourceLink\hasMembershipService(), ILIAS\LTI\ToolProvider\Util\logForm(), ILIAS\LTI\ToolProvider\Util\logRequest(), ILIAS\LTI\ToolProvider\Http\HttpMessage\setHttpClient(), and ILIAS\LTI\ToolProvider\Jwt\Jwt\setJwtClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logError()

static ILIAS\LTI\ToolProvider\Util::logError ( string  $message,
bool  $showSource = true 
)
static

Log an error message.

Parameters
string$messageMessage to be logged
bool$showSourceTrue if the name and line number of the current file are to be included
Returns
void

Definition at line 337 of file Util.php.

338 {
339 if (self::$logLevel >= self::LOGLEVEL_ERROR) {
340 self::log("[ERROR] {$message}", $showSource);
341 }
342 }

References ILIAS\LTI\ToolProvider\Util\log().

Referenced by ILIAS\LTI\ToolProvider\Platform\handleRequest(), ILIAS\LTI\ToolProvider\Tool\handleRequest(), ILIAS\LTI\ToolProvider\Http\HttpMessage\send(), ILIAS\LTI\ToolProvider\Jwt\FirebaseClient\sign(), and ILIAS\LTI\ToolProvider\Jwt\FirebaseClient\verify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logForm()

static ILIAS\LTI\ToolProvider\Util::logForm ( string  $url,
array  $params,
string  $method = 'POST',
bool  $debugLevel = false 
)
static

Log a form submission.

Parameters
string$urlURL to which the form should be submitted
array$paramsArray of form parameters
string$methodHTTP Method used to submit form (optional, default is POST)
bool$debugLevelTrue if the form details should always be logged (optional, default is false to use current log level)
Returns
void

Definition at line 411 of file Util.php.

412 {
413 if (!$debugLevel) {
415 } else {
417 }
418 if (self::$logLevel >= self::LOGLEVEL_INFO) {
419 $message = "Form submitted using {$method} to '{$url}'";
420 if (!empty($params)) {
421 $message .= " with parameters of:\n" . var_export($params, true);
422 } else {
423 $message .= " with no parameters";
424 }
425 if ($logLevel < self::LOGLEVEL_DEBUG) {
427 } else {
429 }
430 }
431 }
static logInfo(string $message, bool $showSource=false)
Log an information message.
Definition: Util.php:350
const LOGLEVEL_DEBUG
Log all messages.
Definition: Util.php:156
static int $logLevel
Current logging level.
Definition: Util.php:189
static logDebug(string $message, bool $showSource=false)
Log a debug message.
Definition: Util.php:363
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33

References ILIAS\LTI\ToolProvider\Util\$logLevel, $message, $params, ILIAS\LTI\ToolProvider\Util\logDebug(), ILIAS\LTI\ToolProvider\Util\logInfo(), and ILIAS\LTI\ToolProvider\Util\LOGLEVEL_DEBUG.

Referenced by ILIAS\LTI\ToolProvider\Util\sendForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logInfo()

static ILIAS\LTI\ToolProvider\Util::logInfo ( string  $message,
bool  $showSource = false 
)
static

Log an information message.

Parameters
string$messageMessage to be logged
bool$showSourceTrue if the name and line number of the current file are to be included
Returns
void

Definition at line 350 of file Util.php.

351 {
352 if (self::$logLevel >= self::LOGLEVEL_INFO) {
353 self::log("[INFO] {$message}", $showSource);
354 }
355 }

References ILIAS\LTI\ToolProvider\Util\log().

Referenced by ILIAS\LTI\ToolProvider\Tool\checkValue(), ILIAS\LTI\ToolProvider\Util\logForm(), ILIAS\LTI\ToolProvider\Util\logRequest(), and ILIAS\LTI\ToolProvider\Http\HttpMessage\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logRequest()

static ILIAS\LTI\ToolProvider\Util::logRequest ( bool  $debugLevel = false)
static

Log a request received.

Parameters
bool$debugLevelTrue if the request details should be logged at the debug level (optional, default is false for information level)
Returns
void

Definition at line 375 of file Util.php.

376 {
377 if (!$debugLevel) {
379 } else {
381 }
382 if (self::$logLevel >= $logLevel) {
383 $message = "{$_SERVER['REQUEST_METHOD']} request received for '{$_SERVER['REQUEST_URI']}'";
384// $body = file_get_contents(OAuth\OAuthRequest::$POST_INPUT);
385 $body = file_get_contents(LTIOAuth\OAuthRequest::$POST_INPUT);
386 if (!empty($body)) {
387// $params = OAuth\OAuthUtil::parse_parameters($body);
388 $params = LTIOAuth\OAuthUtil::parse_parameters($body);
389 if (!empty($params)) {
390 $message .= " with body parameters of:\n" . var_export($params, true);
391 } else {
392 $message .= " with a body of:\n" . var_export($body, true);
393 }
394 }
395 if (!$debugLevel) {
397 } else {
399 }
400 }
401 }
const LOGLEVEL_INFO
Log error and information messages.
Definition: Util.php:151

References ILIAS\LTI\ToolProvider\Util\$logLevel, $message, $params, ILIAS\LTI\ToolProvider\Util\logDebug(), ILIAS\LTI\ToolProvider\Util\logInfo(), ILIAS\LTI\ToolProvider\Util\LOGLEVEL_DEBUG, and ILIAS\LTI\ToolProvider\Util\LOGLEVEL_INFO.

Referenced by ILIAS\LTI\ToolProvider\Platform\handleRequest(), ILIAS\LTI\ToolProvider\Tool\handleRequest(), and ILIAS\LTI\ToolProvider\Tool\sendAuthenticationRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logtxt()

static ILIAS\LTI\ToolProvider\Util::logtxt ( string  $msg)
static

Definition at line 611 of file Util.php.

612 {
613 file_put_contents("log.txt", $msg . "\n", FILE_APPEND);
614 }

◆ redirect()

static ILIAS\LTI\ToolProvider\Util::redirect ( string  $url,
array  $params 
)
static

Redirect to a URL with query parameters.

Parameters
string$urlURL to which the form should be submitted
array$paramsArray of form parameters
Returns
string

Definition at line 523 of file Util.php.

523 : string
524 {
525 if (!empty($params)) {
526 if (strpos($url, '?') === false) {
527 $url .= '?';
528 $sep = '';
529 } else {
530 $sep = '&';
531 }
532 foreach ($params as $key => $value) {
533 $key = urlencode($key);
534 if (!is_array($value)) {
535 $value = urlencode($value);
536 $url .= "{$sep}{$key}={$value}";
537 $sep = '&';
538 } else {
539 foreach ($value as $element) {
540 $element = urlencode($element);
541 $url .= "{$sep}{$key}={$element}";
542 $sep = '&';
543 }
544 }
545 }
546 }
547
548 header("Location: {$url}");
549 exit;
550 }
exit
Definition: login.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
$url

References ILIAS\LTI\ToolProvider\$key, $params, $url, and exit.

Referenced by ILIAS\LTI\ToolProvider\Tool\sendAuthenticationRequest().

+ Here is the caller graph for this function:

◆ sendForm()

static ILIAS\LTI\ToolProvider\Util::sendForm ( string  $url,
array  $params,
string  $target = '' 
)
static

Generate a web page containing an auto-submitted form of parameters.

Parameters
string$urlURL to which the form should be submitted
array$paramsArray of form parameters
string$targetName of target (optional)
Returns
string

Definition at line 466 of file Util.php.

466 : string
467 {
468 self::logForm($url, $params, 'POST');
469 $page = <<< EOD
470<html>
471<head>
472<title>IMS LTI message</title>
473<script type="text/javascript">
474//<![CDATA[
475function doOnLoad() {
476 document.forms[0].submit();
477}
478
479window.onload=doOnLoad;
480//]]>
481</script>
482</head>
483<body>
484<form action="{$url}" method="post" target="{$target}" encType="application/x-www-form-urlencoded">
485
486EOD;
487 if (!empty($params)) {
488 foreach ($params as $key => $value) {
489 $key = htmlentities($key, ENT_COMPAT | ENT_HTML401, 'UTF-8');
490 if (!is_array($value)) {
491 $value = htmlentities($value, ENT_COMPAT | ENT_HTML401, 'UTF-8');
492 $page .= <<< EOD
493 <input type="hidden" name="{$key}" value="{$value}" />
494
495EOD;
496 } else {
497 foreach ($value as $element) {
498 $element = htmlentities($element, ENT_COMPAT | ENT_HTML401, 'UTF-8');
499 $page .= <<< EOD
500 <input type="hidden" name="{$key}" value="{$element}" />
501
502EOD;
503 }
504 }
505 }
506 }
507
508 $page .= <<< EOD
509</form>
510</body>
511</html>
512EOD;
513
514 return $page;
515 }
static logForm(string $url, array $params, string $method='POST', bool $debugLevel=false)
Log a form submission.
Definition: Util.php:411
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\LTI\ToolProvider\$key, $params, $url, ILIAS\Repository\form(), ILIAS\Repository\html(), and ILIAS\LTI\ToolProvider\Util\logForm().

Referenced by ILIAS\LTI\ToolProvider\Platform\handleAuthenticationRequest(), ILIAS\LTI\ToolProvider\Tool\sendAuthenticationRequest(), ILIAS\LTI\ToolProvider\sendMessage(), and ILIAS\LTI\ToolProvider\Tool\sendRelaunchRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stripHtml()

static ILIAS\LTI\ToolProvider\Util::stripHtml ( string  $html)
static

Strip HTML tags from a string.

Parameters
string$htmlHTML string to be stripped
Returns
string

Definition at line 577 of file Util.php.

577 : string
578 {
579 $html = strip_tags($html);
580 $html = html_entity_decode($html, ENT_QUOTES | ENT_HTML401);
581
582 return $html;
583 }

Field Documentation

◆ $logLevel

◆ $LTI_VERSIONS

array ILIAS\LTI\ToolProvider\Util::$LTI_VERSIONS = array(self::LTI_VERSION1, self::LTI_VERSION1P3, self::LTI_VERSION2)
static

Permitted LTI versions for messages.

Definition at line 161 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\checkMessage().

◆ $METHOD_NAMES

array ILIAS\LTI\ToolProvider\Util::$METHOD_NAMES
static
Initial value:
= array(
'basic-lti-launch-request' => 'onLaunch',
'ConfigureLaunchRequest' => 'onConfigure',
'DashboardRequest' => 'onDashboard',
'ContentItemSelectionRequest' => 'onContentItem',
'ContentItemSelection' => 'onContentItem',
'ContentItemUpdateRequest' => 'onContentItemUpdate',
'ToolProxyRegistrationRequest' => 'onRegister',
'LtiStartProctoring' => 'onLtiStartProctoring',
'LtiStartAssessment' => 'onLtiStartAssessment',
'LtiEndAssessment' => 'onLtiEndAssessment'
)

List of supported message types and associated class methods.

Definition at line 166 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\doCallback().

◆ $requestParameters

array ILIAS\LTI\ToolProvider\Util::$requestParameters = null
static

GET and POST request parameters.

Definition at line 182 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\Util\getRequestParameters().

◆ JWT_CLAIM_MAPPING

const ILIAS\LTI\ToolProvider\Util::JWT_CLAIM_MAPPING

Mapping for standard message parameters to JWT claim.

Definition at line 58 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\getMessageClaims(), ilObjLTIConsumer\LTISignJWT(), and ILIAS\LTI\ToolProvider\parseClaims().

◆ JWT_CLAIM_PREFIX

const ILIAS\LTI\ToolProvider\Util::JWT_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti'

◆ LOGLEVEL_DEBUG

◆ LOGLEVEL_ERROR

const ILIAS\LTI\ToolProvider\Util::LOGLEVEL_ERROR = 1

Log errors only.

Definition at line 146 of file Util.php.

◆ LOGLEVEL_INFO

const ILIAS\LTI\ToolProvider\Util::LOGLEVEL_INFO = 2

Log error and information messages.

Definition at line 151 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\Util\logRequest(), and ILIAS\LTI\ToolProvider\Tool\sendAuthenticationRequest().

◆ LOGLEVEL_NONE

const ILIAS\LTI\ToolProvider\Util::LOGLEVEL_NONE = 0

No logging.

Definition at line 141 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\Http\HttpMessage\send().

◆ LTI_VERSION1

const ILIAS\LTI\ToolProvider\Util::LTI_VERSION1 = 'LTI-1p0'

LTI version 1 for messages.

Definition at line 28 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\parseRoles(), and ILIAS\LTI\ToolProvider\Tool\result().

◆ LTI_VERSION1P3

const ILIAS\LTI\ToolProvider\Util::LTI_VERSION1P3 = '1.3.0'

◆ LTI_VERSION2

const ILIAS\LTI\ToolProvider\Util::LTI_VERSION2 = 'LTI-2p0'

LTI version 2 for messages.

Definition at line 38 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\Tool\authenticate(), and ILIAS\LTI\ToolProvider\Service\Membership\getMembers().

◆ MESSAGE_TYPE_MAPPING

const ILIAS\LTI\ToolProvider\Util::MESSAGE_TYPE_MAPPING
Initial value:
= array(
'basic-lti-launch-request' => 'LtiResourceLinkRequest',
'ContentItemSelectionRequest' => 'LtiDeepLinkingRequest',
'ContentItemSelection' => 'LtiDeepLinkingResponse',
'ContentItemUpdateRequest' => 'LtiDeepLinkingUpdateRequest'
)

Mapping for standard message types.

Definition at line 48 of file Util.php.

Referenced by ILIAS\LTI\ToolProvider\Tool\getConfiguration(), ILIAS\LTI\ToolProvider\getMessageClaims(), and ilObjLTIConsumer\LTISignJWT().


The documentation for this class was generated from the following file: