diff options
author | nishiki <nishiki@yaegashi.fr> | 2014-03-09 12:22:47 +0100 |
---|---|---|
committer | nishiki <nishiki@yaegashi.fr> | 2014-03-09 12:22:47 +0100 |
commit | 75011c2e09e2ee7e9c76a86e938c4d8656225352 (patch) | |
tree | dc61ea68caebc3f4f2d97c21013354b6b56c7a7d /lib/private | |
parent | d8843f6cd3b37bc7e95b5baa437d7087b09fc6fd (diff) | |
download | nextcloud-server-75011c2e09e2ee7e9c76a86e938c4d8656225352.tar.gz nextcloud-server-75011c2e09e2ee7e9c76a86e938c4d8656225352.zip |
add query result (boolean) for update or delete
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/user/database.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/private/user/database.php b/lib/private/user/database.php index c472c5445b7..57ecdda9dad 100644 --- a/lib/private/user/database.php +++ b/lib/private/user/database.php @@ -91,8 +91,9 @@ class OC_User_Database extends OC_User_Backend { public function deleteUser($uid) { // Delete user-group-relation $query = OC_DB::prepare('DELETE FROM `*PREFIX*users` WHERE `uid` = ?'); - $query->execute(array($uid)); - return true; + $result = $query->execute(array($uid)); + + return $result ? true : false; } /** @@ -108,9 +109,9 @@ class OC_User_Database extends OC_User_Backend { $hasher = $this->getHasher(); $hash = $hasher->HashPassword($password . OC_Config::getValue('passwordsalt', '')); $query = OC_DB::prepare('UPDATE `*PREFIX*users` SET `password` = ? WHERE `uid` = ?'); - $query->execute(array($hash, $uid)); + $result = $query->execute(array($hash, $uid)); - return true; + return $result ? true : false; } return false; @@ -142,11 +143,7 @@ class OC_User_Database extends OC_User_Backend { */ public function getDisplayName($uid) { $this->loadUser($uid); - if (!empty(self::$cache[$uid]['displayname'])) { - return self::$cache[$uid]['displayname']; - } else { - return $uid; - } + return empty(self::$cache[$uid]['displayname']) ? $uid : self::$cache[$uid]['displayname']; } /** |