ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 $token, 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
 getObjectProperties ()
 
 flushObjectProperties ()
 
 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 $description)
 
 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 getIconForType (string $type)
 
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 ()
 
 doCloneObject (ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id=null)
 
- 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
 
LOMServices $lom_services
 
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 = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Member Functions

 determineLTIRole (int $a_user_id, int $a_ref_id, ilRbacReview $rbac_review_instance)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

ilObjLTIConsumer constructor.

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

References ILIAS\GlobalScreen\Provider\__construct().

105  {
106  parent::__construct($a_id, $a_reference);
107  }
__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 941 of file class.ilObjLTIConsumer.php.

References $clientId, $context, $DIC, CLIENT_ID, ilLTIConsumeProvider\getClientId(), ilLTIConsumeProvider\getId(), ilCmiXapiUser\getIdent(), ilCmiXapiUser\getIdentAsId(), 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().

946  : ?array {
947  global $DIC;
948 
949  $clientId = $provider->getClientId();
950  $deploymentId = $provider->getId();
951  $ilLTIConsumerLaunch = new ilLTIConsumerLaunch($refId);
952  $context = $ilLTIConsumerLaunch->getContext();
953  $contextType = $ilLTIConsumerLaunch::getLTIContextType($context["type"]);
954  $contextId = $context["id"];
955  $contextTitle = $context["title"];
956 
957  $roles = "Instructor";
958  $usrImage = '';
959  if ($provider->getIncludeUserPicture()) {
960  $usrImage = self::getIliasHttpPath() . "/" . $DIC->user()->getPersonalPicturePath("small");
961  }
962  $documentTarget = "window";
963  if ($provider->getLaunchMethod() == self::LAUNCH_METHOD_EMBEDDED) {
964  $documentTarget = "iframe";
965  }
966  $nameGiven = '-';
967  $nameFamily = '-';
968  $nameFull = '-';
969  switch ($provider->getPrivacyName()) {
971  $nameGiven = $DIC->user()->getFirstname();
972  $nameFull = $DIC->user()->getFirstname();
973  break;
975  $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() . ' ' : '';
976  $usrName .= $DIC->user()->getLastname();
977  $nameFamily = $usrName;
978  $nameFull = $usrName;
979  break;
981  $nameGiven = $DIC->user()->getFirstname();
982  $nameFamily = $DIC->user()->getLastname();
983  $nameFull = $DIC->user()->getFullname();
984  break;
985  }
986 
987  $userIdLTI = ilCmiXapiUser::getIdentAsId($provider->getPrivacyIdent(), $DIC->user());
988  $emailPrimary = ilCmiXapiUser::getIdent($provider->getPrivacyIdent(), $DIC->user());
989  $toolConsumerInstanceGuid = CLIENT_ID . ".";
990  $parseIliasUrl = parse_url(self::getIliasHttpPath());
991  if (array_key_exists("path", $parseIliasUrl)) {
992  $toolConsumerInstanceGuid .= implode(".", array_reverse(explode("/", $parseIliasUrl["path"])));
993  }
994  $toolConsumerInstanceGuid .= $parseIliasUrl["host"];
995 
996  $content_select_vars = [
997  "lti_message_type" => "ContentItemSelectionRequest",
998  "lti_version" => "1.3.0",
999  "user_id" => (string) $userIdLTI,
1000  "user_image" => $usrImage,
1001  "roles" => $roles,
1002  "lis_person_name_given" => $nameGiven,
1003  "lis_person_name_family" => $nameFamily,
1004  "lis_person_name_full" => $nameFull,
1005  "lis_person_contact_email_primary" => $emailPrimary,
1006  "context_id" => (string) $contextId,
1007  "context_type" => $contextType,
1008  "context_title" => $contextTitle,
1009  "context_label" => $contextType . " " . $contextId,
1010  "launch_presentation_locale" => $DIC->language()->getLangKey(),
1011  "launch_presentation_document_target" => $documentTarget,
1012  "launch_presentation_width" => "",
1013  //recommended
1014  "launch_presentation_height" => "",
1015  //recommended
1016  "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
1017  "tool_consumer_instance_name" => $DIC->settings()->get("short_inst_name") ? $DIC->settings()->get(
1018  "short_inst_name"
1019  ) : CLIENT_ID,
1020  "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
1021  "tool_consumer_instance_url" => ilLink::_getLink(ROOT_FOLDER_ID, "root"),
1022  //ToDo? "https://vb52p70.example.com/release_5-3/goto.php?target=root_1&client_id=inno",
1023  "tool_consumer_instance_contact_email" => $DIC->settings()->get("admin_email"),
1024  "tool_consumer_info_product_family_code" => "ilias",
1025  "tool_consumer_info_version" => ILIAS_VERSION,
1026  "content_item_return_url" => $returnUrl,
1027  "accept_types" => "ltiResourceLink",
1028  "accept_presentation_document_targets" => "iframe,window,embed",
1029  "accept_multiple" => true,
1030  "auto_create" => true,
1031  ];
1032  $provider_custom_params = self::getProviderCustomParamsArray($provider);
1033  foreach ($provider_custom_params as $key => $value) {
1034  $content_select_vars['custom_' . $key] = $value;
1035  }
1036 
1037  if (!empty(self::verifyPrivateKey())) {
1038  $DIC->ui()->mainTemplate()->setOnScreenMessage('failure', 'ERROR_OPEN_SSL_CONF', true);
1039  return null;
1040  }
1041  return self::LTISignJWT($content_select_vars, '', $clientId, $deploymentId, $nonce);
1042  }
static getIdentAsId(int $userIdentMode, ilObjUser $user)
$context
Definition: webdav.php:31
const ROOT_FOLDER_ID
Definition: constants.php:32
$clientId
Definition: ltiregend.php:26
$refId
Definition: xapitoken.php:56
static getIdent(int $userIdentMode, ilObjUser $user)
const ILIAS_VERSION
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:25
+ 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 661 of file class.ilObjLTIConsumer.php.

References $DIC, $token, 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, and ilLTIConsumerLaunch\signOAuth().

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

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

References $DIC, $token, CLIENT_ID, determineLTIRole(), ilLTIConsumerResult\getByKeys(), getCustomParamsArray(), ilObject\getDescription(), ilObject\getId(), ilCmiXapiUser\getIdentAsId(), 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, and ROOT_FOLDER_ID.

