Project

General

Profile

Actions

Patch #4732

closed

Make login case-insensitive also for PostgreSQL

Added by Marcel Waldvogel almost 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Accounts / authentication
Target version:
Start date:
2010-02-03
Due date:
% Done:

100%

Estimated time:

Description

When using MySQL as the backend, it will automatically do case-insensitive comparisons.
For a PostgreSQL database, however, trying to log in with different capitalisation will result in either of the following error messages (paraphrased):
  1. "User unknown" (when the user is not in LDAP or LDAP is not configured)
  2. "User with this email address already exists" (when there is such a user in LDAP and automatic addition is enabled; this is more confusing than "User unknown")
This patch resolves this problem for all systems, trying to use indices as much as possible:
  • For MySQL and PostgreSQL backends, it will even avoid table walks on successful attempts (there might be a table walk for unsuccessful logins with MySQL backend, depending on how MySQL's query optimiser works. Avoiding such a table walk for sure would require testing for the adapter in the controller, which I find pretty ugly).
  • For sqlite, it is likely to cause a table walk when capitalisation differs (but I would expect anyone using sqlite as a production backend will have few enough users).

An alternative would be to downcase the login name always, but this would require updating existing databases and might upset users who are used to seeing their name in mixed case.


Files

case-insensitive-login.patch (1.87 KB) case-insensitive-login.patch Marcel Waldvogel, 2010-02-04 00:26

Related issues

Related to Redmine - Defect #2473: Login and mail should not be case sensitiveClosedEric Davis2009-01-08

Actions
Actions

Also available in: Atom PDF