summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-27 14:25:47 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-27 14:25:47 +0200
commit687ba053b7055900dc938da5b82b6d391b0b4318 (patch)
tree34e893923186c3373e85fb84e621b93f49dbf562 /lib/user.php
parent469b309b21b6634b275c485fb09aa5d8d69fe33c (diff)
parent735608f51323218a098137a4992aeafff5806f5c (diff)
downloadnextcloud-server-687ba053b7055900dc938da5b82b6d391b0b4318.tar.gz
nextcloud-server-687ba053b7055900dc938da5b82b6d391b0b4318.zip
Merge branch 'master' into appframework-master
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/user.php b/lib/user.php
index 7f6a296c3ea..15e807088b4 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -138,6 +138,7 @@ class OC_User {
* setup the configured backends in config.php
*/
public static function setupBackends() {
+ OC_App::loadApps(array('prelogin'));
$backends = OC_Config::getValue('user_backends', array());
foreach ($backends as $i => $config) {
$class = $config['class'];
@@ -371,22 +372,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 $username->getUID();
}
+ return false;
}
/**