Commit 8f7dde19 authored by Nigel McNie's avatar Nigel McNie
Browse files

Tweak the find_by_instanceid_username method to retrieve correct results when...

Tweak the find_by_instanceid_username method to retrieve correct results when more than one remote app is SSOing in.

Previously, we looked up users using a parent authentication method using the username we were given. But Mahara may know them as something different based on the auth_remote_user table.
parent e17c7664
......@@ -182,8 +182,19 @@ class User {
$parentwhere = '
OR
(
LOWER(username) = ' . db_quote($username) . '
AND u.authinstance = ' . db_quote($parentid) . '
LOWER(username) = (
SELECT
username
FROM
{usr} us
JOIN
{auth_remote_user} aru ON (us.id = aru.localusr)
WHERE
aru.remoteusername = ' . db_quote($username) . '
AND us.authinstance = ' . db_quote($parentid) . '
)
AND
u.authinstance = ' . db_quote($parentid) . '
)
';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment