Skip to content
Snippets Groups Projects
Commit ff076cae authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Check usernames in the database as case insensitive, they are still stored...

Check usernames in the database as case insensitive, they are still stored case sensitive. Bug fix for oc-422 and oc-1514
parent e05db004
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment