MDL-63785 auth_mnet: performance improvement

This commit is contained in:
Shamim Rezaie 2018-10-26 23:04:39 +11:00
parent 28dfbe77bf
commit a246822931

View File

@ -161,18 +161,10 @@ class provider implements
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);
}