Commit 2d94e3bb authored by Robert Lyon's avatar Robert Lyon

Bug 1567100: In Mahara we deal with username in a case insensitive way

In other places we check the LOWER(username) but for some reason
in find_by_username() we don't. We should do it here as well for
consistency.

behatnotneeded

Change-Id: Ie692aeace0c8aa2f6989683e094ac6625f153b98
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit fb330e38)
parent 2cdb2b96
......@@ -134,6 +134,7 @@ class User {
throw new InvalidArgumentException('username parameter must be a string to create a User object');
}
$username = strtolower($username);
$sql = 'SELECT
*,
' . db_format_tsfield('expiry') . ',
......@@ -145,7 +146,7 @@ class User {
FROM
{usr}
WHERE
username = ?';
LOWER(username) = ?';
$user = get_record_sql($sql, array($username));
......
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