Use new user backend API

This commit is contained in:
Dominik Schmidt 2011-06-23 15:24:09 +02:00
parent 96657f8b62
commit 3b2fcd356f
1 changed files with 10 additions and 9 deletions

View File

@ -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;