808  : ?array {
809  global $DIC;
810  /* @var \ILIAS\DI\Container $DIC */
811  $roles = $this->determineLTIRole($DIC->user()->getId(), $this->getRefId(), $DIC->rbac()->review());
812 
813  if ($this->getProvider()->getAlwaysLearner() == true) {
814  $roles = 'Learner';
815  }
816 
817 
818 
819  $resource_link_id = $this->getRefId();
820  if ($this->getProvider()->getUseProviderId() == true) {
821  $resource_link_id = 'p' . $this->getProvider()->getId();
822  }
823 
824  $usrImage = '';
825  if ($this->getProvider()->getIncludeUserPicture()) {
826  $usrImage = self::getIliasHttpPath() . "/" . $DIC->user()->getPersonalPicturePath("small");
827  }
828 
829  $documentTarget = "window";
830  if ($this->getLaunchMethod() == self::LAUNCH_METHOD_EMBEDDED) {
831  $documentTarget = "iframe";
832  }
833 
834  $nameGiven = '-';
835  $nameFamily = '-';
836  $nameFull = '-';
837  switch ($this->getProvider()->getPrivacyName()) {
839  $nameGiven = $DIC->user()->getFirstname();
840  $nameFull = $DIC->user()->getFirstname();
841  break;
843  $usrName = $DIC->user()->getUTitle() ? $DIC->user()->getUTitle() . ' ' : '';
844  $usrName .= $DIC->user()->getLastname();
845  $nameFamily = $usrName;
846  $nameFull = $usrName;
847  break;
849  $nameGiven = $DIC->user()->getFirstname();
850  $nameFamily = $DIC->user()->getLastname();
851  $nameFull = $DIC->user()->getFullname();
852  break;
853  }
854 
855  $userIdLTI = ilCmiXapiUser::getIdentAsId($this->getProvider()->getPrivacyIdent(), $DIC->user());
856 
857  $emailPrimary = $cmixUser->getUsrIdent();
858 
859  ilLTIConsumerResult::getByKeys($this->getId(), $DIC->user()->getId(), true);
860 
861  $toolConsumerInstanceGuid = CLIENT_ID . ".";
862  $parseIliasUrl = parse_url(self::getIliasHttpPath());
863  if (array_key_exists("path", $parseIliasUrl)) {
864  $toolConsumerInstanceGuid .= implode(".", array_reverse(explode("/", $parseIliasUrl["path"])));
865  }
866  $toolConsumerInstanceGuid .= $parseIliasUrl["host"];
867  $launch_vars = [
868  "lti_message_type" => "basic-lti-launch-request",
869  "lti_version" => "1.3.0",
870  "resource_link_id" => (string) $resource_link_id,
871  "resource_link_title" => $this->getTitle(),
872  "resource_link_description" => $this->getDescription(),
873  "user_id" => (string) $userIdLTI,
874  "user_image" => $usrImage,
875  "roles" => $roles,
876  "lis_person_name_given" => $nameGiven,
877  "lis_person_name_family" => $nameFamily,
878  "lis_person_name_full" => $nameFull,
879  "lis_person_contact_email_primary" => $emailPrimary,
880  "context_id" => $contextId,
881  "context_type" => $contextType,
882  "context_title" => $contextTitle,
883  "context_label" => $contextType . " " . $contextId,
884  "launch_presentation_locale" => $this->lng->getLangKey(),
885  "launch_presentation_document_target" => $documentTarget,
886  //"launch_presentation_width" => "",
887  //recommended
888  //"launch_presentation_height" => "",
889  //recommended
890  "launch_presentation_return_url" => $returnUrl,
891  "tool_consumer_instance_guid" => $toolConsumerInstanceGuid,
892  "tool_consumer_instance_name" => $DIC->settings()->get("short_inst_name") ? $DIC->settings()->get(
893  "short_inst_name"
894  ) : CLIENT_ID,
895  "tool_consumer_instance_description" => ilObjSystemFolder::_getHeaderTitle(),
896  "tool_consumer_instance_url" => ilLink::_getLink(ROOT_FOLDER_ID, "root"),
897  //ToDo? "https://vb52p70.example.com/release_5-3/goto.php?target=root_1&client_id=inno",
898  "tool_consumer_instance_contact_email" => $DIC->settings()->get("admin_email"),
899  "launch_presentation_css_url" => "",
900  "tool_consumer_info_product_family_code" => "ilias",
901  "tool_consumer_info_version" => ILIAS_VERSION,
902  "lis_result_sourcedid" => $token,
903  "lis_outcome_service_url" => self::getIliasHttpPath(
904  ) . "/ltiresult.php?client_id=" . CLIENT_ID,
905  "role_scope_mentor" => ""
906  ];
907 
908  $provider_custom_params = self::getProviderCustomParamsArray($this->getProvider());
909  $custom_params = $this->getCustomParamsArray();
910  $merged_params = array_merge($provider_custom_params, $custom_params);
911  foreach ($merged_params as $key => $value) {
912  $launch_vars['custom_' . $key] = $value;
913  }
914 
915  if ($this->getProvider()->isGradeSynchronization()) {
916  $gradeservice = new ilLTIConsumerGradeService();
917  $launch_vars['custom_lineitem_url'] = self::getIliasHttpPath(
918  ) . "/ltiservices.php/gradeservice/" . $contextId . "/lineitems/" . $this->id . "/lineitem";
919 
920  // ! 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
921  // http://www.imsglobal.org/spec/lti-ags/v2p0#example-link-has-a-single-line-item-tool-can-only-post-score
922  $launch_vars['custom_lineitems_url'] = self::getIliasHttpPath(
923  ) . "/ltiservices.php/gradeservice/" . $contextId . "/linetitems/";
924 
925  $launch_vars['custom_ags_scopes'] = implode(",", $gradeservice->getPermittedScopes());
926  }
927 
928  if (!empty(self::verifyPrivateKey())) {
929  $DIC->ui()->mainTemplate()->setOnScreenMessage('failure', 'ERROR_OPEN_SSL_CONF', true);
930  return null;
931  }
932  return self::LTISignJWT($launch_vars, $endpoint, $clientId, $deploymentId, $nonce);
933  }
static getIdentAsId(int $userIdentMode, ilObjUser $user)
const ROOT_FOLDER_ID
Definition: constants.php:32
determineLTIRole(int $a_user_id, int $a_ref_id, ilRbacReview $rbac_review_instance)
$clientId
Definition: ltiregend.php:26
const ILIAS_VERSION
$token
Definition: xapitoken.php:67
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:25
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 472 of file class.ilObjLTIConsumer.php.

Referenced by save().

472  : string
473  {
474  return self::DB_TABLE_NAME;
475  }
+ Here is the caller graph for this function:

◆ determineLTIRole()

ilObjLTIConsumer::determineLTIRole ( int  $a_user_id,
int  $a_ref_id,
ilRbacReview  $rbac_review_instance 
)
private

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

References $DIC, ilObject\_lookupTitle(), ilObject\_lookupType(), ilRbacReview\assignedGlobalRoles(), ilRbacReview\assignedRoles(), ilRbacReview\getParentRoleIds(), and SYSTEM_ROLE_ID.

Referenced by buildLaunchParametersLTI13().

1470  : string
1471  {
1472  global $DIC;
1473 
1474  $global_roles = $rbac_review_instance->assignedGlobalRoles($a_user_id);
1475  if (in_array(SYSTEM_ROLE_ID, $global_roles)) {
1476  return 'Administrator';
1477  }
1478 
1479  $user_assigned_roles = $rbac_review_instance->assignedRoles($a_user_id);
1480  $parent_roles_data = $rbac_review_instance->getParentRoleIds($a_ref_id, true);
1481  $roles_in_path_ids = array_keys($parent_roles_data);
1482  $effective_roles_in_context = array_intersect($user_assigned_roles, $roles_in_path_ids);
1483 
1484  if (!empty($effective_roles_in_context)) {
1485  $parent_ref_id = $DIC->repositoryTree()->getParentId($a_ref_id);
1486  $context_obj_type = ilObject::_lookupType($parent_ref_id, true);
1487 
1488  $instructor_base_titles = [
1489  'il_' . $context_obj_type . '_admin',
1490  'il_' . $context_obj_type . '_tutor'
1491  ];
1492 
1493  foreach ($effective_roles_in_context as $role_id) {
1494  $role_title = ilObject::_lookupTitle($role_id);
1495 
1496  foreach ($instructor_base_titles as $base_title) {
1497  if (str_starts_with((string) $role_title, $base_title)) {
1498  return 'Instructor';
1499  }
1500  }
1501  }
1502  }
1503 
1504  return 'Learner';
1505  }
const SYSTEM_ROLE_ID
Definition: constants.php:29
static _lookupTitle(int $obj_id)
getParentRoleIds(int $a_endnode_id, bool $a_templates=false)
Get an array of parent role ids of all parent roles, if last parameter is set true you get also all p...
global $DIC
Definition: shib_login.php:25
assignedGlobalRoles(int $a_usr_id)
Get assigned global roles for an user.
static _lookupType(int $id, bool $reference=false)
assignedRoles(int $a_usr_id)
get all assigned roles to a given user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doCloneObject()

