Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

If no launch URL is specified, launch to the base URL of the tool.

  • Loading branch information...
commit f17f49595c71bc74c49e9028e3bfa1fe565539a5 1 parent 67ddf84
@scriby scriby authored
Showing with 20 additions and 2 deletions.
  1. +20 −2 mod/lti/locallib.php
View
22 mod/lti/locallib.php
@@ -115,6 +115,10 @@ function lti_view($instance) {
$orgdesc = $typeconfig['organizationdescr'];
*/
+ if(!strstr($endpoint, '://')){
+ $endpoint = 'http://' . $endpoint;
+ }
+
$course = $PAGE->course;
$requestparams = lti_build_request($instance, $typeconfig, $course);
@@ -419,13 +423,27 @@ function lti_get_ims_role($user, $context) {
function lti_get_type_config($typeid) {
global $DB;
+ $query = <<<QUERY
+ SELECT name, value
+ FROM {lti_types_config}
+ WHERE typeid = :typeid1
+
+ UNION ALL
+
+ SELECT 'toolurl' AS name, baseurl AS value
+ FROM {lti_types}
+ WHERE id = :typeid2
+QUERY;
+
$typeconfig = array();
- $configs = $DB->get_records('lti_types_config', array('typeid' => $typeid));
+ $configs = $DB->get_records_sql($query, array('typeid1' => $typeid, 'typeid2' => $typeid));
+
if (!empty($configs)) {
foreach ($configs as $config) {
$typeconfig[$config->name] = $config->value;
}
}
+
return $typeconfig;
}
@@ -913,7 +931,7 @@ function lti_sign_parameters($oldparms, $endpoint, $method, $oauthconsumerkey, $
$parms["ext_submit"] = $submittext;
$testtoken = '';
-
+
$hmacmethod = new lti\OAuthSignatureMethod_HMAC_SHA1();
$testconsumer = new lti\OAuthConsumer($oauthconsumerkey, $oauthconsumersecret, null);
Please sign in to comment.
Something went wrong with that request. Please try again.