]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check usernames in the database as case insensitive, they are still stored case sensi...
authorMichael Gapczynski <mtgap@owncloud.com>
Tue, 28 Aug 2012 15:28:38 +0000 (11:28 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Tue, 28 Aug 2012 15:28:38 +0000 (11:28 -0400)
lib/user/database.php

index a4cffe5d0c10e1ab7012e1d77e8bf177b9cc5139..dc11614cc57acf1ad998b781c88f1bf2f2581c36 100644 (file)
@@ -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;