ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjLTIConsumer Class Reference
+ Inheritance diagram for ilObjLTIConsumer:
+ Collaboration diagram for ilObjLTIConsumer:

Public Member Functions

 __construct (int $a_id=0, bool $a_reference=true)
 ilObjLTIConsumer constructor. More...
 
 isActivationLimited ()
 
 setActivationLimited (bool $activationLimited)
 
 getActivationStartingTime ()
 
 setActivationStartingTime (?int $activationStartingTime=null)
 
 getActivationEndingTime ()
 
 setActivationEndingTime (?int $activationEndingTime=null)
 
 getActivationVisibility ()
 
 setActivationVisibility (bool $activationVisibility)
 
 getMasteryScore ()
 
 setMasteryScore (float $mastery_score)
 
 getMasteryScorePercent ()
 
 setMasteryScorePercent (float $mastery_score_percent)
 
 getProviderId ()
 
 setProviderId (int $providerId)
 
 initProvider ()
 
 getProvider ()
 
 setProvider (ilLTIConsumeProvider $provider)
 
 isLaunchMethodOwnWin ()
 
 isLaunchMethodEmbedded ()
 
 getLaunchMethod ()
 
 setLaunchMethod (string $launchMethod)
 
 getCustomLaunchKey ()
 
 setCustomLaunchKey (string $customLaunchKey)
 
 getCustomLaunchSecret ()
 
 setCustomLaunchSecret (string $customLaunchSecret)
 
 getCustomParams ()
 
 setCustomParams (string $customParams)
 
 getLaunchKey ()
 
 getLaunchSecret ()
 
 getUseXapi ()
 
 setUseXapi (bool $use_xapi)
 
 getCustomActivityId ()
 
 setCustomActivityId (string $custom_activity_id)
 
 getActivityId ()
 
 isStatementsReportEnabled ()
 
 setStatementsReportEnabled (bool $statementsReportEnabled)
 
 getCustomParamsArray ()
 
 load ()
 
 save ()
 
 setHighscoreEnabled (bool $a_enabled)
 HIGHSCORE. More...
 
 getHighscoreEnabled ()
 Gets the setting which determines if the highscore feature is enabled. More...
 
 setHighscoreAchievedTS (bool $a_achieved_ts)
 Sets if the date and time of the scores achievement should be displayed. More...
 
 getHighscoreAchievedTS ()
 Returns if date and time of the scores achievement should be displayed. More...
 
 setHighscorePercentage (bool $a_percentage)
 Sets if the percentages of the scores pass should be shown. More...
 
 getHighscorePercentage ()
 Gets if the percentage column should be shown. More...
 
 setHighscoreWTime (bool $a_wtime)
 Sets if the workingtime of the scores should be shown. More...
 
 getHighscoreWTime ()
 Gets if the column with the workingtime should be shown. More...
 
 setHighscoreOwnTable (bool $a_own_table)
 Sets if the table with the own ranking should be shown. More...
 
 getHighscoreOwnTable ()
 Gets if the own rankings table should be shown. More...
 
 setHighscoreTopTable (bool $a_top_table)
 Sets if the top-rankings table should be shown. More...
 
 getHighscoreTopTable ()
 Gets, if the top-rankings table should be shown. More...
 
 setHighscoreTopNum (int $a_top_num)
 Sets the number of entries which are to be shown in the top-rankings table. More...
 
 getHighscoreTopNum (int $a_retval=10)
 Gets the number of entries which are to be shown in the top-rankings table. More...
 
 getHighscoreMode ()
 
 setHighscoreMode (int $mode)
 
 buildLaunchParameters (ilCmiXapiUser $cmixUser, string $token, string $contextType, string $contextId, string $contextTitle, ?string $returnUrl='')
 
 buildLaunchParametersLTI13 (ilCmiXapiUser $cmixUser, string $endpoint, string $clientId, int $deploymentId, string $nonce, string $contextType, string $contextId, string $contextTitle, ?string $returnUrl='')
 
 isMixedContentType ()
 
- Public Member Functions inherited from ilObject2
 __construct (int $a_id=0, bool $a_reference=true)
 Constructor. More...
 
 read ()
 
 create (bool $a_clone_mode=false)
 
 update ()
 
 delete ()
 
 cloneMetaData (ilObject $target_obj)
 
 cloneObject (int $target_id, int $copy_id=0, bool $omit_tree=false)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static getProviderCustomParamsArray (ilLTIConsumeProvider $provider)
 
static buildContentSelectionParameters (ilLTIConsumeProvider $provider, int $refId, string $returnUrl, string $nonce)
 
static LTISignJWT (array $parms, string $endpoint, string $oAuthConsumerKey, $typeId=0, string $nonce='')
 
static getPrivateKey ()
 
static verifyPrivateKey ()
 
static getPublicKey ()
 
static getJwks ()
 
static getIliasHttpPath ()
 
static getPlattformId ()
 
static getAuthenticationRequestUrl ()
 
static getAccessTokenUrl ()
 
static getPublicKeysetUrl ()
 
static getRegistrationUrl ()
 
static getRegistrationStartUrl ()
 
static getRegistrationEndUrl ()
 
static getOpenidConfigUrl ()
 
static getOpenidConfig ()
 
static registerClient (array $data, object $tokenObj)
 
static getNewClientId ()
 
static sendResponseError (int $code, string $message, $log=true)
 
static sendResponseJson (array $obj)
 
static getInstance (int $a_id=0, bool $a_reference=true)
 
static getRawData ()
 
static getTokenObject (string $token)
 
static verifyToken ()
 
static getLogger ()
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Data Fields

const DB_TABLE_NAME = 'lti_consumer_settings'
 
const LAUNCH_METHOD_OWN_WIN = 'ownWin'
 
const LAUNCH_METHOD_NEW_WIN = 'newWin'
 
const LAUNCH_METHOD_EMBEDDED = 'embedded'
 
const HIGHSCORE_SHOW_ALL_TABLES = 1
 
const HIGHSCORE_SHOW_TOP_TABLE = 2
 
const HIGHSCORE_SHOW_OWN_TABLE = 3
 
const LTI_JWT_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti'
 
const LTI_1_3_KID = 'lti_1_3_kid'
 
const LTI_1_3_PRIVATE_KEY = 'lti_1_3_privatekey'
 
const ERROR_OPEN_SSL_CONF = 'error openssl config invalid'
 
const OPENSSL_KEYTYPE_RSA = ''
 
const REG_TOKEN_OP_NEW_REG = 'reg'
 
const REG_TOKEN_OP_UPDATE_REG = 'reg-update'
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Protected Member Functions

 initType ()
 
 doRead ()
 
 doUpdate ()
 
 loadRepositoryActivationSettings ()
 
 saveRepositoryActivationSettings ()
 
 dbTableName ()
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate (bool $clone_mode=false)
 
 beforeCreate ()
 If overwritten this method should return true, there is currently no "abort" handling for cases where "false" is returned. More...
 
 doUpdate ()
 
 beforeUpdate ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
 beforeCloneObject ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

bool $activationLimited = false
 repository object activation settings (handled by ilObject) More...
 
int $activationStartingTime = null
 
int $activationEndingTime = null
 
bool $activationVisibility = null
 
int $providerId = 0
 
ilLTIConsumeProvider $provider = null
 
bool $use_xapi = false
 
string $custom_activity_id = ''
 
bool $statementsReportEnabled = false
 
float $mastery_score = 0.5
 
string $launchMethod = self::LAUNCH_METHOD_NEW_WIN
 
string $customLaunchKey = ''
 
string $customLaunchSecret = ''
 
string $customParams = ''
 
int $ref_id = 0
 
bool $_highscore_enabled = false
 
int $anonymity = 0
 
bool $_highscore_achieved_ts = true
 
bool $_highscore_percentage = true
 
bool $_highscore_wtime = true
 
bool $_highscore_own_table = true
 
bool $_highscore_top_table = true
 
int $_highscore_top_num = 10
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

Definition at line 34 of file class.ilObjLTIConsumer.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjLTIConsumer::__construct ( int  $a_id = 0,
bool  $a_reference = true 
)

ilObjLTIConsumer constructor.

Definition at line 103 of file class.ilObjLTIConsumer.php.

References ILIAS\GlobalScreen\Provider\__construct().

