Skip to content

Commit

Permalink
MDL-63785 auth_mnet: performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Dec 10, 2018
1 parent 28dfbe7 commit a246822
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions auth/mnet/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,10 @@ public static function get_users_in_context(userlist $userlist) {
return;
}

$params = [
'contextuser' => CONTEXT_USER,
'contextid' => $context->id
];

$sql = "SELECT ctx.instanceid as userid
FROM {mnet_log} ml
JOIN {context} ctx
ON ctx.instanceid = ml.userid
AND ctx.contextlevel = :contextuser
WHERE ctx.id = :contextid";

$sql = "SELECT userid
FROM {mnet_log}
WHERE userid = ?";
$params = [$context->instanceid];
$userlist->add_from_sql('userid', $sql, $params);
}

Expand Down

0 comments on commit a246822

Please sign in to comment.