ilObjLTIConsumer::doCloneObject ( ilObject2  $new_obj,
int  $a_target_id,
?int  $a_copy_id = null 
)
protected

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

References getActivationEndingTime(), getActivationStartingTime(), getActivationVisibility(), getCustomActivityId(), getCustomLaunchKey(), getCustomLaunchSecret(), getCustomParams(), getHighscoreAchievedTS(), getHighscoreEnabled(), getHighscoreOwnTable(), getHighscorePercentage(), getHighscoreTopNum(), getHighscoreTopTable(), getHighscoreWTime(), getLaunchMethod(), getMasteryScore(), getProviderId(), getUseXapi(), isActivationLimited(), and isStatementsReportEnabled().

1436  : void
1437  {
1438  // LTI specific properties
1439  $new_obj->setProviderId($this->getProviderId());
1440  $new_obj->setLaunchMethod($this->getLaunchMethod());
1441  $new_obj->setCustomLaunchKey($this->getCustomLaunchKey());
1442  $new_obj->setCustomLaunchSecret($this->getCustomLaunchSecret());
1443  $new_obj->setCustomParams($this->getCustomParams());
1444  $new_obj->setUseXapi($this->getUseXapi());
1445  $new_obj->setCustomActivityId($this->getCustomActivityId());
1446  $new_obj->setStatementsReportEnabled($this->isStatementsReportEnabled());
1447  $new_obj->setMasteryScore($this->getMasteryScore());
1448 
1449  // Highscore configuration
1450  $new_obj->setHighscoreEnabled($this->getHighscoreEnabled());
1451  $new_obj->setHighscoreAchievedTS($this->getHighscoreAchievedTS());
1452  $new_obj->setHighscorePercentage($this->getHighscorePercentage());
1453  $new_obj->setHighscoreWTime($this->getHighscoreWTime());
1454  $new_obj->setHighscoreOwnTable($this->getHighscoreOwnTable());
1455  $new_obj->setHighscoreTopTable($this->getHighscoreTopTable());
1456  $new_obj->setHighscoreTopNum($this->getHighscoreTopNum());
1457 
1458  // Activation settings
1459  $new_obj->setActivationLimited($this->isActivationLimited());
1460  $new_obj->setActivationStartingTime($this->getActivationStartingTime());
1461  $new_obj->setActivationEndingTime($this->getActivationEndingTime());
1462 
1463  if ($this->isActivationLimited() && $this->getActivationVisibility() !== null) {
1464  $new_obj->setActivationVisibility($this->getActivationVisibility());
1465  }
1466 
1467  $new_obj->save();
1468  }
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.
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:

◆ doRead()

ilObjLTIConsumer::doRead ( )
protected

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

References load().

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

◆ doUpdate()

ilObjLTIConsumer::doUpdate ( )
protected

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

References save().

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

◆ getAccessTokenUrl()

static ilObjLTIConsumer::getAccessTokenUrl ( )
static

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

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

1249  : string
1250  {
1251  return self::getIliasHttpPath() . "/ltitoken.php";
1252  }
+ Here is the caller graph for this function:

◆ getActivationEndingTime()

ilObjLTIConsumer::getActivationEndingTime ( )

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

References $activationEndingTime.

Referenced by doCloneObject(), and saveRepositoryActivationSettings().

134  : ?int
135  {
137  }
+ Here is the caller graph for this function:

◆ getActivationStartingTime()

ilObjLTIConsumer::getActivationStartingTime ( )

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

References $activationStartingTime.

Referenced by doCloneObject(), and saveRepositoryActivationSettings().

124  : ?int
125  {
127  }
+ Here is the caller graph for this function:

◆ getActivationVisibility()

ilObjLTIConsumer::getActivationVisibility ( )

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

References $activationVisibility.

Referenced by doCloneObject(), and saveRepositoryActivationSettings().

144  : ?bool
145  {
147  }
+ Here is the caller graph for this function:

◆ getActivityId()

ilObjLTIConsumer::getActivityId ( )

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

References $custom_activity_id, and getProvider().

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

◆ getAuthenticationRequestUrl()

static ilObjLTIConsumer::getAuthenticationRequestUrl ( )
static

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

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

1244  : string
1245  {
1246  return self::getIliasHttpPath() . "/ltiauth.php";
1247  }
+ Here is the caller graph for this function:

◆ getCustomActivityId()

ilObjLTIConsumer::getCustomActivityId ( )

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

References $custom_activity_id.

Referenced by doCloneObject(), and save().

277  : string
278  {
280  }
+ Here is the caller graph for this function:

◆ getCustomLaunchKey()

ilObjLTIConsumer::getCustomLaunchKey ( )

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

References $customLaunchKey.

Referenced by doCloneObject(), getLaunchKey(), and save().

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

◆ getCustomLaunchSecret()

ilObjLTIConsumer::getCustomLaunchSecret ( )

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

References $customLaunchSecret.

Referenced by doCloneObject(), getLaunchSecret(), and save().

229  : string
230  {
232  }
+ Here is the caller graph for this function:

◆ getCustomParams()

ilObjLTIConsumer::getCustomParams ( )

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

References $customParams.

Referenced by doCloneObject(), getCustomParamsArray(), and save().

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

◆ getCustomParamsArray()

ilObjLTIConsumer::getCustomParamsArray ( )
Returns
string[]

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

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

Referenced by buildLaunchParameters(), and buildLaunchParametersLTI13().