104  {
105  parent::__construct($a_id, $a_reference);
106  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildContentSelectionParameters()

static ilObjLTIConsumer::buildContentSelectionParameters ( ilLTIConsumeProvider  $provider,
int  $refId,
string  $returnUrl,
string  $nonce 
)
static
Exceptions
ilWACException

Definition at line 910 of file class.ilObjLTIConsumer.php.

References $clientId, $context, $DIC, ILIAS\LTI\ToolProvider\$key, ilLink\_getLink(), CLIENT_ID, ilLTIConsumeProvider\getClientId(), ilLTIConsumeProvider\getId(), ilCmiXapiUser\getIdent(), ilLTIConsumeProvider\getIncludeUserPicture(), ilLTIConsumeProvider\getLaunchMethod(), ilLTIConsumeProvider\getPrivacyIdent(), ilLTIConsumeProvider\getPrivacyName(), ILIAS_VERSION, ilLTIConsumeProvider\PRIVACY_NAME_FIRSTNAME, ilLTIConsumeProvider\PRIVACY_NAME_FULLNAME, ilLTIConsumeProvider\PRIVACY_NAME_LASTNAME, and ROOT_FOLDER_ID.

Referenced by ilObjLTIConsumerGUI\contentSelectionRequest().

910  : ?array
911  {
912  global $DIC;
913 
914  $clientId = $provider->getClientId();
915  $deploymentId = $provider->getId();
916  $ilLTIConsumerLaunch = new ilLTIConsumerLaunch($refId);
917  $context = $ilLTIConsumerLaunch->getContext();
918  $contextType = $ilLTIConsumerLaunch::getLTIContextType($context["type"]);
919  $contextId = $context["id"];
920  $contextTitle = $context["title"];
921 
922  $roles = "Instructor";
923  $usrImage = '';
924  if ($provider->getIncludeUserPicture()) {
925  $usrImage = self::getIliasHttpPath() . "/" . $DIC->user()->getPersonalPicturePath("small");
926  }
927  $documentTarget = "window";
928  if ($provider->getLaunchMethod() == self::LAUNCH_METHOD_EMBEDDED) {
929  $documentTarget = "iframe";
930  }
931  $nameGiven = '-';
932  $nameFamily = '-';
933  $nameFull = '-';
934  switch ($provider->getPrivacyName()) {
936  $nameGiven = $DIC->user()->getFirstname();
937  $nameFull = $DIC->user()->getFirstname();
938  break;
940  $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() . ' ' : '';
941  $usrName .= $DIC->user()->getLastname();
942  $nameFamily = $usrName;
943  $nameFull = $usrName;
944  break;
946  $nameGiven = $DIC->user()->getFirstname();
947  $nameFamily = $DIC->user()->getLastname();
948  $nameFull = $DIC->user()->getFullname();
949  break;
950  }
951 
952  $userIdLTI = ilCmiXapiUser::getIdent($provider->getPrivacyIdent(), $DIC->user()); //was: getIdentAsId
953  $emailPrimary = ilCmiXapiUser::getIdent($provider->getPrivacyIdent(), $DIC->user());
954  $toolConsumerInstanceGuid = CLIENT_ID . ".";
955  $parseIliasUrl = parse_url(self::getIliasHttpPath());
956  if (array_key_exists("path", $parseIliasUrl)) {
957  $toolConsumerInstanceGuid .= implode(".", array_reverse(explode("/", $parseIliasUrl["path"])));
958  }
959  $toolConsumerInstanceGuid .= $parseIliasUrl["host"];
960 
961  $content_select_vars = [
962  "lti_message_type" => "ContentItemSelectionRequest",
963  "lti_version" => "1.3.0",
964  "user_id" => (string) $userIdLTI,
965  "user_image" => $usrImage,
966  "roles" => $roles,
967  "lis_person_name_given" => $nameGiven,
968  "lis_person_name_family" => $nameFamily,
969  "lis_person_name_full" => $nameFull,
970  "lis_person_contact_email_primary" => $emailPrimary,
971  "context_id" => (string) $contextId,
972  "context_type" => $contextType,
973  "context_title" => $contextTitle,
974  "context_label" => $contextType . " " . $contextId,
975  "launch_presentation_locale" => $DIC->language()->getLangKey(),
976  "launch_presentation_document_target" => $documentTarget,
977  "launch_presentation_width" => "",//recommended
978  "launch_presentation_height" => "",//recommended
979  "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
980  "tool_consumer_instance_name" => $DIC->settings()->get("short_inst_name") ? $DIC->settings()->get("short_inst_name") : CLIENT_ID,
981  "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
982  "tool_consumer_instance_url" => ilLink::_getLink(ROOT_FOLDER_ID, "root"),//ToDo? "https://vb52p70.example.com/release_5-3/goto.php?target=root_1&client_id=inno",
983  "tool_consumer_instance_contact_email" => $DIC->settings()->get("admin_email"),
984  "tool_consumer_info_product_family_code" => "ilias",
985  "tool_consumer_info_version" => ILIAS_VERSION,
986  "content_item_return_url" => $returnUrl,
987  "accept_types" => "ltiResourceLink",
988  "accept_presentation_document_targets" => "iframe,window,embed",
989  "accept_multiple" => true,
990  "auto_create" => true,
991  ];
992  $provider_custom_params = self::getProviderCustomParamsArray($provider);
993  foreach ($provider_custom_params as $key => $value) {
994  $content_select_vars['custom_' . $key] = $value;
995  }
996 
997  if (!empty(self::verifyPrivateKey())) {
998  $DIC->ui()->mainTemplate()->setOnScreenMessage('failure', 'ERROR_OPEN_SSL_CONF', true);
999  return null;
1000  }
1001  return self::LTISignJWT($content_select_vars, '', $clientId, $deploymentId, $nonce);
1002  }
$context
Definition: webdav.php:29
const ILIAS_VERSION
const ROOT_FOLDER_ID
Definition: constants.php:32
$clientId
Definition: ltiregend.php:27
$refId
Definition: xapitoken.php:58
static getIdent(int $userIdentMode, ilObjUser $user)
global $DIC
Definition: feed.php:28
const CLIENT_ID
Definition: constants.php:41
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildLaunchParameters()

ilObjLTIConsumer::buildLaunchParameters ( ilCmiXapiUser  $cmixUser,
string  $token,
string  $contextType,
string  $contextId,
string  $contextTitle,
?string  $returnUrl = '' 
)
Exceptions
ilWACException

Definition at line 660 of file class.ilObjLTIConsumer.php.

References $DIC, $token, ilLink\_getLink(), CLIENT_ID, ilLTIConsumerResult\getByKeys(), getCustomParamsArray(), ilObject\getDescription(), ilObject\getId(), ilCmiXapiUser\getIdentAsId(), ilCmiXapiUser\getIliasUuid(), getLaunchKey(), getLaunchMethod(), getLaunchSecret(), getProvider(), ilObject\getRefId(), ilObject\getTitle(), ilCmiXapiUser\getUsrIdent(), ILIAS_VERSION, ILIAS\Repository\lng(), ilObjCmiXapi\PRIVACY_IDENT_IL_UUID_RANDOM, ilLTIConsumeProvider\PRIVACY_NAME_FIRSTNAME, ilLTIConsumeProvider\PRIVACY_NAME_FULLNAME, ilLTIConsumeProvider\PRIVACY_NAME_LASTNAME, ROOT_FOLDER_ID, ilLTIConsumerLaunch\signOAuth(), and SYSTEM_ROLE_ID.

660  : array
661  {
662  global $DIC; /* @var \ILIAS\DI\Container $DIC */
663 
664  $roles = $DIC->access()->checkAccess('write', '', $this->getRefId()) ? "Instructor" : "Learner";
665  //todo if object is in course or group, roles would have to be taken from there s. Mantis 35435 - if necessary Jour Fixe topic
666  if ($DIC->rbac()->review()->isAssigned($DIC->user()->getId(), SYSTEM_ROLE_ID)) {
667  $roles = "Administrator";
668  }
669 
670  if ($this->getProvider()->getAlwaysLearner() == true) {
671  $roles = "Learner";
672  }
673 
674  $resource_link_id = $this->getRefId();
675  if ($this->getProvider()->getUseProviderId() == true) {
676  $resource_link_id = 'p' . $this->getProvider()->getId();
677  }
678 
679  $usrImage = '';
680  if ($this->getProvider()->getIncludeUserPicture()) {
681  $usrImage = self::getIliasHttpPath() . "/" . $DIC->user()->getPersonalPicturePath("small");
682  }
683 
684  $documentTarget = "window";
685  if ($this->getLaunchMethod() == self::LAUNCH_METHOD_EMBEDDED) {
686  $documentTarget = "iframe";
687  }
688 
689  $nameGiven = '-';
690  $nameFamily = '-';
691  $nameFull = '-';
692  switch ($this->getProvider()->getPrivacyName()) {
694  $nameGiven = $DIC->user()->getFirstname();
695  $nameFull = $DIC->user()->getFirstname();
696  break;
698  $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() . ' ' : '';
699  $usrName .= $DIC->user()->getLastname();
700  $nameFamily = $usrName;
701  $nameFull = $usrName;
702  break;
704  $nameGiven = $DIC->user()->getFirstname();
705  $nameFamily = $DIC->user()->getLastname();
706  $nameFull = $DIC->user()->getFullname();
707  break;
708  }
709 
710  $userIdLTI = ilCmiXapiUser::getIdentAsId($this->getProvider()->getPrivacyIdent(), $DIC->user());
711 
712  $emailPrimary = $cmixUser->getUsrIdent();
713  if ($this->getProvider()->getPrivacyIdent() == ilObjCmiXapi::PRIVACY_IDENT_IL_UUID_RANDOM) {
714  $userIdLTI = strstr($emailPrimary, '@' . ilCmiXapiUser::getIliasUuid(), true);
715  }
716 
717  ilLTIConsumerResult::getByKeys($this->getId(), $DIC->user()->getId(), true);
718 
719  //ToDo: Check!
720  $provider_custom_params = self::getProviderCustomParamsArray($this->getProvider());
721  $custom_params = $this->getCustomParamsArray();
722  $merged_params = array_merge($provider_custom_params, $custom_params);
723 
724  $toolConsumerInstanceGuid = CLIENT_ID . ".";
725  $parseIliasUrl = parse_url(self::getIliasHttpPath());
726  if (array_key_exists("path", $parseIliasUrl)) {
727  $toolConsumerInstanceGuid .= implode(".", array_reverse(explode("/", $parseIliasUrl["path"])));
728  }
729  $toolConsumerInstanceGuid .= $parseIliasUrl["host"];
730  $launch_vars = [
731  "lti_message_type" => "basic-lti-launch-request",
732  "lti_version" => "LTI-1p0",
733  "resource_link_id" => $resource_link_id,
734  "resource_link_title" => $this->getTitle(),
735  "resource_link_description" => $this->getDescription(),
736  "user_id" => $userIdLTI,
737  "user_image" => $usrImage,
738  "roles" => $roles,
739  "lis_person_name_given" => $nameGiven,
740  "lis_person_name_family" => $nameFamily,
741  "lis_person_name_full" => $nameFull,
742  "lis_person_contact_email_primary" => $emailPrimary,
743  "context_id" => $contextId,
744  "context_type" => $contextType,
745  "context_title" => $contextTitle,
746  "context_label" => $contextType . " " . $contextId,
747  "launch_presentation_locale" => $this->lng->getLangKey(),
748  "launch_presentation_document_target" => $documentTarget,
749  "launch_presentation_width" => "",//recommended
750  "launch_presentation_height" => "",//recommended
751  "launch_presentation_return_url" => $returnUrl,
752  "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
753  "tool_consumer_instance_name" => $DIC->settings()->get("short_inst_name") ? $DIC->settings()->get("short_inst_name") : CLIENT_ID,
754  "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
755  "tool_consumer_instance_url" => ilLink::_getLink(ROOT_FOLDER_ID, "root"),//ToDo? "https://vb52p70.example.com/release_5-3/goto.php?target=root_1&client_id=inno",
756  "tool_consumer_instance_contact_email" => $DIC->settings()->get("admin_email"),
757  "launch_presentation_css_url" => "",
758  "tool_consumer_info_product_family_code" => "ilias",
759  "tool_consumer_info_version" => ILIAS_VERSION,
760  "lis_result_sourcedid" => $token,
761  "lis_outcome_service_url" => self::getIliasHttpPath() . "/Modules/LTIConsumer/result.php?client_id=" . CLIENT_ID,
762  "role_scope_mentor" => ""
763  ];
764 
765  $OAuthParams = [
766  "url" => $this->getProvider()->getProviderUrl(),
767  "key" => $this->getLaunchKey(),
768  "secret" => $this->getLaunchSecret(),
769  "callback" => "about:blank",
770  "http_method" => "POST",
771  "sign_method" => "HMAC_SHA1",
772  "token" => null,
773  "data" => ($launch_vars + $merged_params)
774  ];
775 
776  return ilLTIConsumerLaunch::signOAuth($OAuthParams);
777  }
static getIdentAsId(int $userIdentMode, ilObjUser $user)
const ILIAS_VERSION
const ROOT_FOLDER_ID
Definition: constants.php:32
const SYSTEM_ROLE_ID
Definition: constants.php:29
const PRIVACY_IDENT_IL_UUID_RANDOM
global $DIC
Definition: feed.php:28
$token
Definition: xapitoken.php:70
const CLIENT_ID
Definition: constants.php:41
static getByKeys(int $a_obj_id, int $a_usr_id, ?bool $a_create=false)
Get a result by object and user key.
static signOAuth(array $a_params)
sign request data with OAuth
+ Here is the call graph for this function:

◆ buildLaunchParametersLTI13()

ilObjLTIConsumer::buildLaunchParametersLTI13 ( ilCmiXapiUser  $cmixUser,
string  $endpoint,
string  $clientId,
int  $deploymentId,
string  $nonce,
string  $contextType,
string  $contextId,
string  $contextTitle,
?string  $returnUrl = '' 
)
Exceptions
ilWACException

Definition at line 783 of file class.ilObjLTIConsumer.php.

References $DIC, ILIAS\LTI\ToolProvider\$key, ilLink\_getLink(), CLIENT_ID, ilLTIConsumerResult\getByKeys(), getCustomParamsArray(), ilObject\getDescription(), ilObject\getId(), ilCmiXapiUser\getIdent(), getLaunchMethod(), getProvider(), ilObject\getRefId(), ilObject\getTitle(), ilCmiXapiUser\getUsrIdent(), ILIAS_VERSION, ILIAS\Repository\lng(), ilLTIConsumeProvider\PRIVACY_NAME_FIRSTNAME, ilLTIConsumeProvider\PRIVACY_NAME_FULLNAME, ilLTIConsumeProvider\PRIVACY_NAME_LASTNAME, ROOT_FOLDER_ID, and SYSTEM_ROLE_ID.

783  : ?array
784  {
785  global $DIC; /* @var \ILIAS\DI\Container $DIC */
786 
787  $roles = $DIC->access()->checkAccess('write', '', $this->getRefId()) ? "Instructor" : "Learner";
788  if ($DIC->rbac()->review()->isAssigned($DIC->user()->getId(), SYSTEM_ROLE_ID)) {
789  $roles = "Administrator";
790  }
791  if ($this->getProvider()->getAlwaysLearner() == true) {
792  $roles = "Learner";
793  }
794 
795  $resource_link_id = $this->getRefId();
796  if ($this->getProvider()->getUseProviderId() == true) {
797  $resource_link_id = 'p' . $this->getProvider()->getId();
798  }
799 
800  $usrImage = '';
801  if ($this->getProvider()->getIncludeUserPicture()) {
802  $usrImage = self::getIliasHttpPath() . "/" . $DIC->user()->getPersonalPicturePath("small");
803  }
804 
805  $documentTarget = "window";
806  if ($this->getLaunchMethod() == self::LAUNCH_METHOD_EMBEDDED) {
807  $documentTarget = "iframe";
808  }
809 
810  $nameGiven = '-';
811  $nameFamily = '-';
812  $nameFull = '-';
813  switch ($this->getProvider()->getPrivacyName()) {
815  $nameGiven = $DIC->user()->getFirstname();
816  $nameFull = $DIC->user()->getFirstname();
817  break;
819  $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() . ' ' : '';
820  $usrName .= $DIC->user()->getLastname();
821  $nameFamily = $usrName;
822  $nameFull = $usrName;
823  break;
825  $nameGiven = $DIC->user()->getFirstname();
826  $nameFamily = $DIC->user()->getLastname();
827  $nameFull = $DIC->user()->getFullname();
828  break;
829  }
830 
831  $userIdLTI = ilCmiXapiUser::getIdent($this->getProvider()->getPrivacyIdent(), $DIC->user()); //was: getIdentAsId
832 
833  $emailPrimary = $cmixUser->getUsrIdent();
834 
835  ilLTIConsumerResult::getByKeys($this->getId(), $DIC->user()->getId(), true);
836 
837  $toolConsumerInstanceGuid = CLIENT_ID . ".";
838  $parseIliasUrl = parse_url(self::getIliasHttpPath());
839  if (array_key_exists("path", $parseIliasUrl)) {
840  $toolConsumerInstanceGuid .= implode(".", array_reverse(explode("/", $parseIliasUrl["path"])));
841  }
842  $toolConsumerInstanceGuid .= $parseIliasUrl["host"];
843  $launch_vars = [
844  "lti_message_type" => "basic-lti-launch-request",
845  "lti_version" => "1.3.0",
846  "resource_link_id" => (string) $resource_link_id,
847  "resource_link_title" => $this->getTitle(),
848  "resource_link_description" => $this->getDescription(),
849  "user_id" => (string) $userIdLTI,
850  "user_image" => $usrImage,
851  "roles" => $roles,
852  "lis_person_name_given" => $nameGiven,
853  "lis_person_name_family" => $nameFamily,
854  "lis_person_name_full" => $nameFull,
855  "lis_person_contact_email_primary" => $emailPrimary,
856  "context_id" => $contextId,
857  "context_type" => $contextType,
858  "context_title" => $contextTitle,
859  "context_label" => $contextType . " " . $contextId,
860  "launch_presentation_locale" => $this->lng->getLangKey(),
861  "launch_presentation_document_target" => $documentTarget,
862  "launch_presentation_width" => "",//recommended
863  "launch_presentation_height" => "",//recommended
864  "launch_presentation_return_url" => $returnUrl,
865  "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
866  "tool_consumer_instance_name" => $DIC->settings()->get("short_inst_name") ? $DIC->settings()->get("short_inst_name") : CLIENT_ID,
867  "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
868  "tool_consumer_instance_url" => ilLink::_getLink(ROOT_FOLDER_ID, "root"),//ToDo? "https://vb52p70.example.com/release_5-3/goto.php?target=root_1&client_id=inno",
869  "tool_consumer_instance_contact_email" => $DIC->settings()->get("admin_email"),
870  "launch_presentation_css_url" => "",
871  "tool_consumer_info_product_family_code" => "ilias",
872  "tool_consumer_info_version" => ILIAS_VERSION,
873  "lis_result_sourcedid" => "",//$token,
874  "lis_outcome_service_url" => self::getIliasHttpPath() . "/Modules/LTIConsumer/result.php?client_id=" . CLIENT_ID,
875  "role_scope_mentor" => ""
876  ];
877 
878  $provider_custom_params = self::getProviderCustomParamsArray($this->getProvider());
879  $custom_params = $this->getCustomParamsArray();
880  $merged_params = array_merge($provider_custom_params, $custom_params);
881  foreach ($merged_params as $key => $value) {
882  $launch_vars['custom_' . $key] = $value;
883  }
884 
885  if ($this->getProvider()->isGradeSynchronization() || $this->getProvider()->getHasOutcome()) {
886  include_once("Modules/LTIConsumer/classes/class.ilLTIConsumerGradeService.php");
887  $gradeservice = new ilLTIConsumerGradeService();
888  $launch_vars['custom_lineitem_url'] = self::getIliasHttpPath() . "/Modules/LTIConsumer/ltiservices.php/gradeservice/" . $contextId . "/lineitems/" . $this->id . "/lineitem";
889 
890  // ! Moodle as tool provider requires a custom_lineitems_url even though this should be optional in launch request, especially if only posting score scope is permitted by platform
891  // http://www.imsglobal.org/spec/lti-ags/v2p0#example-link-has-a-single-line-item-tool-can-only-post-score
892  $launch_vars['custom_lineitems_url'] = self::getIliasHttpPath() . "/Modules/LTIConsumer/ltiservices.php/gradeservice/" . $contextId . "/linetitems/";
893 
894  $launch_vars['custom_ags_scopes'] = implode(",", $gradeservice->getPermittedScopes());
895  }
896 
897  if (!empty(self::verifyPrivateKey())) {
898  $DIC->ui()->mainTemplate()->setOnScreenMessage('failure', 'ERROR_OPEN_SSL_CONF', true);
899  return null;
900  }
901  return self::LTISignJWT($launch_vars, $endpoint, $clientId, $deploymentId, $nonce);
902  }
const ILIAS_VERSION
const ROOT_FOLDER_ID
Definition: constants.php:32
const SYSTEM_ROLE_ID
Definition: constants.php:29
$clientId
Definition: ltiregend.php:27
static getIdent(int $userIdentMode, ilObjUser $user)
global $DIC
Definition: feed.php:28
const CLIENT_ID
Definition: constants.php:41
string $key
Consumer key/client ID value.
Definition: System.php:193
static getByKeys(int $a_obj_id, int $a_usr_id, ?bool $a_create=false)
Get a result by object and user key.
+ Here is the call graph for this function:

◆ dbTableName()

ilObjLTIConsumer::dbTableName ( )
protected

Definition at line 469 of file class.ilObjLTIConsumer.php.

Referenced by save().

469  : string
470  {
471  return self::DB_TABLE_NAME;
472  }
+ Here is the caller graph for this function:

◆ doRead()

ilObjLTIConsumer::doRead ( )
protected

Definition at line 351 of file class.ilObjLTIConsumer.php.

References load().

351  : void
352  {
353  $this->load();
354  }
+ Here is the call graph for this function:

◆ doUpdate()

ilObjLTIConsumer::doUpdate ( )
protected

Definition at line 392 of file class.ilObjLTIConsumer.php.

References save().

392  : void
393  {
394  $this->save();
395  }
+ Here is the call graph for this function:

◆ getAccessTokenUrl()

static ilObjLTIConsumer::getAccessTokenUrl ( )
static

Definition at line 1200 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumeProviderFormGUI\initForm(), and ilLTIConsumeProviderFormGUI\initToolConfigForm().

1200  : string
1201  {
1202  return self::getIliasHttpPath() . "/Modules/LTIConsumer/ltitoken.php";
1203  }
+ Here is the caller graph for this function:

◆ getActivationEndingTime()

ilObjLTIConsumer::getActivationEndingTime ( )

Definition at line 133 of file class.ilObjLTIConsumer.php.

References $activationEndingTime.

Referenced by saveRepositoryActivationSettings().

133  : ?int
134  {
136  }
+ Here is the caller graph for this function:

◆ getActivationStartingTime()

ilObjLTIConsumer::getActivationStartingTime ( )

Definition at line 123 of file class.ilObjLTIConsumer.php.

References $activationStartingTime.

Referenced by saveRepositoryActivationSettings().

123  : ?int
124  {
126  }
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjLTIConsumer::getActivationVisibility ( )

Definition at line 143 of file class.ilObjLTIConsumer.php.

References $activationVisibility.

Referenced by saveRepositoryActivationSettings().

143  : ?bool
144  {
146  }
+ Here is the caller graph for this function:

◆ getActivityId()

ilObjLTIConsumer::getActivityId ( )

Definition at line 286 of file class.ilObjLTIConsumer.php.

References $custom_activity_id, and getProvider().

286  : string
287  {
288  if (strlen($this->getProvider()->getXapiActivityId())) {
289  return $this->getProvider()->getXapiActivityId();
290  }
291 
293  }
+ Here is the call graph for this function:

◆ getAuthenticationRequestUrl()

static ilObjLTIConsumer::getAuthenticationRequestUrl ( )
static

Definition at line 1195 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumeProviderFormGUI\initForm(), and ilLTIConsumeProviderFormGUI\initToolConfigForm().

1195  : string
1196  {
1197  return self::getIliasHttpPath() . "/Modules/LTIConsumer/ltiauth.php";
1198  }
+ Here is the caller graph for this function:

◆ getCustomActivityId()

ilObjLTIConsumer::getCustomActivityId ( )

Definition at line 276 of file class.ilObjLTIConsumer.php.

References $custom_activity_id.

Referenced by save().

276  : string
277  {
279  }
+ Here is the caller graph for this function:

◆ getCustomLaunchKey()

ilObjLTIConsumer::getCustomLaunchKey ( )

Definition at line 218 of file class.ilObjLTIConsumer.php.

References $customLaunchKey.

Referenced by getLaunchKey(), and save().

218  : string
219  {
220  return $this->customLaunchKey;
221  }
+ Here is the caller graph for this function:

◆ getCustomLaunchSecret()

ilObjLTIConsumer::getCustomLaunchSecret ( )

Definition at line 228 of file class.ilObjLTIConsumer.php.

References $customLaunchSecret.

Referenced by getLaunchSecret(), and save().

228  : string
229  {
231  }
+ Here is the caller graph for this function:

◆ getCustomParams()

ilObjLTIConsumer::getCustomParams ( )

Definition at line 238 of file class.ilObjLTIConsumer.php.

References $customParams.

Referenced by getCustomParamsArray(), and save().

238  : string
239  {
240  return $this->customParams;
241  }
+ Here is the caller graph for this function:

◆ getCustomParamsArray()

ilObjLTIConsumer::getCustomParamsArray ( )
Returns
string[]

Definition at line 308 of file class.ilObjLTIConsumer.php.

References $param, $params, and getCustomParams().

Referenced by buildLaunchParameters(), and buildLaunchParametersLTI13().

308  : array
309  {
310  $paramsAsArray = [];
311 
312  $params = $this->getCustomParams();
313  // allows foo=bar;foo2=baz2; foo3=baz3
314  $params = preg_split('/; ?/', $params);
315 
316  foreach ($params as $param) {
317  $param = explode('=', $param);
318  // empty field, duplicate/leading/trailing semicolon?
319  if ($param[0] != '') {
320  $value = isset($param[1]) ? $param[1] : '';
321  $paramsAsArray[$param[0]] = $value;
322  }
323  }
324 
325  return $paramsAsArray;
326  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$param
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHighscoreAchievedTS()

ilObjLTIConsumer::getHighscoreAchievedTS ( )

Returns if date and time of the scores achievement should be displayed.

Returns
bool True, if column should be shown.

Definition at line 510 of file class.ilObjLTIConsumer.php.

References $_highscore_achieved_ts.

Referenced by save().

510  : bool
511  {
513  }
+ Here is the caller graph for this function:

◆ getHighscoreEnabled()

ilObjLTIConsumer::getHighscoreEnabled ( )

Gets the setting which determines if the highscore feature is enabled.

Returns
bool True, if highscore is enabled.

Definition at line 491 of file class.ilObjLTIConsumer.php.

References $_highscore_enabled.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and save().

491  : bool
492  {
494  }
+ Here is the caller graph for this function:

◆ getHighscoreMode()

ilObjLTIConsumer::getHighscoreMode ( )

Definition at line 618 of file class.ilObjLTIConsumer.php.

References getHighscoreOwnTable(), and getHighscoreTopTable().

618  : int
619  {
620  switch (true) {
621  case $this->getHighscoreOwnTable() && $this->getHighscoreTopTable():
623 
624  case $this->getHighscoreTopTable():
626 
627  case $this->getHighscoreOwnTable():
628  default:
630  }
631  }
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
+ Here is the call graph for this function:

◆ getHighscoreOwnTable()

ilObjLTIConsumer::getHighscoreOwnTable ( )

Gets if the own rankings table should be shown.

Returns
bool True, if the own rankings table should be shown.

Definition at line 566 of file class.ilObjLTIConsumer.php.

References $_highscore_own_table.

Referenced by getHighscoreMode(), and save().

566  : bool
567  {
569  }
+ Here is the caller graph for this function:

◆ getHighscorePercentage()

ilObjLTIConsumer::getHighscorePercentage ( )

Gets if the percentage column should be shown.

Returns
bool True, if percentage column should be shown.

Definition at line 528 of file class.ilObjLTIConsumer.php.

References $_highscore_percentage.

Referenced by save().

528  : bool
529  {
531  }
+ Here is the caller graph for this function:

◆ getHighscoreTopNum()

ilObjLTIConsumer::getHighscoreTopNum ( int  $a_retval = 10)

Gets the number of entries which are to be shown in the top-rankings table.

Default: 10 entries

Parameters
integer$a_retvalOptional return value if nothing is set, defaults to 10.
Returns
integer Number of entries to be shown in the top-rankings table.

Definition at line 608 of file class.ilObjLTIConsumer.php.

References $_highscore_top_num.

Referenced by save().

608  : int
609  {
610  $retval = $a_retval;
611  if ($this->_highscore_top_num != 0) {
612  $retval = $this->_highscore_top_num;
613  }
614 
615  return $retval;
616  }
+ Here is the caller graph for this function:

◆ getHighscoreTopTable()

ilObjLTIConsumer::getHighscoreTopTable ( )

Gets, if the top-rankings table should be shown.

Returns
bool True, if top-rankings table should be shown.

Definition at line 584 of file class.ilObjLTIConsumer.php.

References $_highscore_top_table.

Referenced by getHighscoreMode(), and save().

584  : bool
585  {
587  }
+ Here is the caller graph for this function:

◆ getHighscoreWTime()

ilObjLTIConsumer::getHighscoreWTime ( )

Gets if the column with the workingtime should be shown.

Returns
bool True, if the workingtime column should be shown.

Definition at line 546 of file class.ilObjLTIConsumer.php.

References $_highscore_wtime.

Referenced by save().

546  : bool
547  {
549  }
+ Here is the caller graph for this function:

◆ getIliasHttpPath()

static ilObjLTIConsumer::getIliasHttpPath ( )
static

Definition at line 1158 of file class.ilObjLTIConsumer.php.

References $_SERVER, $DIC, Vendor\Package\$f, $iliasHttpPath, $path, and ilContext\modifyHttpPath().

Referenced by ilObjLTIConsumerGUI\contentSelectionRequest(), ilLTIConsumerContentGUI\getEmbeddedAutoStartFormular(), ilLTIConsumerContentGUI\getLaunchParametersLTI13(), ilLTIConsumerContentGUI\getStartButtonTxt11(), ilLTIConsumerContentGUI\getStartButtonTxt13(), and ilObjLTIConsumerGUI\saveContentSelection().

1158  : string
1159  {
1160  global $DIC;
1161 
1162  if ($DIC['https']->isDetected()) {
1163  $protocol = 'https://';
1164  } else {
1165  $protocol = 'http://';
1166  }
1167  $host = $_SERVER['HTTP_HOST'];
1168 
1169  $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
1170 
1171  // security fix: this failed, if the URI contained "?" and following "/"
1172  // -> we remove everything after "?"
1173  if (is_int($pos = strpos($rq_uri, "?"))) {
1174  $rq_uri = substr($rq_uri, 0, $pos);
1175  }
1176 
1177  $path = pathinfo($rq_uri);
1178  if (isset($path['extension']) && $path['extension'] !== '') {
1179  $uri = dirname($rq_uri);
1180  } else {
1181  $uri = $rq_uri;
1182  }
1183  $uri = str_replace("Modules/LTIConsumer", "", $uri);
1184  $iliasHttpPath = ilContext::modifyHttpPath(implode('', [$protocol, $host, $uri]));
1185  $f = new \ILIAS\Data\Factory();
1186  $uri = $f->uri(rtrim($iliasHttpPath, "/"));
1187  return $uri->getBaseURI();
1188  }
static modifyHttpPath(string $httpPath)
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
$iliasHttpPath
Definition: imgupload.php:50
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstance()

static ilObjLTIConsumer::getInstance ( int  $a_id = 0,
bool  $a_reference = true 
)
static

Definition at line 1342 of file class.ilObjLTIConsumer.php.

Referenced by ilCmiXapiStatementsReport\__construct(), ilCmiXapiAbstractReportLinkBuilder\getObj(), and ilCmiXapiHighscoreReport\initTableData().

1343  {
1344  return new self($a_id, $a_reference);
1345  }
+ Here is the caller graph for this function:

◆ getJwks()

static ilObjLTIConsumer::getJwks ( )
static

Definition at line 1138 of file class.ilObjLTIConsumer.php.

References ILIAS\LTI\ToolProvider\$details, and $res.

1138  : array
1139  {
1140  $jwks = ['keys' => []];
1141 
1142  $privatekey = self::getPrivateKey();
1143  $res = openssl_pkey_get_private($privatekey['key']);
1144  $details = openssl_pkey_get_details($res);
1145 
1146  $jwk = [];
1147  $jwk['kty'] = 'RSA';
1148  $jwk['alg'] = 'RS256';
1149  $jwk['kid'] = $privatekey['kid'];
1150  $jwk['e'] = rtrim(strtr(base64_encode($details['rsa']['e']), '+/', '-_'), '=');
1151  $jwk['n'] = rtrim(strtr(base64_encode($details['rsa']['n']), '+/', '-_'), '=');
1152  $jwk['use'] = 'sig';
1153 
1154  $jwks['keys'][] = $jwk;
1155  return $jwks;
1156  }
$res
Definition: ltiservices.php:69
array $details
Details for error message relating to last request processed.
Definition: System.php:109

◆ getLaunchKey()

ilObjLTIConsumer::getLaunchKey ( )

Definition at line 248 of file class.ilObjLTIConsumer.php.

References getCustomLaunchKey(), and getProvider().

Referenced by buildLaunchParameters().

248  : string
249  {
250  if ($this->getProvider()->isProviderKeyCustomizable()) {
251  return $this->getCustomLaunchKey();
252  }
253 
254  return $this->getProvider()->getProviderKey();
255  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLaunchMethod()

ilObjLTIConsumer::getLaunchMethod ( )

Definition at line 208 of file class.ilObjLTIConsumer.php.

References $launchMethod.

Referenced by buildLaunchParameters(), buildLaunchParametersLTI13(), and save().

208  : string
209  {
210  return $this->launchMethod;
211  }
+ Here is the caller graph for this function:

◆ getLaunchSecret()

ilObjLTIConsumer::getLaunchSecret ( )

Definition at line 257 of file class.ilObjLTIConsumer.php.

References getCustomLaunchSecret(), and getProvider().

Referenced by buildLaunchParameters().

257  : string
258  {
259  if ($this->getProvider()->isProviderKeyCustomizable()) {
260  return $this->getCustomLaunchSecret();
261  }
262 
263  return $this->getProvider()->getProviderSecret();
264  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogger()

static ilObjLTIConsumer::getLogger ( )
static

Definition at line 1386 of file class.ilObjLTIConsumer.php.

References ilLoggerFactory\getLogger().

Referenced by ilLTIConsumerGradeServiceScores\checkScore(), ilLTIConsumerGradeServiceScores\execute(), invalidRequest(), ilLTIConsumerServiceResponse\send(), sendAccessToken(), serverError(), ilLTIConsumerContentGUI\validateLTI13InitalLogin(), and validateServiceToken().

1386  : ilLogger
1387  {
1388  return ilLoggerFactory::getLogger('lti');
1389  }
static getLogger(string $a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMasteryScore()

ilObjLTIConsumer::getMasteryScore ( )

Definition at line 153 of file class.ilObjLTIConsumer.php.

References $mastery_score.

Referenced by save().

153  : float
154  {
155  return $this->mastery_score;
156  }
+ Here is the caller graph for this function:

◆ getMasteryScorePercent()

ilObjLTIConsumer::getMasteryScorePercent ( )

Definition at line 163 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerPlaceholderValues\getMasteryScore().

163  : float
164  {
165  return $this->mastery_score * 100;
166  }
+ Here is the caller graph for this function:

◆ getNewClientId()

static ilObjLTIConsumer::getNewClientId ( )
static

Definition at line 1304 of file class.ilObjLTIConsumer.php.

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

Referenced by ilLTIConsumeProvider\getClientId().

1304  : string
1305  {
1307  }
static getRandomString(int $length=8)
Generate a random string.
Definition: Util.php:558
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOpenidConfig()

static ilObjLTIConsumer::getOpenidConfig ( )
static

Definition at line 1230 of file class.ilObjLTIConsumer.php.

References ILIAS_VERSION.

1230  : array
1231  {
1232  $scopesSupported = array('openid');
1233  $gradeservice = new ilLTIConsumerGradeService();
1234  $scopesSupported = array_merge($scopesSupported, $gradeservice->getPermittedScopes());
1235  return [
1236  "issuer" => self::getPlattformId(),
1237  "authorization_endpoint" => self::getAuthenticationRequestUrl(),
1238  "token_endpoint" => self::getAccessTokenUrl(),
1239  "token_endpoint_auth_methods_supported" => ["private_key_jwt"],
1240  "token_endpoint_auth_signing_alg_values_supported" => ["RS256"],
1241  "jwks_uri" => self::getPublicKeysetUrl(),
1242  "registration_endpoint" => self::getRegistrationUrl(),
1243  "scopes_supported" => $scopesSupported,
1244  "response_types_supported" => ["id_token"],
1245  "subject_types_supported" => ["public", "pairwise"],
1246  "id_token_signing_alg_values_supported" => ["RS256"],
1247  "claims_supported" => ["iss", "aud"],
1248  "https://purl.imsglobal.org/spec/lti-platform-configuration" => [
1249  "product_family_code" => "ilias.de",
1250  "version" => ILIAS_VERSION,
1251  "messages_supported" => [
1252  [
1253  "type" => "LtiResourceLinkRequest",
1254  "placements" => [
1255  ]
1256  ],
1257  [
1258  "type" => "LtiDeepLinkingRequest",
1259  "placements" => [
1260  ]
1261  ]
1262  ]
1263  ]
1264  ];
1265  }
const ILIAS_VERSION

◆ getOpenidConfigUrl()

static ilObjLTIConsumer::getOpenidConfigUrl ( )
static

Definition at line 1225 of file class.ilObjLTIConsumer.php.

1225  : string
1226  {
1227  return self::getIliasHttpPath() . "/Modules/LTIConsumer/lticonfig.php";
1228  }

◆ getPlattformId()

static ilObjLTIConsumer::getPlattformId ( )
static

Definition at line 1190 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumeProviderFormGUI\initForm(), and ilLTIConsumeProviderFormGUI\initToolConfigForm().

1190  : string
1191  {
1192  return self::getIliasHttpPath();
1193  }
+ Here is the caller graph for this function:

◆ getPrivateKey()

static ilObjLTIConsumer::getPrivateKey ( )
static

Definition at line 1087 of file class.ilObjLTIConsumer.php.

References $ilSetting, and ILIAS\LTI\ToolProvider\$kid.

Referenced by sendAccessToken().

1087  : array
1088  {
1089  global $ilSetting;
1090  $err = self::verifyPrivateKey();
1091  if (!empty($err)) {
1092  return [];
1093  }
1094  $privatekey = $ilSetting->get(self::LTI_1_3_PRIVATE_KEY);
1095  $kid = $ilSetting->get(self::LTI_1_3_KID);
1096  return [
1097  "key" => $privatekey,
1098  "kid" => $kid
1099  ];
1100  }
string $kid
Key ID.
Definition: System.php:88
global $ilSetting
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getProvider()

ilObjLTIConsumer::getProvider ( )

Definition at line 188 of file class.ilObjLTIConsumer.php.

References $provider.

Referenced by buildLaunchParameters(), buildLaunchParametersLTI13(), getActivityId(), getLaunchKey(), getLaunchSecret(), and ilLTIConsumerSettingsFormGUI\initObject().

189  {
190  return $this->provider;
191  }
ilLTIConsumeProvider $provider
+ Here is the caller graph for this function:

◆ getProviderCustomParamsArray()

static ilObjLTIConsumer::getProviderCustomParamsArray ( ilLTIConsumeProvider  $provider)
static
Returns
string[]

Definition at line 331 of file class.ilObjLTIConsumer.php.

References $param, $params, and ilLTIConsumeProvider\getCustomParams().

331  : array
332  {
333  $paramsAsArray = [];
334 
335  $params = $provider->getCustomParams();
336  // allows foo=bar;foo2=baz2; foo3=baz3
337  $params = preg_split('/; ?/', $params);
338 
339  foreach ($params as $param) {
340  $param = explode('=', $param);
341  // empty field, duplicate/leading/trailing semicolon?
342  if ($param[0] != '') {
343  $value = isset($param[1]) ? $param[1] : '';
344  $paramsAsArray[$param[0]] = $value;
345  }
346  }
347 
348  return $paramsAsArray;
349  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$param
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getProviderId()

ilObjLTIConsumer::getProviderId ( )

Definition at line 173 of file class.ilObjLTIConsumer.php.

References $providerId.

Referenced by initProvider(), and save().

173  : int
174  {
175  return $this->providerId;
176  }
+ Here is the caller graph for this function:

◆ getPublicKey()

static ilObjLTIConsumer::getPublicKey ( )
static

Definition at line 1126 of file class.ilObjLTIConsumer.php.

References ILIAS\LTI\ToolProvider\$details, $privateKey, and $res.

1126  : string
1127  {
1128  $publicKey = null;
1129  $privateKey = self::getPrivateKey();
1130  $res = openssl_pkey_get_private($privateKey['key']);
1131  if ($res !== false) {
1132  $details = openssl_pkey_get_details($res);
1133  $publicKey = $details['key'];
1134  }
1135  return $publicKey;
1136  }
$res
Definition: ltiservices.php:69
array $details
Details for error message relating to last request processed.
Definition: System.php:109
$privateKey
Definition: ltiregstart.php:68

◆ getPublicKeysetUrl()

static ilObjLTIConsumer::getPublicKeysetUrl ( )
static

Definition at line 1205 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumeProviderFormGUI\initForm(), and ilLTIConsumeProviderFormGUI\initToolConfigForm().

1205  : string
1206  {
1207  return self::getIliasHttpPath() . "/Modules/LTIConsumer/lticerts.php";
1208  }
+ Here is the caller graph for this function:

◆ getRawData()

static ilObjLTIConsumer::getRawData ( )
static

Definition at line 1352 of file class.ilObjLTIConsumer.php.

1352  : ?string
1353  {
1354  return file_get_contents('php://input');
1355  }

◆ getRegistrationEndUrl()

static ilObjLTIConsumer::getRegistrationEndUrl ( )
static

Definition at line 1220 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumeProviderFormGUI\getDynRegRequest().

1220  : string
1221  {
1222  return self::getIliasHttpPath() . "/Modules/LTIConsumer/ltiregend.php";
1223  }
+ Here is the caller graph for this function:

◆ getRegistrationStartUrl()

static ilObjLTIConsumer::getRegistrationStartUrl ( )
static

Definition at line 1215 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumeProviderFormGUI\getDynRegRequest().

1215  : string
1216  {
1217  return self::getIliasHttpPath() . "/Modules/LTIConsumer/ltiregstart.php";
1218  }
+ Here is the caller graph for this function:

◆ getRegistrationUrl()

static ilObjLTIConsumer::getRegistrationUrl ( )
static

Definition at line 1210 of file class.ilObjLTIConsumer.php.

1210  : string
1211  {
1212  return self::getIliasHttpPath() . "/Modules/LTIConsumer/ltiregistration.php";
1213  }

◆ getTokenObject()

static ilObjLTIConsumer::getTokenObject ( string  $token)
static

Definition at line 1357 of file class.ilObjLTIConsumer.php.

References Vendor\Package\$e, and $keys.

1357  : ?object
1358  {
1359  try {
1360  $keys = JWK::parseKeySet(self::getJwks());
1361  return JWT::decode($token, $keys);
1362  } catch (Exception $e) {
1363  return null;
1364  }
1365  }
$keys
Definition: metadata.php:204
$token
Definition: xapitoken.php:70

◆ getUseXapi()

ilObjLTIConsumer::getUseXapi ( )

Definition at line 266 of file class.ilObjLTIConsumer.php.

References $use_xapi.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and save().

266  : bool
267  {
268  return $this->use_xapi;
269  }
+ Here is the caller graph for this function:

◆ initProvider()

ilObjLTIConsumer::initProvider ( )

Definition at line 183 of file class.ilObjLTIConsumer.php.

References getProviderId().

183  : void
184  {
185  $this->provider = new ilLTIConsumeProvider($this->getProviderId());
186  }
+ Here is the call graph for this function:

◆ initType()

ilObjLTIConsumer::initType ( )
protected

Definition at line 108 of file class.ilObjLTIConsumer.php.

108  : void
109  {
110  $this->type = "lti";
111  }

◆ isActivationLimited()

ilObjLTIConsumer::isActivationLimited ( )

Definition at line 113 of file class.ilObjLTIConsumer.php.

References $activationLimited.

Referenced by saveRepositoryActivationSettings().

113  : bool
114  {
116  }
bool $activationLimited
repository object activation settings (handled by ilObject)
+ Here is the caller graph for this function:

◆ isLaunchMethodEmbedded()

ilObjLTIConsumer::isLaunchMethodEmbedded ( )

Definition at line 203 of file class.ilObjLTIConsumer.php.

203  : bool
204  {
205  return $this->launchMethod == self::LAUNCH_METHOD_EMBEDDED;
206  }

◆ isLaunchMethodOwnWin()

ilObjLTIConsumer::isLaunchMethodOwnWin ( )

Definition at line 198 of file class.ilObjLTIConsumer.php.

198  : bool
199  {
200  return $this->launchMethod == self::LAUNCH_METHOD_OWN_WIN;
201  }

◆ isMixedContentType()

ilObjLTIConsumer::isMixedContentType ( )

Definition at line 1347 of file class.ilObjLTIConsumer.php.

1347  : bool
1348  {
1349  return true;
1350  }

◆ isStatementsReportEnabled()

ilObjLTIConsumer::isStatementsReportEnabled ( )

Definition at line 295 of file class.ilObjLTIConsumer.php.

References $statementsReportEnabled.

Referenced by save().

295  : bool
296  {
298  }
+ Here is the caller graph for this function:

◆ load()

ilObjLTIConsumer::load ( )

Definition at line 356 of file class.ilObjLTIConsumer.php.

References $DIC, $query, $res, ilObject\getId(), loadRepositoryActivationSettings(), setCustomActivityId(), setCustomLaunchKey(), setCustomLaunchSecret(), setCustomParams(), setHighscoreAchievedTS(), setHighscoreEnabled(), setHighscoreOwnTable(), setHighscorePercentage(), setHighscoreTopNum(), setHighscoreTopTable(), setHighscoreWTime(), setLaunchMethod(), setMasteryScore(), setProvider(), setProviderId(), setStatementsReportEnabled(), and setUseXapi().

Referenced by doRead().

356  : void
357  {
358  global $DIC; /* @var \ILIAS\DI\Container $DIC */
359 
360  $query = "SELECT * FROM {$this->dbTableName()} WHERE obj_id = %s";
361  $res = $DIC->database()->queryF($query, ['integer'], [$this->getId()]);
362 
363  while ($row = $DIC->database()->fetchAssoc($res)) {
364  // if ($row['provider_id']) { //always set
365  $this->setProviderId((int) $row['provider_id']);
366  $this->setProvider(new ilLTIConsumeProvider((int) $row['provider_id']));
367  // }
368 
369  $this->setLaunchMethod($row['launch_method']);
370 
371  $this->setCustomLaunchKey((string) $row['launch_key']);
372  $this->setCustomLaunchSecret((string) $row['launch_secret']);
373  $this->setCustomParams((string) $row['custom_params']);
374 
375  $this->setUseXapi((bool) $row['use_xapi']);
376  $this->setCustomActivityId((string) $row['activity_id']);
377  $this->setStatementsReportEnabled((bool) $row['show_statements']);
378  $this->setHighscoreEnabled((bool) $row['highscore_enabled']);
379  $this->setHighscoreAchievedTS((bool) $row['highscore_achieved_ts']);
380  $this->setHighscorePercentage((bool) $row['highscore_percentage']);
381  $this->setHighscoreWTime((bool) $row['highscore_wtime']);
382  $this->setHighscoreOwnTable((bool) $row['highscore_own_table']);
383  $this->setHighscoreTopTable((bool) $row['highscore_top_table']);
384  $this->setHighscoreTopNum((int) $row['highscore_top_num']);
385 
386  $this->setMasteryScore((float) $row['mastery_score']);
387  }
388 
390  }
setUseXapi(bool $use_xapi)
$res
Definition: ltiservices.php:69
setCustomActivityId(string $custom_activity_id)
setCustomParams(string $customParams)
setHighscoreEnabled(bool $a_enabled)
HIGHSCORE.
setStatementsReportEnabled(bool $statementsReportEnabled)
setHighscoreWTime(bool $a_wtime)
Sets if the workingtime of the scores should be shown.
setHighscoreAchievedTS(bool $a_achieved_ts)
Sets if the date and time of the scores achievement should be displayed.
setHighscoreTopTable(bool $a_top_table)
Sets if the top-rankings table should be shown.
setCustomLaunchSecret(string $customLaunchSecret)
global $DIC
Definition: feed.php:28
setLaunchMethod(string $launchMethod)
setHighscoreOwnTable(bool $a_own_table)
Sets if the table with the own ranking should be shown.
$query
setHighscorePercentage(bool $a_percentage)
Sets if the percentages of the scores pass should be shown.
setCustomLaunchKey(string $customLaunchKey)
setHighscoreTopNum(int $a_top_num)
Sets the number of entries which are to be shown in the top-rankings table.
setMasteryScore(float $mastery_score)
setProviderId(int $providerId)
setProvider(ilLTIConsumeProvider $provider)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRepositoryActivationSettings()

ilObjLTIConsumer::loadRepositoryActivationSettings ( )
protected

Definition at line 425 of file class.ilObjLTIConsumer.php.

References ilObjectActivation\getItem(), ILIAS\Repository\int(), setActivationEndingTime(), setActivationLimited(), setActivationStartingTime(), setActivationVisibility(), and ilObjectActivation\TIMINGS_ACTIVATION.

Referenced by load().

425  : void
426  {
427  if ($this->ref_id > 0) {
428  $activation = ilObjectActivation::getItem($this->ref_id);
429  switch ($activation["timing_type"]) {
431  $this->setActivationLimited(true);
432  if (!is_null($activation["timing_start"])) {
433  $activation["timing_start"] = (int) $activation["timing_start"];
434  }
435  $this->setActivationStartingTime($activation["timing_start"]);
436  if (!is_null($activation["timing_end"])) {
437  $activation["timing_end"] = (int) $activation["timing_end"];
438  }
439  $this->setActivationEndingTime($activation["timing_end"]);
440  $this->setActivationVisibility((bool) $activation["visible"]);
441  break;
442 
443  default:
444  $this->setActivationLimited(false);
445  break;
446  }
447  }
448  }
setActivationEndingTime(?int $activationEndingTime=null)
setActivationLimited(bool $activationLimited)
setActivationVisibility(bool $activationVisibility)
static getItem(int $ref_id)
setActivationStartingTime(?int $activationStartingTime=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LTISignJWT()

static ilObjLTIConsumer::LTISignJWT ( array  $parms,
string  $endpoint,
string  $oAuthConsumerKey,
  $typeId = 0,
string  $nonce = '' 
)
static

Definition at line 1004 of file class.ilObjLTIConsumer.php.

References ILIAS\LTI\ToolProvider\$jwt, ILIAS\LTI\ToolProvider\$key, $privateKey, $typeId, Firebase\JWT\JWT\encode(), ILIAS\LTI\ToolProvider\Util\JWT_CLAIM_MAPPING, and ILIAS\LTI\ToolProvider\Util\MESSAGE_TYPE_MAPPING.

1004  : array
1005  {
1006  if (empty($typeId)) {
1007  $typeId = 0;
1008  }
1010  if (isset($parms['lti_message_type']) && array_key_exists($parms['lti_message_type'], $messageTypeMapping)) {
1011  $parms['lti_message_type'] = $messageTypeMapping[$parms['lti_message_type']];
1012  }
1013  if (isset($parms['roles'])) {
1014  $roles = explode(',', $parms['roles']);
1015  $newRoles = array();
1016  foreach ($roles as $role) {
1017  if (strpos($role, 'urn:lti:role:ims/lis/') === 0) {
1018  $role = 'http://purl.imsglobal.org/vocab/lis/v2/membership#' . substr($role, 21);
1019  } elseif (strpos($role, 'urn:lti:instrole:ims/lis/') === 0) {
1020  $role = 'http://purl.imsglobal.org/vocab/lis/v2/institution/person#' . substr($role, 25);
1021  } elseif (strpos($role, 'urn:lti:sysrole:ims/lis/') === 0) {
1022  $role = 'http://purl.imsglobal.org/vocab/lis/v2/system/person#' . substr($role, 24);
1023  } elseif ((strpos($role, '://') === false) && (strpos($role, 'urn:') !== 0)) {
1024  $role = "http://purl.imsglobal.org/vocab/lis/v2/membership#{$role}";
1025  }
1026  $newRoles[] = $role;
1027  }
1028  $parms['roles'] = implode(',', $newRoles);
1029  }
1030  $now = time();
1031  if (empty($nonce)) {
1032  $nonce = bin2hex(openssl_random_pseudo_bytes(10));
1033  }
1035  $payLoad = array(
1036  'nonce' => $nonce,
1037  'iat' => $now,
1038  'exp' => $now + 60,
1039  );
1040  $payLoad['iss'] = self::getIliasHttpPath();
1041  $payLoad['aud'] = $oAuthConsumerKey;
1042  $payLoad[self::LTI_JWT_CLAIM_PREFIX . '/claim/deployment_id'] = strval($typeId);
1043  if (!empty($endpoint)) { // only for launch request
1044  $payLoad[self::LTI_JWT_CLAIM_PREFIX . '/claim/target_link_uri'] = $endpoint;
1045  }
1046 
1047  foreach ($parms as $key => $value) {
1048  $claim = self::LTI_JWT_CLAIM_PREFIX;
1049  if (array_key_exists($key, $claimMapping)) {
1050  $mapping = $claimMapping[$key];
1051 
1052  if (isset($mapping['isArray']) && $mapping['isArray']) {
1053  $value = explode(',', $value);
1054  sort($value);
1055  } elseif (isset($mapping['isBoolean'])) {
1056  $value = $mapping['isBoolean'];
1057  }
1058  if (!empty($mapping['suffix'])) {
1059  $claim .= "-{$mapping['suffix']}";
1060  }
1061  $claim .= '/claim/';
1062  if (is_null($mapping['group'])) {
1063  $payLoad[$mapping['claim']] = $value;
1064  } elseif (empty($mapping['group'])) {
1065  $payLoad["{$claim}{$mapping['claim']}"] = $value;
1066  } else {
1067  $claim .= $mapping['group'];
1068  $payLoad[$claim][$mapping['claim']] = $value;
1069  }
1070  } elseif (strpos($key, 'custom_') === 0) {
1071  $payLoad["{$claim}/claim/custom"][substr($key, 7)] = $value;
1072  } elseif (strpos($key, 'ext_') === 0) {
1073  $payLoad["{$claim}/claim/ext"][substr($key, 4)] = $value;
1074  }
1075  }
1076  //self::getLogger()->debug(json_encode($payLoad,JSON_PRETTY_PRINT));
1077  if (!empty(self::verifyPrivateKey())) {
1078  throw new DomainException(self::ERROR_OPEN_SSL_CONF);
1079  }
1080  $privateKey = self::getPrivateKey();
1081  $jwt = Firebase\JWT\JWT::encode($payLoad, $privateKey['key'], 'RS256', $privateKey['kid']);
1082  $newParms = $parms;//was array();
1083  $newParms['id_token'] = $jwt;
1084  return $newParms;
1085  }
ClientInterface $jwt
JWT object, if any.
Definition: System.php:165
const MESSAGE_TYPE_MAPPING
Mapping for standard message types.
Definition: Util.php:48
string $key
Consumer key/client ID value.
Definition: System.php:193
$privateKey
Definition: ltiregstart.php:68
static encode(array $payload, $key, string $alg, string $keyId=null, array $head=null)
Converts and signs a PHP array into a JWT string.
Definition: JWT.php:199
const JWT_CLAIM_MAPPING
Mapping for standard message parameters to JWT claim.
Definition: Util.php:58
$typeId
Definition: ltiregstart.php:36
+ Here is the call graph for this function:

◆ registerClient()

static ilObjLTIConsumer::registerClient ( array  $data,
object  $tokenObj 
)
static

Definition at line 1267 of file class.ilObjLTIConsumer.php.

References $data, $DIC, $message, ilObjectGUI\ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION, ilLTIConsumeProvider\AVAILABILITY_CREATE, ilLTIConsumeProvider\getId(), ilLTIConsumeProvider\insert(), ilLTIConsumeProvider\setAvailability(), ilLTIConsumeProvider\setClientId(), ilLTIConsumeProvider\setContentItemUrl(), ilLTIConsumeProvider\setCreator(), ilLTIConsumeProvider\setInitiateLogin(), ilLTIConsumeProvider\setIsGlobal(), ilLTIConsumeProvider\setKeyType(), ilLTIConsumeProvider\setLtiVersion(), ilLTIConsumeProvider\setProviderUrl(), ilLTIConsumeProvider\setPublicKeyset(), ilLTIConsumeProvider\setRedirectionUris(), and ilLTIConsumeProvider\setTitle().

1267  : array
1268  {
1269  // first analyse tool_config and filter only accepted params
1270  // append client_id (required) and deployment_id(=provider_id in ILIAS) (optional) to tool_config response
1271  global $DIC;
1272  $reponseData = $data;
1274  $toolConfig = $data['https://purl.imsglobal.org/spec/lti-tool-configuration'];
1276  $provider->setProviderUrl($toolConfig['target_link_uri']);
1277  $provider->setInitiateLogin($data['initiate_login_uri']);
1278  $provider->setRedirectionUris(implode(",", $data['redirect_uris']));
1279  if (isset($data['jwks_uri'])) {
1280  $provider->setPublicKeyset($data['jwks_uri']);
1281  }
1282  foreach ($toolConfig['messages'] as $message) {
1283  if (isset($message['type']) && $message['type'] === 'LtiDeepLinkingRequest') {
1284  $provider->setContentItemUrl($message['target_link_uri']);
1285  }
1286  }
1287  /*
1288  if (isset($data['logo_uri'])) { // needs to be uploaded and then assign filepath
1289  $provider->setProviderIconFilename($data['logo_uri']);
1290  }
1291  */
1292  $provider->setKeyType('JWK_KEYSET');
1293  $provider->setLtiVersion('1.3.0');
1294  $provider->setClientId((string) $tokenObj->aud); //client_id
1295  $provider->setCreator((int) $tokenObj->sub); // user_id
1297  $provider->setIsGlobal(false);
1298  $provider->insert();
1299  $reponseData['client_id'] = $tokenObj->aud;
1300  $reponseData['https://purl.imsglobal.org/spec/lti-tool-configuration']['deployment_id'] = $provider->getId();
1301  return $reponseData;
1302  }
setInitiateLogin(string $initiate_login)
setPublicKeyset(string $public_keyset)
setContentItemUrl(string $content_item_url)
global $DIC
Definition: feed.php:28
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
setRedirectionUris(string $redirection_uris)
ilLTIConsumeProvider $provider
setLtiVersion(string $lti_version)
$message
Definition: xapiexit.php:32
setProviderUrl(string $provider_url)
+ Here is the call graph for this function:

◆ save()

ilObjLTIConsumer::save ( )

Definition at line 397 of file class.ilObjLTIConsumer.php.

References $DIC, dbTableName(), getCustomActivityId(), getCustomLaunchKey(), getCustomLaunchSecret(), getCustomParams(), getHighscoreAchievedTS(), getHighscoreEnabled(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), ilObject\getId(), getLaunchMethod(), getMasteryScore(), getProviderId(), getUseXapi(), isStatementsReportEnabled(), and saveRepositoryActivationSettings().

Referenced by doUpdate().

397  : void
398  {
399  global $DIC; /* @var \ILIAS\DI\Container $DIC */
400 
401  $DIC->database()->replace($this->dbTableName(), [
402  'obj_id' => ['integer', $this->getId()]
403  ], [
404  'provider_id' => ['integer', $this->getProviderId()],
405  'launch_method' => ['text', $this->getLaunchMethod()],
406  'launch_key' => ['text', $this->getCustomLaunchKey()],
407  'launch_secret' => ['text', $this->getCustomLaunchSecret()],
408  'custom_params' => ['text', $this->getCustomParams()],
409  'use_xapi' => ['integer',$this->getUseXapi()],
410  'activity_id' => ['text',$this->getCustomActivityId()],
411  'show_statements' => ['integer',$this->isStatementsReportEnabled()],
412  'highscore_enabled' => ['integer', (int) $this->getHighscoreEnabled()],
413  'highscore_achieved_ts' => ['integer', (int) $this->getHighscoreAchievedTS()],
414  'highscore_percentage' => ['integer', (int) $this->getHighscorePercentage()],
415  'highscore_wtime' => ['integer', (int) $this->getHighscoreWTime()],
416  'highscore_own_table' => ['integer', (int) $this->getHighscoreOwnTable()],
417  'highscore_top_table' => ['integer', (int) $this->getHighscoreTopTable()],
418  'highscore_top_num' => ['integer', $this->getHighscoreTopNum()],
419  'mastery_score' => ['float', $this->getMasteryScore()]
420  ]);
421 
423  }
getHighscoreWTime()
Gets if the column with the workingtime should be shown.
getHighscorePercentage()
Gets if the percentage column should be shown.
getHighscoreEnabled()
Gets the setting which determines if the highscore feature is enabled.
global $DIC
Definition: feed.php:28
getHighscoreTopNum(int $a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
getHighscoreTopTable()
Gets, if the top-rankings table should be shown.
getHighscoreAchievedTS()
Returns if date and time of the scores achievement should be displayed.
getHighscoreOwnTable()
Gets if the own rankings table should be shown.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveRepositoryActivationSettings()

ilObjLTIConsumer::saveRepositoryActivationSettings ( )
protected

Definition at line 450 of file class.ilObjLTIConsumer.php.

References getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), ilObjectActivation\getItem(), isActivationLimited(), ilObjectActivation\TIMINGS_ACTIVATION, and ilObjectActivation\TIMINGS_DEACTIVATED.

Referenced by save().

450  : void
451  {
452  if ($this->ref_id > 0) {
453  ilObjectActivation::getItem($this->ref_id);
454 
455  $item = new ilObjectActivation();
456  if (!$this->isActivationLimited()) {
457  $item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);
458  } else {
459  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
460  $item->setTimingStart($this->getActivationStartingTime());
461  $item->setTimingEnd($this->getActivationEndingTime());
462  $item->toggleVisible($this->getActivationVisibility());
463  }
464 
465  $item->update($this->ref_id);
466  }
467  }
static getItem(int $ref_id)
Class ilObjectActivation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendResponseError()

static ilObjLTIConsumer::sendResponseError ( int  $code,
string  $message,
  $log = true 
)
static

Definition at line 1309 of file class.ilObjLTIConsumer.php.

References $DIC, Vendor\Package\$e, and ilObject\$log.

Referenced by invalidRequest(), and serverError().

1309  : void
1310  {
1311  global $DIC;
1312  try {
1313  if ($log) {
1314  self::getLogger()->error("$code $message");
1315  }
1316  $DIC->http()->saveResponse(
1317  $DIC->http()->response()
1318  ->withStatus($code)
1319  ->withBody(Streams::ofString($message))
1320  );
1321  $DIC->http()->sendResponse();
1322  $DIC->http()->close();
1323  } catch (Exception $e) {
1324  $DIC->http()->close();
1325  }
1326  }
global $DIC
Definition: feed.php:28
ilLogger $log
$message
Definition: xapiexit.php:32
+ Here is the caller graph for this function:

◆ sendResponseJson()

static ilObjLTIConsumer::sendResponseJson ( array  $obj)
static

Definition at line 1328 of file class.ilObjLTIConsumer.php.

References $DIC, and Vendor\Package\$e.

Referenced by sendAccessToken().

1328  : void
1329  {
1330  global $DIC;
1331  try {
1332  header('Content-Type: application/json; charset=utf-8');
1333  header('Cache-Control: no-store');
1334  header('Pragma: no-cache');
1335  echo json_encode($obj, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
1336  } catch (Exception $e) {
1337  self::sendResponseError(500, "error in sendResponseJson");
1338  $DIC->http()->close();
1339  }
1340  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ setActivationEndingTime()

ilObjLTIConsumer::setActivationEndingTime ( ?int  $activationEndingTime = null)

Definition at line 138 of file class.ilObjLTIConsumer.php.

References $activationEndingTime.

Referenced by loadRepositoryActivationSettings().

138  : void
139  {
140  $this->activationEndingTime = $activationEndingTime;
141  }
+ Here is the caller graph for this function:

◆ setActivationLimited()

ilObjLTIConsumer::setActivationLimited ( bool  $activationLimited)

Definition at line 118 of file class.ilObjLTIConsumer.php.

References $activationLimited.

Referenced by loadRepositoryActivationSettings().

118  : void
119  {
120  $this->activationLimited = $activationLimited;
121  }
bool $activationLimited
repository object activation settings (handled by ilObject)
+ Here is the caller graph for this function:

◆ setActivationStartingTime()

ilObjLTIConsumer::setActivationStartingTime ( ?int  $activationStartingTime = null)

Definition at line 128 of file class.ilObjLTIConsumer.php.

References $activationStartingTime.

Referenced by loadRepositoryActivationSettings().

128  : void
129  {
130  $this->activationStartingTime = $activationStartingTime;
131  }
+ Here is the caller graph for this function:

◆ setActivationVisibility()

ilObjLTIConsumer::setActivationVisibility ( bool  $activationVisibility)

Definition at line 148 of file class.ilObjLTIConsumer.php.

References $activationVisibility.

Referenced by loadRepositoryActivationSettings().

148  : void
149  {
150  $this->activationVisibility = $activationVisibility;
151  }
+ Here is the caller graph for this function:

◆ setCustomActivityId()

ilObjLTIConsumer::setCustomActivityId ( string  $custom_activity_id)

Definition at line 281 of file class.ilObjLTIConsumer.php.

References $custom_activity_id.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

281  : void
282  {
283  $this->custom_activity_id = $custom_activity_id;
284  }
+ Here is the caller graph for this function:

◆ setCustomLaunchKey()

ilObjLTIConsumer::setCustomLaunchKey ( string  $customLaunchKey)

Definition at line 223 of file class.ilObjLTIConsumer.php.

References $customLaunchKey.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

223  : void
224  {
225  $this->customLaunchKey = $customLaunchKey;
226  }
+ Here is the caller graph for this function:

◆ setCustomLaunchSecret()

ilObjLTIConsumer::setCustomLaunchSecret ( string  $customLaunchSecret)

Definition at line 233 of file class.ilObjLTIConsumer.php.

References $customLaunchSecret.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

233  : void
234  {
235  $this->customLaunchSecret = $customLaunchSecret;
236  }
+ Here is the caller graph for this function:

◆ setCustomParams()

ilObjLTIConsumer::setCustomParams ( string  $customParams)

Definition at line 243 of file class.ilObjLTIConsumer.php.

References $customParams.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

243  : void
244  {
245  $this->customParams = $customParams;
246  }
+ Here is the caller graph for this function:

◆ setHighscoreAchievedTS()

ilObjLTIConsumer::setHighscoreAchievedTS ( bool  $a_achieved_ts)

Sets if the date and time of the scores achievement should be displayed.

Definition at line 500 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

500  : void
501  {
502  $this->_highscore_achieved_ts = $a_achieved_ts;
503  }
+ Here is the caller graph for this function:

◆ setHighscoreEnabled()

ilObjLTIConsumer::setHighscoreEnabled ( bool  $a_enabled)

HIGHSCORE.

Sets if the highscore feature should be enabled.

Definition at line 481 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

481  : void
482  {
483  $this->_highscore_enabled = $a_enabled;
484  }
+ Here is the caller graph for this function:

◆ setHighscoreMode()

ilObjLTIConsumer::setHighscoreMode ( int  $mode)
Parameters
$modeint

Definition at line 636 of file class.ilObjLTIConsumer.php.

References setHighscoreOwnTable(), and setHighscoreTopTable().

Referenced by ilLTIConsumerSettingsFormGUI\initObject().

636  : void
637  {
638  switch ($mode) {
639  case self::HIGHSCORE_SHOW_ALL_TABLES:
640  $this->setHighscoreTopTable(true);
641  $this->setHighscoreOwnTable(true);
642  break;
643 
644  case self::HIGHSCORE_SHOW_TOP_TABLE:
645  $this->setHighscoreTopTable(true);
646  $this->setHighscoreOwnTable(false);
647  break;
648 
649  case self::HIGHSCORE_SHOW_OWN_TABLE:
650  default:
651  $this->setHighscoreTopTable(false);
652  $this->setHighscoreOwnTable(true);
653  break;
654  }
655  }
setHighscoreTopTable(bool $a_top_table)
Sets if the top-rankings table should be shown.
setHighscoreOwnTable(bool $a_own_table)
Sets if the table with the own ranking should be shown.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setHighscoreOwnTable()

ilObjLTIConsumer::setHighscoreOwnTable ( bool  $a_own_table)

Sets if the table with the own ranking should be shown.

Parameters
bool$a_own_tableTrue, if table with own ranking should be shown.

Definition at line 556 of file class.ilObjLTIConsumer.php.

Referenced by load(), and setHighscoreMode().

556  : void
557  {
558  $this->_highscore_own_table = $a_own_table;
559  }
+ Here is the caller graph for this function:

◆ setHighscorePercentage()

ilObjLTIConsumer::setHighscorePercentage ( bool  $a_percentage)

Sets if the percentages of the scores pass should be shown.

Definition at line 518 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

518  : void
519  {
520  $this->_highscore_percentage = $a_percentage;
521  }
+ Here is the caller graph for this function:

◆ setHighscoreTopNum()

ilObjLTIConsumer::setHighscoreTopNum ( int  $a_top_num)

Sets the number of entries which are to be shown in the top-rankings table.

Parameters
integer$a_top_numNumber of entries in the top-rankings table.

Definition at line 595 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

595  : void
596  {
597  $this->_highscore_top_num = $a_top_num;
598  }
+ Here is the caller graph for this function:

◆ setHighscoreTopTable()

ilObjLTIConsumer::setHighscoreTopTable ( bool  $a_top_table)

Sets if the top-rankings table should be shown.

Definition at line 574 of file class.ilObjLTIConsumer.php.

Referenced by load(), and setHighscoreMode().

574  : void
575  {
576  $this->_highscore_top_table = $a_top_table;
577  }
+ Here is the caller graph for this function:

◆ setHighscoreWTime()

ilObjLTIConsumer::setHighscoreWTime ( bool  $a_wtime)

Sets if the workingtime of the scores should be shown.

Definition at line 536 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

536  : void
537  {
538  $this->_highscore_wtime = $a_wtime;
539  }
+ Here is the caller graph for this function:

◆ setLaunchMethod()

ilObjLTIConsumer::setLaunchMethod ( string  $launchMethod)

Definition at line 213 of file class.ilObjLTIConsumer.php.

References $launchMethod.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

213  : void
214  {
215  $this->launchMethod = $launchMethod;
216  }
+ Here is the caller graph for this function:

◆ setMasteryScore()

ilObjLTIConsumer::setMasteryScore ( float  $mastery_score)

Definition at line 158 of file class.ilObjLTIConsumer.php.

References $mastery_score.

Referenced by load().

158  : void
159  {
160  $this->mastery_score = $mastery_score;
161  }
+ Here is the caller graph for this function:

◆ setMasteryScorePercent()

ilObjLTIConsumer::setMasteryScorePercent ( float  $mastery_score_percent)

Definition at line 168 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initObject().

168  : void
169  {
170  $this->mastery_score = $mastery_score_percent / 100;
171  }
+ Here is the caller graph for this function:

◆ setProvider()

ilObjLTIConsumer::setProvider ( ilLTIConsumeProvider  $provider)

Definition at line 193 of file class.ilObjLTIConsumer.php.

References $provider.

Referenced by load().

193  : void
194  {
195  $this->provider = $provider;
196  }
ilLTIConsumeProvider $provider
+ Here is the caller graph for this function:

◆ setProviderId()

ilObjLTIConsumer::setProviderId ( int  $providerId)

Definition at line 178 of file class.ilObjLTIConsumer.php.

References $providerId.

Referenced by load().

178  : void
179  {
180  $this->providerId = $providerId;
181  }
+ Here is the caller graph for this function:

◆ setStatementsReportEnabled()

ilObjLTIConsumer::setStatementsReportEnabled ( bool  $statementsReportEnabled)

Definition at line 300 of file class.ilObjLTIConsumer.php.

References $statementsReportEnabled.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

300  : void
301  {
302  $this->statementsReportEnabled = $statementsReportEnabled;
303  }
+ Here is the caller graph for this function:

◆ setUseXapi()

ilObjLTIConsumer::setUseXapi ( bool  $use_xapi)

Definition at line 271 of file class.ilObjLTIConsumer.php.

References $use_xapi.

Referenced by ilLTIConsumerSettingsFormGUI\initObject(), and load().

271  : void
272  {
273  $this->use_xapi = $use_xapi;
274  }
+ Here is the caller graph for this function:

◆ verifyPrivateKey()

static ilObjLTIConsumer::verifyPrivateKey ( )
static

Definition at line 1102 of file class.ilObjLTIConsumer.php.

References $config, $ilSetting, ILIAS\LTI\ToolProvider\$key, ILIAS\LTI\ToolProvider\$kid, and $res.

1102  : string
1103  {
1104  global $ilSetting;
1105  $key = $ilSetting->get(self::LTI_1_3_PRIVATE_KEY);
1106 
1107  if (empty($key)) {
1108  $kid = bin2hex(openssl_random_pseudo_bytes(10));
1109  $ilSetting->set(self::LTI_1_3_KID, $kid);
1110  $config = array(
1111  "digest_alg" => "sha256",
1112  "private_key_bits" => 2048,
1113  "private_key_type" => self::OPENSSL_KEYTYPE_RSA
1114  );
1115  $res = openssl_pkey_new($config);
1116  openssl_pkey_export($res, $privatekey);
1117  if (!empty($privatekey)) {
1118  $ilSetting->set(self::LTI_1_3_PRIVATE_KEY, $privatekey);
1119  } else {
1120  return self::ERROR_OPEN_SSL_CONF;
1121  }
1122  }
1123  return '';
1124  }
$res
Definition: ltiservices.php:69
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
string $kid
Key ID.
Definition: System.php:88
string $key
Consumer key/client ID value.
Definition: System.php:193
global $ilSetting
Definition: privfeed.php:17

◆ verifyToken()

static ilObjLTIConsumer::verifyToken ( )
static

Definition at line 1367 of file class.ilObjLTIConsumer.php.

References $auth, $DIC, and $token.

Referenced by ilLTIConsumerServiceBase\checkTool().

1367  : ?object
1368  {
1369  global $DIC;
1370  $auth = $DIC->http()->request()->getHeader("Authorization");
1371  // self::getLogger()->dump($auth);
1372  if (count($auth) < 1) {
1373  self::sendResponseError(405, "missing Authorization header");
1374  }
1375  preg_match('/Bearer\s+(.+)$/i', $auth[0], $matches);
1376  if (count($matches) != 2) {
1377  // self::getLogger()->error("405, missing required Authorization Baerer token in ".$auth[0]);
1378  self::sendResponseError(405, "missing required Authorization Baerer token");
1379  }
1380 
1381  $token = $matches[1];
1382  // self::getLogger()->dump($token);
1383  return self::getTokenObject($token);
1384  }
global $DIC
Definition: feed.php:28
$auth
Definition: metadata.php:76
$token
Definition: xapitoken.php:70
+ Here is the caller graph for this function:

Field Documentation

◆ $_highscore_achieved_ts

bool ilObjLTIConsumer::$_highscore_achieved_ts = true
protected

Definition at line 75 of file class.ilObjLTIConsumer.php.

Referenced by getHighscoreAchievedTS().

◆ $_highscore_enabled

bool ilObjLTIConsumer::$_highscore_enabled = false
protected

Definition at line 71 of file class.ilObjLTIConsumer.php.

Referenced by getHighscoreEnabled().

◆ $_highscore_own_table

bool ilObjLTIConsumer::$_highscore_own_table = true
protected

Definition at line 81 of file class.ilObjLTIConsumer.php.

Referenced by getHighscoreOwnTable().

◆ $_highscore_percentage

bool ilObjLTIConsumer::$_highscore_percentage = true
protected

Definition at line 77 of file class.ilObjLTIConsumer.php.

Referenced by getHighscorePercentage().

◆ $_highscore_top_num

int ilObjLTIConsumer::$_highscore_top_num = 10
protected

Definition at line 85 of file class.ilObjLTIConsumer.php.

Referenced by getHighscoreTopNum().

◆ $_highscore_top_table

bool ilObjLTIConsumer::$_highscore_top_table = true
protected

Definition at line 83 of file class.ilObjLTIConsumer.php.

Referenced by getHighscoreTopTable().

◆ $_highscore_wtime

bool ilObjLTIConsumer::$_highscore_wtime = true
protected

Definition at line 79 of file class.ilObjLTIConsumer.php.

Referenced by getHighscoreWTime().

◆ $activationEndingTime

int ilObjLTIConsumer::$activationEndingTime = null
protected

Definition at line 43 of file class.ilObjLTIConsumer.php.

Referenced by getActivationEndingTime(), and setActivationEndingTime().

◆ $activationLimited

bool ilObjLTIConsumer::$activationLimited = false
protected

repository object activation settings (handled by ilObject)

Definition at line 41 of file class.ilObjLTIConsumer.php.

Referenced by isActivationLimited(), and setActivationLimited().

◆ $activationStartingTime

int ilObjLTIConsumer::$activationStartingTime = null
protected

◆ $activationVisibility

bool ilObjLTIConsumer::$activationVisibility = null
protected

Definition at line 44 of file class.ilObjLTIConsumer.php.

Referenced by getActivationVisibility(), and setActivationVisibility().

◆ $anonymity

int ilObjLTIConsumer::$anonymity = 0
protected

Definition at line 73 of file class.ilObjLTIConsumer.php.

◆ $custom_activity_id

string ilObjLTIConsumer::$custom_activity_id = ''
protected

◆ $customLaunchKey

string ilObjLTIConsumer::$customLaunchKey = ''
protected

Definition at line 62 of file class.ilObjLTIConsumer.php.

Referenced by getCustomLaunchKey(), and setCustomLaunchKey().

◆ $customLaunchSecret

string ilObjLTIConsumer::$customLaunchSecret = ''
protected

Definition at line 64 of file class.ilObjLTIConsumer.php.

Referenced by getCustomLaunchSecret(), and setCustomLaunchSecret().

◆ $customParams

string ilObjLTIConsumer::$customParams = ''
protected

Definition at line 66 of file class.ilObjLTIConsumer.php.

Referenced by getCustomParams(), and setCustomParams().

◆ $launchMethod

string ilObjLTIConsumer::$launchMethod = self::LAUNCH_METHOD_NEW_WIN
protected

Definition at line 60 of file class.ilObjLTIConsumer.php.

Referenced by getLaunchMethod(), and setLaunchMethod().

◆ $mastery_score

float ilObjLTIConsumer::$mastery_score = 0.5
protected

Definition at line 58 of file class.ilObjLTIConsumer.php.

Referenced by getMasteryScore(), and setMasteryScore().

◆ $provider

ilLTIConsumeProvider ilObjLTIConsumer::$provider = null
protected

Definition at line 48 of file class.ilObjLTIConsumer.php.

Referenced by getProvider(), and setProvider().

◆ $providerId

int ilObjLTIConsumer::$providerId = 0
protected

Definition at line 46 of file class.ilObjLTIConsumer.php.

Referenced by getProviderId(), and setProviderId().

◆ $ref_id

int ilObjLTIConsumer::$ref_id = 0
protected

Definition at line 68 of file class.ilObjLTIConsumer.php.

◆ $statementsReportEnabled

bool ilObjLTIConsumer::$statementsReportEnabled = false
protected

◆ $use_xapi

bool ilObjLTIConsumer::$use_xapi = false
protected

Definition at line 54 of file class.ilObjLTIConsumer.php.

Referenced by getUseXapi(), and setUseXapi().

◆ DB_TABLE_NAME

const ilObjLTIConsumer::DB_TABLE_NAME = 'lti_consumer_settings'

Definition at line 36 of file class.ilObjLTIConsumer.php.

◆ ERROR_OPEN_SSL_CONF

const ilObjLTIConsumer::ERROR_OPEN_SSL_CONF = 'error openssl config invalid'

Definition at line 94 of file class.ilObjLTIConsumer.php.

◆ HIGHSCORE_SHOW_ALL_TABLES

const ilObjLTIConsumer::HIGHSCORE_SHOW_ALL_TABLES = 1

Definition at line 87 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ HIGHSCORE_SHOW_OWN_TABLE

const ilObjLTIConsumer::HIGHSCORE_SHOW_OWN_TABLE = 3

Definition at line 89 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ HIGHSCORE_SHOW_TOP_TABLE

const ilObjLTIConsumer::HIGHSCORE_SHOW_TOP_TABLE = 2

Definition at line 88 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LAUNCH_METHOD_EMBEDDED

const ilObjLTIConsumer::LAUNCH_METHOD_EMBEDDED = 'embedded'

Definition at line 52 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LAUNCH_METHOD_NEW_WIN

const ilObjLTIConsumer::LAUNCH_METHOD_NEW_WIN = 'newWin'

Definition at line 51 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LAUNCH_METHOD_OWN_WIN

const ilObjLTIConsumer::LAUNCH_METHOD_OWN_WIN = 'ownWin'

Definition at line 50 of file class.ilObjLTIConsumer.php.

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LTI_1_3_KID

const ilObjLTIConsumer::LTI_1_3_KID = 'lti_1_3_kid'

Definition at line 92 of file class.ilObjLTIConsumer.php.

◆ LTI_1_3_PRIVATE_KEY

const ilObjLTIConsumer::LTI_1_3_PRIVATE_KEY = 'lti_1_3_privatekey'

Definition at line 93 of file class.ilObjLTIConsumer.php.

◆ LTI_JWT_CLAIM_PREFIX

const ilObjLTIConsumer::LTI_JWT_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti'

Definition at line 91 of file class.ilObjLTIConsumer.php.

◆ OPENSSL_KEYTYPE_RSA

const ilObjLTIConsumer::OPENSSL_KEYTYPE_RSA = ''

Definition at line 95 of file class.ilObjLTIConsumer.php.

◆ REG_TOKEN_OP_NEW_REG

const ilObjLTIConsumer::REG_TOKEN_OP_NEW_REG = 'reg'

Definition at line 97 of file class.ilObjLTIConsumer.php.

◆ REG_TOKEN_OP_UPDATE_REG

const ilObjLTIConsumer::REG_TOKEN_OP_UPDATE_REG = 'reg-update'

Definition at line 98 of file class.ilObjLTIConsumer.php.


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