From: Matthijs Kooijman Date: Mon, 14 Feb 2011 15:26:08 +0000 (+0100) Subject: phpbb: Make the username case-insensitve on login again. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=5e0e784da0a9786713cf1850ab1669a7c652ffc3;p=matthijs%2Fprojects%2Fwipi.git phpbb: Make the username case-insensitve on login again. The username field in the phpbb3 database is case sensitive (i.e., it has utf_bin collation), whereas in phpbb2 it was case insensitive. This commit changes the SQL query to make logins case insensitive again, since a lot of people used a capital letter for registering their username, but forgot that later on... --- diff --git a/conf/auth/phpbb.py b/conf/auth/phpbb.py index 4fc06b9..58dd72c 100644 --- a/conf/auth/phpbb.py +++ b/conf/auth/phpbb.py @@ -218,7 +218,7 @@ class PhpbbAuth(BaseAuth): # case insensitive collaction for the username field, so # usernames are checked in case insensitive manner. cursor = conn.cursor () - cursor.execute ("SELECT user_password,user_email,username FROM `%susers` WHERE username=%%s" % self.dbconfig['phpbb_prefix'], username) + cursor.execute ("SELECT user_password,user_email,username FROM `%susers` WHERE LOWER(username)=LOWER(%%s)" % self.dbconfig['phpbb_prefix'], username) # No data? No login. if (cursor.rowcount == 0):