Skip to content

Commit

Permalink
MDL-62384 privacy: Modify user contexts query for auth_oauth2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski authored and andrewnicols committed May 11, 2018
1 parent 38e6852 commit b1add54
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions auth/oauth2/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ public static function get_metadata(collection $collection) : collection {
public static function get_contexts_for_userid(int $userid) : contextlist {
$sql = "SELECT ctx.id
FROM {auth_oauth2_linked_login} ao
JOIN {user} u ON ao.userid = u.id
JOIN {context} ctx ON ctx.instanceid = u.id AND ctx.contextlevel = :contextlevel
JOIN {context} ctx ON ctx.instanceid = ao.userid AND ctx.contextlevel = :contextlevel
WHERE ao.userid = :userid";
$params = ['userid' => $userid, 'contextlevel' => CONTEXT_USER];
$contextlist = new contextlist();
Expand Down

0 comments on commit b1add54

Please sign in to comment.