diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-25 08:18:02 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-04-05 17:23:36 +0200 |
commit | 3213c47188cc96d84a1108261ab83a57882cd51c (patch) | |
tree | f7583bd72b21772ad382c4974ddf3a00b625eb5a /lib/user/database.php | |
parent | e824c6cffa5408a42b218f943a1e017cf598cedb (diff) | |
download | nextcloud-server-3213c47188cc96d84a1108261ab83a57882cd51c.tar.gz nextcloud-server-3213c47188cc96d84a1108261ab83a57882cd51c.zip |
Use count SQL to check for user existance
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 210c7f3e1eb..5eff8f199be 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -237,13 +237,13 @@ class OC_User_Database extends OC_User_Backend { * @return boolean */ public function userExists($uid) { - $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); + $query = OC_DB::prepare( 'SELECT COUNT(*) FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)' ); $result = $query->execute( array( $uid )); if (OC_DB::isError($result)) { OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR); return false; } - return $result->numRows() > 0; + return $result->fetchColumn() > 0; } /** |