Save remote username in auth_remote_user in lowercase
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Confirmed
|
Medium
|
Unassigned |
Bug Description
The remoteusername should be saved in lowercase and checked case-insensitive like we do with the username and email address in the usr table.
See https:/
Main part:
The problem seems to be related to the checking of the remote username.
Eg, if we have a person with username = 'test01' and we have a row in the auth_remote_user table where remoteusername = 'test01' and the authinstance matches the one in the usr table things work fine
But if we have a person with username = 'test01' and we have a row in the auth_remote_user table where remoteusername = 'test01' and the authinstance matches the one in the usr table and another row in the auth_remote_user table where remoteusername = 'Test01' then things break.
We get ERROR: more than one row returned by a subquery used as an expression
The problem is the SQL query checks on the remoteusername by converting it to lowercase first.
We should be saving remoteusername either as lowercase only or checking before saving that there is only one of any case.