309  : array
310  {
311  $paramsAsArray = [];
312 
313  $params = $this->getCustomParams();
314  // allows foo=bar;foo2=baz2; foo3=baz3
315  $params = preg_split('/; ?/', $params);
316 
317  foreach ($params as $param) {
318  $param = explode('=', $param);
319  // empty field, duplicate/leading/trailing semicolon?
320  if ($param[0] != '') {
321  $value = isset($param[1]) ? $param[1] : '';
322  $paramsAsArray[$param[0]] = $value;
323  }
324  }
325 
326  return $paramsAsArray;
327  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
$param
Definition: xapitoken.php:44
+ 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 511 of file class.ilObjLTIConsumer.php.

References $_highscore_achieved_ts.

Referenced by doCloneObject(), and save().

511  : bool
512  {
514  }
+ 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 493 of file class.ilObjLTIConsumer.php.

References $_highscore_enabled.

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

493  : bool
494  {
496  }
+ Here is the caller graph for this function:

◆ getHighscoreMode()

ilObjLTIConsumer::getHighscoreMode ( )

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

References getHighscoreOwnTable(), and getHighscoreTopTable().

619  : int
620  {
621  switch (true) {
622  case $this->getHighscoreOwnTable() && $this->getHighscoreTopTable():
624 
625  case $this->getHighscoreTopTable():
627 
628  case $this->getHighscoreOwnTable():
629  default:
631  }
632  }
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', 'vtt', '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 567 of file class.ilObjLTIConsumer.php.

References $_highscore_own_table.

Referenced by doCloneObject(), getHighscoreMode(), and save().

567  : bool
568  {
570  }
+ 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 529 of file class.ilObjLTIConsumer.php.

References $_highscore_percentage.

Referenced by doCloneObject(), and save().

529  : bool
530  {
532  }
+ 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 609 of file class.ilObjLTIConsumer.php.

References $_highscore_top_num.

Referenced by doCloneObject(), and save().

609  : int
610  {
611  $retval = $a_retval;
612  if ($this->_highscore_top_num != 0) {
613  $retval = $this->_highscore_top_num;
614  }
615 
616  return $retval;
617  }
+ 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 585 of file class.ilObjLTIConsumer.php.

References $_highscore_top_table.

Referenced by doCloneObject(), getHighscoreMode(), and save().

585  : bool
586  {
588  }
+ 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 547 of file class.ilObjLTIConsumer.php.

References $_highscore_wtime.

Referenced by doCloneObject(), and save().

547  : bool
548  {
550  }
+ Here is the caller graph for this function:

◆ getIliasHttpPath()

static ilObjLTIConsumer::getIliasHttpPath ( )
static

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

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

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

1203  : string
1204  {
1205  global $DIC;
1206 
1207  $logger = $DIC->logger()->root();
1208 
1209  if ($DIC['https']->isDetected()) {
1210  $protocol = 'https://';
1211  } else {
1212  $protocol = 'http://';
1213  }
1214  $host = $_SERVER['HTTP_HOST'];
1215 
1216  $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
1217 
1218  // security fix: this failed, if the URI contained "?" and following "/"
1219  // -> we remove everything after "?"
1220  if (is_int($pos = strpos($rq_uri, "?"))) {
1221  $rq_uri = substr($rq_uri, 0, $pos);
1222  }
1223 
1224  $path = pathinfo($rq_uri);
1225  if (isset($path['extension']) && $path['extension'] !== '') {
1226  $uri = dirname($rq_uri);
1227  } else {
1228  $uri = $rq_uri;
1229  }
1230  $logger->info("URI --- 1: " . $uri);
1231  $uri = str_replace("components/ILIAS/LTIConsumer", "", $uri);
1232  $logger->info("URI --- 2: " . $uri);
1233  $iliasHttpPath = ilContext::modifyHttpPath(implode('', [$protocol, $host, $uri]));
1234  $f = new \ILIAS\Data\Factory();
1235  $uri = $f->uri(rtrim($iliasHttpPath, "/"));
1236  return $uri->getBaseURI();
1237  }
static modifyHttpPath(string $httpPath)
$path
Definition: ltiservices.php:30
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
global $DIC
Definition: shib_login.php:25
+ 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 1391 of file class.ilObjLTIConsumer.php.

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

1392  {
1393  return new self($a_id, $a_reference);
1394  }
+ Here is the caller graph for this function:

◆ getJwks()

static ilObjLTIConsumer::getJwks ( )
static

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

References $res.

1183  : array
1184  {
1185  $jwks = ['keys' => []];
1186 
1187  $privatekey = self::getPrivateKey();
1188  $res = openssl_pkey_get_private($privatekey['key']);
1189  $details = openssl_pkey_get_details($res);
1190 
1191  $jwk = [];
1192  $jwk['kty'] = 'RSA';
1193  $jwk['alg'] = 'RS256';
1194  $jwk['kid'] = $privatekey['kid'];
1195  $jwk['e'] = rtrim(strtr(base64_encode($details['rsa']['e']), '+/', '-_'), '=');
1196  $jwk['n'] = rtrim(strtr(base64_encode($details['rsa']['n']), '+/', '-_'), '=');
1197  $jwk['use'] = 'sig';
1198 
1199  $jwks['keys'][] = $jwk;
1200  return $jwks;
1201  }
$res
Definition: ltiservices.php:69

◆ getLaunchKey()

ilObjLTIConsumer::getLaunchKey ( )

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

References getCustomLaunchKey(), and getProvider().

Referenced by buildLaunchParameters().

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

◆ getLaunchMethod()

ilObjLTIConsumer::getLaunchMethod ( )

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

References $launchMethod.

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

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

◆ getLaunchSecret()

ilObjLTIConsumer::getLaunchSecret ( )

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

References getCustomLaunchSecret(), and getProvider().

Referenced by buildLaunchParameters().

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

◆ getLogger()

static ilObjLTIConsumer::getLogger ( )
static

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

References ilLoggerFactory\getLogger().

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

1431  : ilLogger
1432  {
1433  return ilLoggerFactory::getLogger('lti');
1434  }
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 154 of file class.ilObjLTIConsumer.php.

References $mastery_score.

Referenced by doCloneObject(), and save().

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

◆ getMasteryScorePercent()

ilObjLTIConsumer::getMasteryScorePercent ( )

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

Referenced by ilLTIConsumerPlaceholderValues\getMasteryScore().

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

◆ getNewClientId()

static ilObjLTIConsumer::getNewClientId ( )
static

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

Referenced by ilLTIConsumeProvider\getClientId().

1353  : string
1354  {
1355  return Util::getRandomString(15);
1356  }
+ Here is the caller graph for this function:

◆ getOpenidConfig()

static ilObjLTIConsumer::getOpenidConfig ( )
static

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

References ILIAS_VERSION.

1279  : array
1280  {
1281  $scopesSupported = array('openid');
1282  $gradeservice = new ilLTIConsumerGradeService();
1283  $scopesSupported = array_merge($scopesSupported, $gradeservice->getPermittedScopes());
1284  return [
1285  "issuer" => self::getPlattformId(),
1286  "authorization_endpoint" => self::getAuthenticationRequestUrl(),
1287  "token_endpoint" => self::getAccessTokenUrl(),
1288  "token_endpoint_auth_methods_supported" => ["private_key_jwt"],
1289  "token_endpoint_auth_signing_alg_values_supported" => ["RS256"],
1290  "jwks_uri" => self::getPublicKeysetUrl(),
1291  "registration_endpoint" => self::getRegistrationUrl(),
1292  "scopes_supported" => $scopesSupported,
1293  "response_types_supported" => ["id_token"],
1294  "subject_types_supported" => ["public", "pairwise"],
1295  "id_token_signing_alg_values_supported" => ["RS256"],
1296  "claims_supported" => ["iss", "aud"],
1297  "https://purl.imsglobal.org/spec/lti-platform-configuration" => [
1298  "product_family_code" => "ilias.de",
1299  "version" => ILIAS_VERSION,
1300  "messages_supported" => [
1301  [
1302  "type" => "LtiResourceLinkRequest",
1303  "placements" => [
1304  ]
1305  ],
1306  [
1307  "type" => "LtiDeepLinkingRequest",
1308  "placements" => [
1309  ]
1310  ]
1311  ]
1312  ]
1313  ];
1314  }
const ILIAS_VERSION

◆ getOpenidConfigUrl()

static ilObjLTIConsumer::getOpenidConfigUrl ( )
static

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

1274  : string
1275  {
1276  return self::getIliasHttpPath() . "/lticonfig.php";
1277  }

◆ getPlattformId()

static ilObjLTIConsumer::getPlattformId ( )
static

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

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

1239  : string
1240  {
1241  return self::getIliasHttpPath();
1242  }
+ Here is the caller graph for this function:

◆ getPrivateKey()

static ilObjLTIConsumer::getPrivateKey ( )
static

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

References $ilSetting.

Referenced by sendAccessToken().

1132  : array
1133  {
1134  global $ilSetting;
1135  $err = self::verifyPrivateKey();
1136  if (!empty($err)) {
1137  return [];
1138  }
1139  $privatekey = $ilSetting->get(self::LTI_1_3_PRIVATE_KEY);
1140  $kid = $ilSetting->get(self::LTI_1_3_KID);
1141  return [
1142  "key" => $privatekey,
1143  "kid" => $kid
1144  ];
1145  }
global $ilSetting
Definition: privfeed.php:32
+ Here is the caller graph for this function:

◆ getProvider()

ilObjLTIConsumer::getProvider ( )

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

References $provider.

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

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

◆ getProviderCustomParamsArray()

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

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

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

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

◆ getProviderId()

ilObjLTIConsumer::getProviderId ( )

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

References $providerId.

Referenced by doCloneObject(), initProvider(), and save().

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

◆ getPublicKey()

static ilObjLTIConsumer::getPublicKey ( )
static

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

References $privateKey, and $res.

1171  : string
1172  {
1173  $publicKey = null;
1174  $privateKey = self::getPrivateKey();
1175  $res = openssl_pkey_get_private($privateKey['key']);
1176  if ($res !== false) {
1177  $details = openssl_pkey_get_details($res);
1178  $publicKey = $details['key'];
1179  }
1180  return $publicKey;
1181  }
$res
Definition: ltiservices.php:69
$privateKey
Definition: ltiregstart.php:66

◆ getPublicKeysetUrl()

static ilObjLTIConsumer::getPublicKeysetUrl ( )
static

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

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

1254  : string
1255  {
1256  return self::getIliasHttpPath() . "/lticerts.php";
1257  }
+ Here is the caller graph for this function:

◆ getRawData()

static ilObjLTIConsumer::getRawData ( )
static

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

1401  : ?string
1402  {
1403  return file_get_contents('php://input');
1404  }

◆ getRegistrationEndUrl()

static ilObjLTIConsumer::getRegistrationEndUrl ( )
static

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

Referenced by ilLTIConsumeProviderFormGUI\getDynRegRequest().

1269  : string
1270  {
1271  return self::getIliasHttpPath() . "/ltiregend.php";
1272  }
+ Here is the caller graph for this function:

◆ getRegistrationStartUrl()

static ilObjLTIConsumer::getRegistrationStartUrl ( )
static

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

Referenced by ilLTIConsumeProviderFormGUI\getDynRegRequest().

1264  : string
1265  {
1266  return self::getIliasHttpPath() . "/ltiregstart.php";
1267  }
+ Here is the caller graph for this function:

◆ getRegistrationUrl()

static ilObjLTIConsumer::getRegistrationUrl ( )
static

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

1259  : string
1260  {
1261  return self::getIliasHttpPath() . "/ltiregistration.php";
1262  }

◆ getTokenObject()

static ilObjLTIConsumer::getTokenObject ( string  $token)
static

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

References Vendor\Package\$e.

1406  : ?object
1407  {
1408  try {
1409  $keys = JWK::parseKeySet(self::getJwks());
1410  return JWT::decode($token, $keys);
1411  } catch (Exception $e) {
1412  return null;
1413  }
1414  }
$token
Definition: xapitoken.php:67

◆ getUseXapi()

ilObjLTIConsumer::getUseXapi ( )

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

References $use_xapi.

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

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

◆ initProvider()

ilObjLTIConsumer::initProvider ( )

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

References getProviderId().

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

◆ initType()

ilObjLTIConsumer::initType ( )
protected

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

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

◆ isActivationLimited()

ilObjLTIConsumer::isActivationLimited ( )

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

References $activationLimited.

Referenced by doCloneObject(), and saveRepositoryActivationSettings().

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

◆ isLaunchMethodEmbedded()

ilObjLTIConsumer::isLaunchMethodEmbedded ( )

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

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

◆ isLaunchMethodOwnWin()

ilObjLTIConsumer::isLaunchMethodOwnWin ( )

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

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

◆ isMixedContentType()

ilObjLTIConsumer::isMixedContentType ( )

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

1396  : bool
1397  {
1398  return true;
1399  }

◆ isStatementsReportEnabled()

ilObjLTIConsumer::isStatementsReportEnabled ( )

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

References $statementsReportEnabled.

Referenced by doCloneObject(), and save().

296  : bool
297  {
299  }
+ Here is the caller graph for this function:

◆ load()

ilObjLTIConsumer::load ( )

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

References $DIC, $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().

357  : void
358  {
359  global $DIC;
360  /* @var \ILIAS\DI\Container $DIC */
361 
362  $query = "SELECT * FROM {$this->dbTableName()} WHERE obj_id = %s";
363  $res = $DIC->database()->queryF($query, ['integer'], [$this->getId()]);
364 
365  while ($row = $DIC->database()->fetchAssoc($res)) {
366  // if ($row['provider_id']) { //always set
367  $this->setProviderId((int) $row['provider_id']);
368  $this->setProvider(new ilLTIConsumeProvider((int) $row['provider_id']));
369  // }
370 
371  $this->setLaunchMethod($row['launch_method']);
372 
373  $this->setCustomLaunchKey((string) $row['launch_key']);
374  $this->setCustomLaunchSecret((string) $row['launch_secret']);
375  $this->setCustomParams((string) $row['custom_params']);
376 
377  $this->setUseXapi((bool) $row['use_xapi']);
378  $this->setCustomActivityId((string) $row['activity_id']);
379  $this->setStatementsReportEnabled((bool) $row['show_statements']);
380  $this->setHighscoreEnabled((bool) $row['highscore_enabled']);
381  $this->setHighscoreAchievedTS((bool) $row['highscore_achieved_ts']);
382  $this->setHighscorePercentage((bool) $row['highscore_percentage']);
383  $this->setHighscoreWTime((bool) $row['highscore_wtime']);
384  $this->setHighscoreOwnTable((bool) $row['highscore_own_table']);
385  $this->setHighscoreTopTable((bool) $row['highscore_top_table']);
386  $this->setHighscoreTopNum((int) $row['highscore_top_num']);
387 
388  $this->setMasteryScore((float) $row['mastery_score']);
389  }
390 
392  }
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)
setLaunchMethod(string $launchMethod)
setHighscoreOwnTable(bool $a_own_table)
Sets if the table with the own ranking should be shown.
global $DIC
Definition: shib_login.php:25
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 428 of file class.ilObjLTIConsumer.php.

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

