diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-25 05:28:42 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-25 05:28:42 -0700 |
commit | 68bfcfbf77ff938fa93b7f80c991c2872b68b157 (patch) | |
tree | aeaff2a2096fb32ee0ff762b8b542eff32bb9afc /lib/user.php | |
parent | 2d12e52769a30ba37d5760b1194f613bcc71035b (diff) | |
parent | 14a160e176135cb86191eed46b4cc3b3b0e58f44 (diff) | |
download | nextcloud-server-68bfcfbf77ff938fa93b7f80c991c2872b68b157.tar.gz nextcloud-server-68bfcfbf77ff938fa93b7f80c991c2872b68b157.zip |
Merge pull request #4968 from owncloud/user_checkpwd
User: move checkPassword from User to Manager to not break API
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/user.php b/lib/user.php index 0f6f40aec9a..da774ff86f0 100644 --- a/lib/user.php +++ b/lib/user.php @@ -410,22 +410,18 @@ class OC_User { * @brief Check if the password is correct * @param string $uid The username * @param string $password The password - * @return bool + * @return mixed user id a string on success, false otherwise * * Check if the password is correct without logging in the user * returns the user id or false */ public static function checkPassword($uid, $password) { - $user = self::getManager()->get($uid); - if ($user) { - if ($user->checkPassword($password)) { - return $user->getUID(); - } else { - return false; - } - } else { - return false; + $manager = self::getManager(); + $username = $manager->checkPassword($uid, $password); + if ($username !== false) { + return $manager->get($username)->getUID(); } + return false; } /** |