aboutsummaryrefslogtreecommitdiffstats
path: root/lib/user/database.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-28 11:28:38 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-28 11:28:38 -0400
commitff076caeee3ca29b1e4fb8c741e7525f30d921bf (patch)
treeb44087f3dd481c225d6ef171d5d7f16e3dc94e44 /lib/user/database.php
parente05db00468d3707e617a431fb00d8c7c447644e6 (diff)
downloadnextcloud-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.php4
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;