Referenced by load().

428  : void
429  {
430  if ($this->ref_id > 0) {
431  $activation = ilObjectActivation::getItem($this->ref_id);
432  switch ($activation["timing_type"]) {
434  $this->setActivationLimited(true);
435  if (!is_null($activation["timing_start"])) {
436  $activation["timing_start"] = (int) $activation["timing_start"];
437  }
438  $this->setActivationStartingTime($activation["timing_start"]);
439  if (!is_null($activation["timing_end"])) {
440  $activation["timing_end"] = (int) $activation["timing_end"];
441  }
442  $this->setActivationEndingTime($activation["timing_end"]);
443  $this->setActivationVisibility((bool) $activation["visible"]);
444  break;
445 
446  default:
447  $this->setActivationLimited(false);
448  break;
449  }
450  }
451  }
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 1044 of file class.ilObjLTIConsumer.php.

References $privateKey, $typeId, and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

1050  : array {
1051  if (empty($typeId)) {
1052  $typeId = 0;
1053  }
1054  $messageTypeMapping = Util::MESSAGE_TYPE_MAPPING;
1055  if (isset($parms['lti_message_type']) && array_key_exists($parms['lti_message_type'], $messageTypeMapping)) {
1056  $parms['lti_message_type'] = $messageTypeMapping[$parms['lti_message_type']];
1057  }
1058  if (isset($parms['roles'])) {
1059  $roles = explode(',', $parms['roles']);
1060  $newRoles = array();
1061  foreach ($roles as $role) {
1062  if (strpos($role, 'urn:lti:role:ims/lis/') === 0) {
1063  $role = 'http://purl.imsglobal.org/vocab/lis/v2/membership#' . substr($role, 21);
1064  } elseif (strpos($role, 'urn:lti:instrole:ims/lis/') === 0) {
1065  $role = 'http://purl.imsglobal.org/vocab/lis/v2/institution/person#' . substr($role, 25);
1066  } elseif (strpos($role, 'urn:lti:sysrole:ims/lis/') === 0) {
1067  $role = 'http://purl.imsglobal.org/vocab/lis/v2/system/person#' . substr($role, 24);
1068  } elseif ((strpos($role, '://') === false) && (strpos($role, 'urn:') !== 0)) {
1069  $role = "http://purl.imsglobal.org/vocab/lis/v2/membership#{$role}";
1070  }
1071  $newRoles[] = $role;
1072  }
1073  $parms['roles'] = implode(',', $newRoles);
1074  }
1075  $now = time();
1076  if (empty($nonce)) {
1077  $nonce = bin2hex(openssl_random_pseudo_bytes(10));
1078  }
1079  $claimMapping = Util::JWT_CLAIM_MAPPING;
1080  $payLoad = array(
1081  'nonce' => $nonce,
1082  'iat' => $now,
1083  'exp' => $now + 60,
1084  );
1085  $payLoad['iss'] = self::getIliasHttpPath();
1086  $payLoad['aud'] = $oAuthConsumerKey;
1087  $payLoad[self::LTI_JWT_CLAIM_PREFIX . '/claim/deployment_id'] = strval($typeId);
1088  if (!empty($endpoint)) { // only for launch request
1089  $payLoad[self::LTI_JWT_CLAIM_PREFIX . '/claim/target_link_uri'] = $endpoint;
1090  }
1091 
1092  foreach ($parms as $key => $value) {
1093  $claim = self::LTI_JWT_CLAIM_PREFIX;
1094  if (array_key_exists($key, $claimMapping)) {
1095  $mapping = $claimMapping[$key];
1096 
1097  if (isset($mapping['isArray']) && $mapping['isArray']) {
1098  $value = explode(',', $value);
1099  sort($value);
1100  } elseif (isset($mapping['isBoolean'])) {
1101  $value = $mapping['isBoolean'];
1102  }
1103  if (!empty($mapping['suffix'])) {
1104  $claim .= "-{$mapping['suffix']}";
1105  }
1106  $claim .= '/claim/';
1107  if (is_null($mapping['group'])) {
1108  $payLoad[$mapping['claim']] = $value;
1109  } elseif (empty($mapping['group'])) {
1110  $payLoad["{$claim}{$mapping['claim']}"] = $value;
1111  } else {
1112  $claim .= $mapping['group'];
1113  $payLoad[$claim][$mapping['claim']] = $value;
1114  }
1115  } elseif (strpos($key, 'custom_') === 0) {
1116  $payLoad["{$claim}/claim/custom"][substr($key, 7)] = $value;
1117  } elseif (strpos($key, 'ext_') === 0) {
1118  $payLoad["{$claim}/claim/ext"][substr($key, 4)] = $value;
1119  }
1120  }
1121  //self::getLogger()->debug(json_encode($payLoad,JSON_PRETTY_PRINT));
1122  if (!empty(self::verifyPrivateKey())) {
1123  throw new DomainException(self::ERROR_OPEN_SSL_CONF);
1124  }
1125  $privateKey = self::getPrivateKey();
1126  $jwt = Firebase\JWT\JWT::encode($payLoad, $privateKey['key'], 'RS256', $privateKey['kid']);
1127  $newParms = array();
1128  $newParms['id_token'] = $jwt;
1129  return $newParms;
1130  }
sort()
description: > Example for rendering a Sort Glyph.
Definition: sort.php:25
$privateKey
Definition: ltiregstart.php:66
$typeId
Definition: ltiregstart.php:34
+ Here is the call graph for this function:

