19declare(strict_types=1);
21use ceLTIc\LTI\Context;
22use ceLTIc\LTI\ResourceLink;
47 if (empty($dataConnector)) {
50 $this->dataConnector = $dataConnector;
52 $this->setParameterConstraint(
'resource_link_id',
true, 50, array(
'basic-lti-launch-request'));
53 $this->setParameterConstraint(
'user_id',
true, 64, array(
'basic-lti-launch-request'));
54 $this->setParameterConstraint(
'roles',
true,
null, array(
'basic-lti-launch-request'));
55 $this->setParameterConstraint(
'lis_person_contact_email_primary',
true, 80, array(
'basic-lti-launch-request'));
64 if ($this->userResult instanceof User) {
65 $this->
logger->debug(
"onLaunch - user");
66 $this->userResult->save();
69 if ($this->context instanceof Context) {
70 $this->
logger->debug(
"onLaunch - context");
71 $this->context->save();
74 if ($this->resourceLink instanceof ResourceLink) {
75 $this->
logger->debug(
"onLaunch - resource");
76 $this->resourceLink->save();
84 foreach ($postData->
keys() as $key) {
85 $res[$key] = $postData->
retrieve($key,
$DIC->refinery()->kindlyTo()->string());
90 public function handleRequest(
bool $strictMode =
null,
bool $disableCookieCheck =
false,
bool $generateWarnings =
false): void
95 $_GET =
$DIC->http()->request()->getQueryParams();
97 if (isset(
$_POST[
'lti_version']) &&
$_POST[
'lti_version'] ===
'LTI-1p0') {
98 $_SERVER[
'REQUEST_URI'] = rtrim(preg_replace(
'/([?&])client_id=[^&]+(&|$)/',
'$1',
$_SERVER[
'REQUEST_URI']),
'?&');
101 self::$authenticateUsingGet =
true;
103 parent::handleRequest($strictMode, $disableCookieCheck, $generateWarnings);
Class ArrayBasedRequestWrapper.
retrieve(string $key, Transformation $transformation)
@inheritDoc
static getDataConnector(mixed $db=null, string $dbTableNamePrefix='', string $type='')
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.