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

@ -140,13 +140,15 @@ class OC_USER {
if( $run ){ if( $run ){
//create the user in the first backend that supports creating users //create the user in the first backend that supports creating users
foreach(self::$_usedBackends as $backend){ foreach(self::$_usedBackends as $backend){
$result=$backend->createUser($uid,$password); if(!$backend->implementsActions(OC_USER_BACKEND_CREATE_USER))
if($result!==OC_USER_BACKEND_NOT_IMPLEMENTED){ continue;
$backend->createUser($uid,$password);
OC_HOOK::emit( "OC_USER", "post_createUser", array( "uid" => $uid, "password" => $password )); OC_HOOK::emit( "OC_USER", "post_createUser", array( "uid" => $uid, "password" => $password ));
return true; return true;
} }
} }
}
return false; return false;
} }
@ -306,9 +308,8 @@ class OC_USER {
public static function getUsers(){ public static function getUsers(){
$users=array(); $users=array();
foreach(self::$_usedBackends as $backend){ foreach(self::$_usedBackends as $backend){
$result=$backend->getUsers(); if($backend->implementsActions(OC_USER_BACKEND_GET_USERS)){
if($result!=OC_USER_BACKEND_NOT_IMPLEMENTED){ $users=array_merge($users,$backend->getUsers());
$users=array_merge($users,$result);
} }
} }
return $users; return $users;