◆ registerClient()

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

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

References $data, $DIC, 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().

1316  : array
1317  {
1318  // first analyse tool_config and filter only accepted params
1319  // append client_id (required) and deployment_id(=provider_id in ILIAS) (optional) to tool_config response
1320  global $DIC;
1321  $reponseData = $data;
1323  $toolConfig = $data['https://purl.imsglobal.org/spec/lti-tool-configuration'];
1324  $provider->setTitle(strip_tags($data['client_name'], ilObjectGUI::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION));
1325  $provider->setProviderUrl($toolConfig['target_link_uri']);
1326  $provider->setInitiateLogin($data['initiate_login_uri']);
1327  $provider->setRedirectionUris(implode(",", $data['redirect_uris']));
1328  if (isset($data['jwks_uri'])) {
1329  $provider->setPublicKeyset($data['jwks_uri']);
1330  }
1331  foreach ($toolConfig['messages'] as $message) {
1332  if (isset($message['type']) && $message['type'] === 'LtiDeepLinkingRequest') {
1333  $provider->setContentItemUrl($message['target_link_uri']);
1334  }
1335  }
1336  /*
1337  if (isset($data['logo_uri'])) { // needs to be uploaded and then assign filepath
1338  $provider->setProviderIconFilename($data['logo_uri']);
1339  }
1340  */
1341  $provider->setKeyType('JWK_KEYSET');
1342  $provider->setLtiVersion('1.3.0');
1343  $provider->setClientId((string) $tokenObj->aud); //client_id
1344  $provider->setCreator((int) $tokenObj->sub); // user_id
1346  $provider->setIsGlobal(false);
1347  $provider->insert();
1348  $reponseData['client_id'] = $tokenObj->aud;
1349  $reponseData['https://purl.imsglobal.org/spec/lti-tool-configuration']['deployment_id'] = $provider->getId();
1350  return $reponseData;
1351  }
setInitiateLogin(string $initiate_login)
setPublicKeyset(string $public_keyset)
setContentItemUrl(string $content_item_url)
setRedirectionUris(string $redirection_uris)
global $DIC
Definition: shib_login.php:25
ilLTIConsumeProvider $provider
setLtiVersion(string $lti_version)
setProviderUrl(string $provider_url)
+ Here is the call graph for this function:

◆ save()

ilObjLTIConsumer::save ( )

Definition at line 399 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().

