diff options
author | Dominik Schmidt <dev@dominik-schmidt.de> | 2011-06-23 15:24:09 +0200 |
---|---|---|
committer | Dominik Schmidt <dev@dominik-schmidt.de> | 2011-06-23 15:24:09 +0200 |
commit | 3b2fcd356f0e1bc0472583d910932c7771ce991c (patch) | |
tree | 0d4042919c1a3e5ddc6c8f9648b4c301f8d8b2f8 /lib | |
parent | 96657f8b620c374b2c4e3230f3451aa656a5b07b (diff) | |
download | nextcloud-server-3b2fcd356f0e1bc0472583d910932c7771ce991c.tar.gz nextcloud-server-3b2fcd356f0e1bc0472583d910932c7771ce991c.zip |
Use new user backend API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/user.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/user.php b/lib/user.php index 7eafef924a8..33ee5b8762a 100644 --- a/lib/user.php +++ b/lib/user.php @@ -66,7 +66,7 @@ class OC_USER { public static function getBackends(){ return self::$_backends; } - + /** * @brief gets used backends * @returns array of backends @@ -140,11 +140,13 @@ class OC_USER { if( $run ){ //create the user in the first backend that supports creating users foreach(self::$_usedBackends as $backend){ - $result=$backend->createUser($uid,$password); - if($result!==OC_USER_BACKEND_NOT_IMPLEMENTED){ - OC_HOOK::emit( "OC_USER", "post_createUser", array( "uid" => $uid, "password" => $password )); - return true; - } + if(!$backend->implementsActions(OC_USER_BACKEND_CREATE_USER)) + continue; + + $backend->createUser($uid,$password); + OC_HOOK::emit( "OC_USER", "post_createUser", array( "uid" => $uid, "password" => $password )); + + return true; } } return false; @@ -306,9 +308,8 @@ class OC_USER { public static function getUsers(){ $users=array(); foreach(self::$_usedBackends as $backend){ - $result=$backend->getUsers(); - if($result!=OC_USER_BACKEND_NOT_IMPLEMENTED){ - $users=array_merge($users,$result); + if($backend->implementsActions(OC_USER_BACKEND_GET_USERS)){ + $users=array_merge($users,$backend->getUsers()); } } return $users; |