diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-28 11:28:38 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-28 11:28:38 -0400 |
commit | ff076caeee3ca29b1e4fb8c741e7525f30d921bf (patch) | |
tree | b44087f3dd481c225d6ef171d5d7f16e3dc94e44 /lib/user/database.php | |
parent | e05db00468d3707e617a431fb00d8c7c447644e6 (diff) | |
download | nextcloud-server-ff076caeee3ca29b1e4fb8c741e7525f30d921bf.tar.gz nextcloud-server-ff076caeee3ca29b1e4fb8c741e7525f30d921bf.zip |
Check usernames in the database as case insensitive, they are still stored case sensitive. Bug fix for oc-422 and oc-1514
Diffstat (limited to 'lib/user/database.php')
-rw-r--r-- | lib/user/database.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/user/database.php b/lib/user/database.php index a4cffe5d0c1..dc11614cc57 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -121,7 +121,7 @@ class OC_User_Database extends OC_User_Backend { * returns the user id or false */ public function checkPassword( $uid, $password ){ - $query = OC_DB::prepare( 'SELECT `uid`, `password` FROM `*PREFIX*users` WHERE `uid` = ?' ); + $query = OC_DB::prepare( 'SELECT `uid`, `password` FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid)); $row=$result->fetchRow(); @@ -170,7 +170,7 @@ class OC_User_Database extends OC_User_Backend { * @return boolean */ public function userExists($uid){ - $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE `uid` = ?' ); + $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid )); return $result->numRows() > 0; |