399  : void
400  {
401  global $DIC;
402  /* @var \ILIAS\DI\Container $DIC */
403 
404  $DIC->database()->replace($this->dbTableName(), [
405  'obj_id' => ['integer', $this->getId()]
406  ], [
407  'provider_id' => ['integer', $this->getProviderId()],
408  'launch_method' => ['text', $this->getLaunchMethod()],
409  'launch_key' => ['text', $this->getCustomLaunchKey()],
410  'launch_secret' => ['text', $this->getCustomLaunchSecret()],
411  'custom_params' => ['text', $this->getCustomParams()],
412  'use_xapi' => ['integer', $this->getUseXapi()],
413  'activity_id' => ['text', $this->getCustomActivityId()],
414  'show_statements' => ['integer', $this->isStatementsReportEnabled()],
415  'highscore_enabled' => ['integer', (int) $this->getHighscoreEnabled()],
416  'highscore_achieved_ts' => ['integer', (int) $this->getHighscoreAchievedTS()],
417  'highscore_percentage' => ['integer', (int) $this->getHighscorePercentage()],
418  'highscore_wtime' => ['integer', (int) $this->getHighscoreWTime()],
419  'highscore_own_table' => ['integer', (int) $this->getHighscoreOwnTable()],
420  'highscore_top_table' => ['integer', (int) $this->getHighscoreTopTable()],
421  'highscore_top_num' => ['integer', $this->getHighscoreTopNum()],
422  'mastery_score' => ['float', $this->getMasteryScore()]
423  ]);
424 
426  }
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.
getHighscoreTopNum(int $a_retval=10)
Gets the number of entries which are to be shown in the top-rankings table.
global $DIC
Definition: shib_login.php:25
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 453 of file class.ilObjLTIConsumer.php.

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

Referenced by save().

453  : void
454  {
455  if ($this->ref_id > 0) {
456  ilObjectActivation::getItem($this->ref_id);
457 
458  $item = new ilObjectActivation();
459  if (!$this->isActivationLimited()) {
460  $item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);
461  } else {
462  $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
463  $item->setTimingStart($this->getActivationStartingTime());
464  $item->setTimingEnd($this->getActivationEndingTime());
465  $item->toggleVisible($this->getActivationVisibility());
466  }
467 
468  $item->update($this->ref_id);
469  }
470  }
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 1358 of file class.ilObjLTIConsumer.php.

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

Referenced by invalidRequest(), and serverError().

1358  : void
1359  {
1360  global $DIC;
1361  try {
1362  if ($log) {
1363  self::getLogger()->error("$code $message");
1364  }
1365  $DIC->http()->saveResponse(
1366  $DIC->http()->response()
1367  ->withStatus($code)
1368  ->withBody(Streams::ofString($message))
1369  );
1370  $DIC->http()->sendResponse();
1371  $DIC->http()->close();
1372  } catch (Exception $e) {
1373  $DIC->http()->close();
1374  }
1375  }
global $DIC
Definition: shib_login.php:25
ilLogger $log
+ Here is the caller graph for this function:

◆ sendResponseJson()

static ilObjLTIConsumer::sendResponseJson ( array  $obj)
static

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

References $DIC, Vendor\Package\$e, and ILIAS\UI\examples\Symbol\Glyph\Header\header().

Referenced by sendAccessToken().

