Permalink
Browse files

Only consider configured tools when receiving LTI web service calls

  • Loading branch information...
1 parent 558be8f commit feb30fd8911415a5797d691017533ec00800a287 @scriby scriby committed Oct 12, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 mod/lti/locallib.php
@@ -657,19 +657,21 @@ function lti_get_shared_secrets_by_key($key){
SELECT t2.value
FROM {lti_types_config} t1
INNER JOIN {lti_types_config} t2 ON t1.typeid = t2.typeid
+ INNER JOIN {lti_types} type ON t2.typeid = type.id
WHERE
t1.name = 'resourcekey'
AND t1.value = :key1
AND t2.name = 'password'
-
+ AND type.state = :configured
+
UNION
SELECT password AS value
FROM {lti}
WHERE resourcekey = :key2
QUERY;
- $sharedsecrets = $DB->get_records_sql($query, array('key1' => $key, 'key2' => $key));
+ $sharedsecrets = $DB->get_records_sql($query, array('configured' => LTI_TOOL_STATE_CONFIGURED, 'key1' => $key, 'key2' => $key));
$values = array_map(function($item){
return $item->value;

0 comments on commit feb30fd

Please sign in to comment.