ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Class to represent a tool consumer. More...
Public Member Functions | |
__construct ($key=null, $dataConnector=null, $autoEnable=false) | |
Class constructor. More... | |
initialize () | |
Initialise the tool consumer. More... | |
initialise () | |
Initialise the tool consumer. More... | |
save () | |
Save the tool consumer to the database. More... | |
delete () | |
Delete the tool consumer from the database. More... | |
getRecordId () | |
Get the tool consumer record ID. More... | |
setRecordId ($id) | |
Sets the tool consumer record ID. More... | |
getKey () | |
Get the tool consumer key. More... | |
setKey ($key) | |
Set the tool consumer key. More... | |
getDataConnector () | |
Get the data connector. More... | |
getIsAvailable () | |
Is the consumer key available to accept launch requests? More... | |
getSetting ($name, $default='') | |
Get a setting value. More... | |
setSetting ($name, $value=null) | |
Set a setting value. More... | |
getSettings () | |
Get an array of all setting values. More... | |
setSettings ($settings) | |
Set an array of all setting values. More... | |
saveSettings () | |
Save setting values. More... | |
hasToolSettingsService () | |
Check if the Tool Settings service is supported. More... | |
getToolSettings ($simple=true) | |
Get Tool Settings. More... | |
setToolSettings ($settings=array()) | |
Perform a Tool Settings service request. More... | |
signParameters ($url, $type, $version, $params) | |
Add the OAuth signature to an LTI message. More... | |
doServiceRequest ($service, $method, $format, $data) | |
Perform a service request. More... | |
Static Public Member Functions | |
static | addSignature ($endpoint, $consumerKey, $consumerSecret, $data, $method='POST', $type=null) |
Add the OAuth signature to an array of message parameters or to a header string. More... | |
static | fromRecordId ($id, $dataConnector) |
Load the tool consumer from the database by its record ID. More... | |
Data Fields | |
$name = null | |
Local name of tool consumer. More... | |
$secret = null | |
Shared secret. More... | |
$ltiVersion = null | |
LTI version (as reported by last tool consumer connection). More... | |
$consumerName = null | |
Name of tool consumer (as reported by last tool consumer connection). More... | |
$consumerVersion = null | |
Tool consumer version (as reported by last tool consumer connection). More... | |
$consumerGuid = null | |
Tool consumer GUID (as reported by first tool consumer connection). More... | |
$cssPath = null | |
Optional CSS path (as reported by last tool consumer connection). More... | |
$protected = false | |
Whether the tool consumer instance is protected by matching the consumer_guid value in incoming requests. More... | |
$enabled = false | |
Whether the tool consumer instance is enabled to accept incoming connection requests. More... | |
$enableFrom = null | |
Date/time from which the the tool consumer instance is enabled to accept incoming connection requests. More... | |
$enableUntil = null | |
Date/time until which the tool consumer instance is enabled to accept incoming connection requests. More... | |
$lastAccess = null | |
Date of last connection from this tool consumer. More... | |
$idScope = ToolProvider::ID_SCOPE_ID_ONLY | |
Default scope to use when generating an Id value for a user. More... | |
$defaultEmail = '' | |
Default email address (or email domain) to use when no email address is provided for a user. More... | |
$settings = null | |
Setting values (LTI parameters, custom parameters and local parameters). More... | |
$created = null | |
Date/time when the object was created. More... | |
$updated = null | |
Date/time when the object was last updated. More... | |
Private Member Functions | |
load ($key, $autoEnable=false) | |
Load the tool consumer from the database. More... | |
Private Attributes | |
$id = null | |
Consumer ID value. More... | |
$key = null | |
Consumer key value. More... | |
$settingsChanged = false | |
Whether the settings value have changed since last saved. More... | |
$dataConnector = null | |
Data connector object or string. More... | |
Class to represent a tool consumer.
Definition at line 19 of file ToolConsumer.php.
IMSGlobal\LTI\ToolProvider\ToolConsumer::__construct | ( | $key = null , |
|
$dataConnector = null , |
|||
$autoEnable = false |
|||
) |
Class constructor.
string | $key | Consumer key |
DataConnector | $dataConnector | A data connector object |
boolean | $autoEnable | true if the tool consumers is to be enabled automatically (optional, default is false) |
Definition at line 157 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$dataConnector, IMSGlobal\LTI\ToolProvider\ToolConsumer\$key, IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector\getDataConnector(), IMSGlobal\LTI\ToolProvider\DataConnector\DataConnector\getRandomString(), IMSGlobal\LTI\ToolProvider\ToolConsumer\initialize(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\load().
|
static |
Add the OAuth signature to an array of message parameters or to a header string.
Definition at line 513 of file ToolConsumer.php.
References $data, $endpoint, $header, IMSGlobal\LTI\ToolProvider\ToolConsumer\$name, PHPMailer\PHPMailer\$params, $type, and IMSGlobal\LTI\OAuth\OAuthRequest\from_consumer_and_token().
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\doServiceRequest(), and IMSGlobal\LTI\ToolProvider\Service\Service\send().
IMSGlobal\LTI\ToolProvider\ToolConsumer::delete | ( | ) |
Delete the tool consumer from the database.
Definition at line 236 of file ToolConsumer.php.
IMSGlobal\LTI\ToolProvider\ToolConsumer::doServiceRequest | ( | $service, | |
$method, | |||
$format, | |||
$data | |||
) |
Perform a service request.
object | $service | Service object to be executed |
string | $method | HTTP action |
string | $format | Media type |
mixed | $data | Array of parameters or body string |
Definition at line 580 of file ToolConsumer.php.
References $data, $format, $header, $http, IMSGlobal\LTI\ToolProvider\ToolConsumer\$secret, and IMSGlobal\LTI\ToolProvider\ToolConsumer\addSignature().
|
static |
Load the tool consumer from the database by its record ID.
string | $id | The consumer key record ID |
DataConnector | $dataConnector | Database connection object |
Definition at line 605 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$dataConnector, and IMSGlobal\LTI\ToolProvider\ToolConsumer\$id.
Referenced by IMSGlobal\LTI\ToolProvider\ToolProxy\getConsumer(), IMSGlobal\LTI\ToolProvider\Context\getConsumer(), and IMSGlobal\LTI\ToolProvider\ResourceLink\getConsumer().
IMSGlobal\LTI\ToolProvider\ToolConsumer::getDataConnector | ( | ) |
Get the data connector.
Definition at line 296 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$dataConnector.
IMSGlobal\LTI\ToolProvider\ToolConsumer::getIsAvailable | ( | ) |
Is the consumer key available to accept launch requests?
Definition at line 308 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$enabled, and $ok.
IMSGlobal\LTI\ToolProvider\ToolConsumer::getKey | ( | ) |
Get the tool consumer key.
Definition at line 272 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$key.
Referenced by ilLTIDataConnector\loadToolConsumerILIAS(), ilLTIDataConnector\saveToolConsumerILIAS(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\signParameters().
IMSGlobal\LTI\ToolProvider\ToolConsumer::getRecordId | ( | ) |
Get the tool consumer record ID.
Definition at line 248 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$id.
Referenced by ilLTIToolConsumer\getId(), ilLTIDataConnector\loadToolConsumerILIAS(), and ilLTIDataConnector\saveToolConsumerILIAS().
IMSGlobal\LTI\ToolProvider\ToolConsumer::getSetting | ( | $name, | |
$default = '' |
|||
) |
Get a setting value.
string | $name | Name of setting |
string | $default | Value to return if the setting does not exist (optional, default is an empty string) |
Definition at line 333 of file ToolConsumer.php.
References $default, IMSGlobal\LTI\ToolProvider\ToolConsumer\$name, and settings().
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\getToolSettings(), IMSGlobal\LTI\ToolProvider\ToolConsumer\hasToolSettingsService(), IMSGlobal\LTI\ToolProvider\ToolConsumer\setSetting(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\setToolSettings().
IMSGlobal\LTI\ToolProvider\ToolConsumer::getSettings | ( | ) |
Get an array of all setting values.
Definition at line 372 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$settings.
Referenced by ilLTIDataConnector\saveToolConsumerILIAS().
IMSGlobal\LTI\ToolProvider\ToolConsumer::getToolSettings | ( | $simple = true | ) |
Get Tool Settings.
boolean | $simple | True if all the simple media type is to be used (optional, default is true) |
Definition at line 430 of file ToolConsumer.php.
References $response, $url, and IMSGlobal\LTI\ToolProvider\ToolConsumer\getSetting().
IMSGlobal\LTI\ToolProvider\ToolConsumer::hasToolSettingsService | ( | ) |
Check if the Tool Settings service is supported.
Definition at line 414 of file ToolConsumer.php.
References $url, and IMSGlobal\LTI\ToolProvider\ToolConsumer\getSetting().
IMSGlobal\LTI\ToolProvider\ToolConsumer::initialise | ( | ) |
Initialise the tool consumer.
Pseudonym for initialize().
Definition at line 207 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\initialize().
IMSGlobal\LTI\ToolProvider\ToolConsumer::initialize | ( | ) |
Initialise the tool consumer.
Definition at line 176 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolProvider\ID_SCOPE_ID_ONLY, and settings().
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\__construct(), ilLTIDataConnector\deleteGlobalToolConsumerSettings(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\initialise().
|
private |
Load the tool consumer from the database.
string | $key | The consumer key value |
boolean | $autoEnable | True if the consumer should be enabled (optional, default if false) |
Definition at line 633 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$key, and $ok.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\__construct().
IMSGlobal\LTI\ToolProvider\ToolConsumer::save | ( | ) |
Save the tool consumer to the database.
Definition at line 219 of file ToolConsumer.php.
References $ok.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\saveSettings().
IMSGlobal\LTI\ToolProvider\ToolConsumer::saveSettings | ( | ) |
Save setting values.
Definition at line 396 of file ToolConsumer.php.
References $ok, and IMSGlobal\LTI\ToolProvider\ToolConsumer\save().
IMSGlobal\LTI\ToolProvider\ToolConsumer::setKey | ( | $key | ) |
Set the tool consumer key.
string | $key | Consumer key value |
Definition at line 284 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$key.
IMSGlobal\LTI\ToolProvider\ToolConsumer::setRecordId | ( | $id | ) |
Sets the tool consumer record ID.
int | $id | Consumer record ID value |
Definition at line 260 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$id.
Referenced by ilLTIDataConnector\loadToolConsumerILIAS(), and ilLTIDataConnector\saveToolConsumerILIAS().
IMSGlobal\LTI\ToolProvider\ToolConsumer::setSetting | ( | $name, | |
$value = null |
|||
) |
Set a setting value.
string | $name | Name of setting |
string | $value | Value to set, use an empty value to delete a setting (optional, default is null) |
Definition at line 352 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$name, IMSGlobal\LTI\ToolProvider\ToolConsumer\getSetting(), and settings().
IMSGlobal\LTI\ToolProvider\ToolConsumer::setSettings | ( | $settings | ) |
Set an array of all setting values.
array | $settings | Associative array of setting values |
Definition at line 384 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$settings, and settings().
Referenced by ilLTIDataConnector\loadToolConsumerILIAS().
IMSGlobal\LTI\ToolProvider\ToolConsumer::setToolSettings | ( | $settings = array() | ) |
Perform a Tool Settings service request.
array | $settings | An associative array of settings (optional, default is none) |
Definition at line 448 of file ToolConsumer.php.
References $response, IMSGlobal\LTI\ToolProvider\ToolConsumer\$settings, $url, and IMSGlobal\LTI\ToolProvider\ToolConsumer\getSetting().
IMSGlobal\LTI\ToolProvider\ToolConsumer::signParameters | ( | $url, | |
$type, | |||
$version, | |||
$params | |||
) |
Add the OAuth signature to an LTI message.
string | $url | URL for message request |
string | $type | LTI message type |
string | $version | LTI version |
array | $params | Message parameters |
Definition at line 469 of file ToolConsumer.php.
References IMSGlobal\LTI\ToolProvider\ToolConsumer\$name, PHPMailer\PHPMailer\$params, $req, $type, $url, $version, IMSGlobal\LTI\OAuth\OAuthRequest\from_consumer_and_token(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\getKey().
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$consumerGuid = null |
Tool consumer GUID (as reported by first tool consumer connection).
Definition at line 57 of file ToolConsumer.php.
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$consumerName = null |
Name of tool consumer (as reported by last tool consumer connection).
Definition at line 45 of file ToolConsumer.php.
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$consumerVersion = null |
Tool consumer version (as reported by last tool consumer connection).
Definition at line 51 of file ToolConsumer.php.
int IMSGlobal\LTI\ToolProvider\ToolConsumer::$created = null |
Date/time when the object was created.
Definition at line 117 of file ToolConsumer.php.
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$cssPath = null |
Optional CSS path (as reported by last tool consumer connection).
Definition at line 63 of file ToolConsumer.php.
|
private |
Data connector object or string.
Definition at line 148 of file ToolConsumer.php.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\__construct(), ilLTIToolConsumer\fromExternalConsumerId(), ilLTIToolConsumer\fromRecordId(), IMSGlobal\LTI\ToolProvider\ToolConsumer\fromRecordId(), IMSGlobal\LTI\ToolProvider\ToolConsumer\getDataConnector(), and ilLTIToolConsumer\saveLTI().
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$defaultEmail = '' |
Default email address (or email domain) to use when no email address is provided for a user.
Definition at line 105 of file ToolConsumer.php.
boolean IMSGlobal\LTI\ToolProvider\ToolConsumer::$enabled = false |
Whether the tool consumer instance is enabled to accept incoming connection requests.
Definition at line 75 of file ToolConsumer.php.
Referenced by ilLTIToolConsumer\getEnabled(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\getIsAvailable().
int IMSGlobal\LTI\ToolProvider\ToolConsumer::$enableFrom = null |
Date/time from which the the tool consumer instance is enabled to accept incoming connection requests.
Definition at line 81 of file ToolConsumer.php.
int IMSGlobal\LTI\ToolProvider\ToolConsumer::$enableUntil = null |
Date/time until which the tool consumer instance is enabled to accept incoming connection requests.
Definition at line 87 of file ToolConsumer.php.
|
private |
Consumer ID value.
Definition at line 130 of file ToolConsumer.php.
Referenced by ilLTIToolConsumer\fromExternalConsumerId(), ilLTIToolConsumer\fromRecordId(), IMSGlobal\LTI\ToolProvider\ToolConsumer\fromRecordId(), IMSGlobal\LTI\ToolProvider\ToolConsumer\getRecordId(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\setRecordId().
int IMSGlobal\LTI\ToolProvider\ToolConsumer::$idScope = ToolProvider::ID_SCOPE_ID_ONLY |
Default scope to use when generating an Id value for a user.
Definition at line 99 of file ToolConsumer.php.
|
private |
Consumer key value.
Definition at line 136 of file ToolConsumer.php.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\__construct(), IMSGlobal\LTI\ToolProvider\ToolConsumer\getKey(), IMSGlobal\LTI\ToolProvider\ToolConsumer\load(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\setKey().
int IMSGlobal\LTI\ToolProvider\ToolConsumer::$lastAccess = null |
Date of last connection from this tool consumer.
Definition at line 93 of file ToolConsumer.php.
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$ltiVersion = null |
LTI version (as reported by last tool consumer connection).
Definition at line 39 of file ToolConsumer.php.
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$name = null |
Local name of tool consumer.
Definition at line 27 of file ToolConsumer.php.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\addSignature(), IMSGlobal\LTI\ToolProvider\ToolConsumer\getSetting(), IMSGlobal\LTI\ToolProvider\ToolConsumer\setSetting(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\signParameters().
boolean IMSGlobal\LTI\ToolProvider\ToolConsumer::$protected = false |
Whether the tool consumer instance is protected by matching the consumer_guid value in incoming requests.
Definition at line 69 of file ToolConsumer.php.
string IMSGlobal\LTI\ToolProvider\ToolConsumer::$secret = null |
Shared secret.
Definition at line 33 of file ToolConsumer.php.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\doServiceRequest(), ilLTIToolConsumer\getSecret(), and ilLTIToolConsumer\setSecret().
array IMSGlobal\LTI\ToolProvider\ToolConsumer::$settings = null |
Setting values (LTI parameters, custom parameters and local parameters).
Definition at line 111 of file ToolConsumer.php.
Referenced by IMSGlobal\LTI\ToolProvider\ToolConsumer\getSettings(), IMSGlobal\LTI\ToolProvider\ToolConsumer\setSettings(), and IMSGlobal\LTI\ToolProvider\ToolConsumer\setToolSettings().
|
private |
Whether the settings value have changed since last saved.
Definition at line 142 of file ToolConsumer.php.
int IMSGlobal\LTI\ToolProvider\ToolConsumer::$updated = null |
Date/time when the object was last updated.
Definition at line 123 of file ToolConsumer.php.