1377  : void
1378  {
1379  global $DIC;
1380  try {
1381  header('Content-Type: application/json; charset=utf-8');
1382  header('Cache-Control: no-store');
1383  header('Pragma: no-cache');
1384  echo json_encode($obj, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
1385  } catch (Exception $e) {
1386  self::sendResponseError(500, "error in sendResponseJson");
1387  $DIC->http()->close();
1388  }
1389  }
global $DIC
Definition: shib_login.php:25
header()
expected output: > ILIAS shows the rendered Component.
Definition: header.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivationEndingTime()

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

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

References $activationEndingTime.

Referenced by loadRepositoryActivationSettings().

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

◆ setActivationLimited()

ilObjLTIConsumer::setActivationLimited ( bool  $activationLimited)

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

References $activationLimited.

Referenced by loadRepositoryActivationSettings().

119  : void
120  {
121  $this->activationLimited = $activationLimited;
122  }
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 129 of file class.ilObjLTIConsumer.php.

References $activationStartingTime.

Referenced by loadRepositoryActivationSettings().

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

◆ setActivationVisibility()

ilObjLTIConsumer::setActivationVisibility ( bool  $activationVisibility)

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

References $activationVisibility.

Referenced by loadRepositoryActivationSettings().

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

◆ setCustomActivityId()

ilObjLTIConsumer::setCustomActivityId ( string  $custom_activity_id)

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

References $custom_activity_id.

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

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

◆ setCustomLaunchKey()

ilObjLTIConsumer::setCustomLaunchKey ( string  $customLaunchKey)

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

References $customLaunchKey.

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

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

◆ setCustomLaunchSecret()

ilObjLTIConsumer::setCustomLaunchSecret ( string  $customLaunchSecret)

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

References $customLaunchSecret.

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

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

◆ setCustomParams()

ilObjLTIConsumer::setCustomParams ( string  $customParams)

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

References $customParams.

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

244  : void
245  {
246  $this->customParams = $customParams;
247  }
+ 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 501 of file class.ilObjLTIConsumer.php.

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

501  : void
502  {
503  $this->_highscore_achieved_ts = $a_achieved_ts;
504  }
+ 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 483 of file class.ilObjLTIConsumer.php.

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

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

◆ setHighscoreMode()

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

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

References setHighscoreOwnTable(), and setHighscoreTopTable().

Referenced by ilLTIConsumerSettingsFormGUI\initObject().

637  : void
638  {
639  switch ($mode) {
640  case self::HIGHSCORE_SHOW_ALL_TABLES:
641  $this->setHighscoreTopTable(true);
642  $this->setHighscoreOwnTable(true);
643  break;
644 
645  case self::HIGHSCORE_SHOW_TOP_TABLE:
646  $this->setHighscoreTopTable(true);
647  $this->setHighscoreOwnTable(false);
648  break;
649 
650  case self::HIGHSCORE_SHOW_OWN_TABLE:
651  default:
652  $this->setHighscoreTopTable(false);
653  $this->setHighscoreOwnTable(true);
654  break;
655  }
656  }
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 557 of file class.ilObjLTIConsumer.php.

Referenced by load(), and setHighscoreMode().

557  : void
558  {
559  $this->_highscore_own_table = $a_own_table;
560  }
+ 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 519 of file class.ilObjLTIConsumer.php.

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

519  : void
520  {
521  $this->_highscore_percentage = $a_percentage;
522  }
+ 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 596 of file class.ilObjLTIConsumer.php.

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

596  : void
597  {
598  $this->_highscore_top_num = $a_top_num;
599  }
+ 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 575 of file class.ilObjLTIConsumer.php.

Referenced by load(), and setHighscoreMode().

575  : void
576  {
577  $this->_highscore_top_table = $a_top_table;
578  }
+ 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 537 of file class.ilObjLTIConsumer.php.

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

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

◆ setLaunchMethod()

ilObjLTIConsumer::setLaunchMethod ( string  $launchMethod)

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

References $launchMethod.

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

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

◆ setMasteryScore()

ilObjLTIConsumer::setMasteryScore ( float  $mastery_score)

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

References $mastery_score.

Referenced by load().

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

◆ setMasteryScorePercent()

ilObjLTIConsumer::setMasteryScorePercent ( float  $mastery_score_percent)

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

Referenced by ilLTIConsumerSettingsFormGUI\initObject().

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

◆ setProvider()

ilObjLTIConsumer::setProvider ( ilLTIConsumeProvider  $provider)

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

References $provider.

Referenced by load().

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

◆ setProviderId()

ilObjLTIConsumer::setProviderId ( int  $providerId)

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

References $providerId.

Referenced by load().

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

◆ setStatementsReportEnabled()

ilObjLTIConsumer::setStatementsReportEnabled ( bool  $statementsReportEnabled)

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

References $statementsReportEnabled.

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

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

◆ setUseXapi()

ilObjLTIConsumer::setUseXapi ( bool  $use_xapi)

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

References $use_xapi.

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

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

◆ verifyPrivateKey()

static ilObjLTIConsumer::verifyPrivateKey ( )
static

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

References $ilSetting, and $res.

1147  : string
1148  {
1149  global $ilSetting;
1150  $key = $ilSetting->get(self::LTI_1_3_PRIVATE_KEY);
1151 
1152  if (empty($key)) {
1153  $kid = bin2hex(openssl_random_pseudo_bytes(10));
1154  $ilSetting->set(self::LTI_1_3_KID, $kid);
1155  $config = array(
1156  "digest_alg" => "sha256",
1157  "private_key_bits" => 2048,
1158  "private_key_type" => self::OPENSSL_KEYTYPE_RSA
1159  );
1160  $res = openssl_pkey_new($config);
1161  openssl_pkey_export($res, $privatekey);
1162  if (!empty($privatekey)) {
1163  $ilSetting->set(self::LTI_1_3_PRIVATE_KEY, $privatekey);
1164  } else {
1165  return self::ERROR_OPEN_SSL_CONF;
1166  }
1167  }
1168  return '';
1169  }
$res
Definition: ltiservices.php:69
global $ilSetting
Definition: privfeed.php:32

◆ verifyToken()

static ilObjLTIConsumer::verifyToken ( )
static

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

References $DIC, and $token.

Referenced by ilLTIConsumerServiceBase\checkTool().

1416  : ?object
1417  {
1418  global $DIC;
1419  $auth = $DIC->http()->request()->getHeader("Authorization");
1420  if (count($auth) < 1) {
1421  self::sendResponseError(405, "missing Authorization header");
1422  }
1423  preg_match('/Bearer\s+(.+)$/i', $auth[0], $matches);
1424  if (count($matches) != 2) {
1425  self::sendResponseError(405, "missing required Authorization Baerer token");
1426  }
1427  $token = $matches[1];
1428  return self::getTokenObject($token);
1429  }
$token
Definition: xapitoken.php:67
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

Field Documentation

◆ $_highscore_achieved_ts

bool ilObjLTIConsumer::$_highscore_achieved_ts = true
protected

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

Referenced by getHighscoreAchievedTS().

◆ $_highscore_enabled

bool ilObjLTIConsumer::$_highscore_enabled = false
protected

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

Referenced by getHighscoreEnabled().

◆ $_highscore_own_table

bool ilObjLTIConsumer::$_highscore_own_table = true
protected

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

Referenced by getHighscoreOwnTable().

◆ $_highscore_percentage

bool ilObjLTIConsumer::$_highscore_percentage = true
protected

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

Referenced by getHighscorePercentage().

◆ $_highscore_top_num

int ilObjLTIConsumer::$_highscore_top_num = 10
protected

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

Referenced by getHighscoreTopNum().

◆ $_highscore_top_table

bool ilObjLTIConsumer::$_highscore_top_table = true
protected

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

Referenced by getHighscoreTopTable().

◆ $_highscore_wtime

bool ilObjLTIConsumer::$_highscore_wtime = true
protected

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

Referenced by getHighscoreWTime().

◆ $activationEndingTime

int ilObjLTIConsumer::$activationEndingTime = null
protected

Definition at line 44 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 42 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 45 of file class.ilObjLTIConsumer.php.

Referenced by getActivationVisibility(), and setActivationVisibility().

◆ $anonymity

int ilObjLTIConsumer::$anonymity = 0
protected

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

◆ $custom_activity_id

string ilObjLTIConsumer::$custom_activity_id = ''
protected

◆ $customLaunchKey

string ilObjLTIConsumer::$customLaunchKey = ''
protected

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

Referenced by getCustomLaunchKey(), and setCustomLaunchKey().

◆ $customLaunchSecret

string ilObjLTIConsumer::$customLaunchSecret = ''
protected

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

Referenced by getCustomLaunchSecret(), and setCustomLaunchSecret().

◆ $customParams

string ilObjLTIConsumer::$customParams = ''
protected

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

Referenced by getCustomParams(), and setCustomParams().

◆ $launchMethod

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

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

Referenced by getLaunchMethod(), and setLaunchMethod().

◆ $mastery_score

float ilObjLTIConsumer::$mastery_score = 0.5
protected

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

Referenced by getMasteryScore(), and setMasteryScore().

◆ $provider

ilLTIConsumeProvider ilObjLTIConsumer::$provider = null
protected

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

Referenced by getProvider(), and setProvider().

◆ $providerId

int ilObjLTIConsumer::$providerId = 0
protected

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

Referenced by getProviderId(), and setProviderId().

◆ $ref_id

int ilObjLTIConsumer::$ref_id = 0
protected

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

◆ $statementsReportEnabled

bool ilObjLTIConsumer::$statementsReportEnabled = false
protected

◆ $use_xapi

bool ilObjLTIConsumer::$use_xapi = false
protected

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

Referenced by getUseXapi(), and setUseXapi().

◆ DB_TABLE_NAME

const ilObjLTIConsumer::DB_TABLE_NAME = 'lti_consumer_settings'

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

◆ ERROR_OPEN_SSL_CONF

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

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

◆ HIGHSCORE_SHOW_ALL_TABLES

const ilObjLTIConsumer::HIGHSCORE_SHOW_ALL_TABLES = 1

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

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ HIGHSCORE_SHOW_OWN_TABLE

const ilObjLTIConsumer::HIGHSCORE_SHOW_OWN_TABLE = 3

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

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ HIGHSCORE_SHOW_TOP_TABLE

const ilObjLTIConsumer::HIGHSCORE_SHOW_TOP_TABLE = 2

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

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LAUNCH_METHOD_EMBEDDED

const ilObjLTIConsumer::LAUNCH_METHOD_EMBEDDED = 'embedded'

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

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LAUNCH_METHOD_NEW_WIN

const ilObjLTIConsumer::LAUNCH_METHOD_NEW_WIN = 'newWin'

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

Referenced by ilLTIConsumerSettingsFormGUI\initForm().

◆ LAUNCH_METHOD_OWN_WIN

const ilObjLTIConsumer::LAUNCH_METHOD_OWN_WIN = 'ownWin'

Definition at line 51 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 93 of file class.ilObjLTIConsumer.php.

◆ LTI_1_3_PRIVATE_KEY

const ilObjLTIConsumer::LTI_1_3_PRIVATE_KEY = 'lti_1_3_privatekey'

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

◆ LTI_JWT_CLAIM_PREFIX

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

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

◆ OPENSSL_KEYTYPE_RSA

const ilObjLTIConsumer::OPENSSL_KEYTYPE_RSA = ''

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

◆ REG_TOKEN_OP_NEW_REG

const ilObjLTIConsumer::REG_TOKEN_OP_NEW_REG = 'reg'

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

◆ REG_TOKEN_OP_UPDATE_REG

const ilObjLTIConsumer::REG_TOKEN_OP_UPDATE_REG = 'reg-update'

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


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