summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDominik Schmidt <dev@dominik-schmidt.de>2011-06-23 15:24:09 +0200
committerDominik Schmidt <dev@dominik-schmidt.de>2011-06-23 15:24:09 +0200
commit3b2fcd356f0e1bc0472583d910932c7771ce991c (patch)
tree0d4042919c1a3e5ddc6c8f9648b4c301f8d8b2f8 /lib
parent96657f8b620c374b2c4e3230f3451aa656a5b07b (diff)
downloadnextcloud-server-3b2fcd356f0e1bc0472583d910932c7771ce991c.tar.gz
nextcloud-server-3b2fcd356f0e1bc0472583d910932c7771ce991c.zip
Use new user backend API
Diffstat (limited to 'lib')
-rw-r--r--lib/user.php19
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;