← Back to team overview

mahara-contributors team mailing list archive

[Bug 1945699] [NEW] Save remote username in auth_remote_user in lowercase

 

Public bug reported:

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://mahara.org/interaction/forum/topic.php?id=8898 for the
background.

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.

** Affects: mahara
     Importance: Medium
         Status: Confirmed

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1945699

Title:
  Save remote username in auth_remote_user in lowercase

Status in Mahara:
  Confirmed

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://mahara.org/interaction/forum/topic.php?id=8898 for the
  background.

  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1945699/+subscriptions