diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-05-08 09:07:11 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-05-10 09:14:26 +0200 |
commit | ac2e0cd6e450607585fbac2ec00a952744a4a36b (patch) | |
tree | 443abc4e841ea5a0355b67ed542f838ddde40612 /lib/user.php | |
parent | a9d7c67bf2e906fceea40b41f4780e623226fdff (diff) | |
download | nextcloud-server-ac2e0cd6e450607585fbac2ec00a952744a4a36b.tar.gz nextcloud-server-ac2e0cd6e450607585fbac2ec00a952744a4a36b.zip |
Implement default functions in OC_User backend
Simplifies calling these functions, and makes code simpler
functions:
deleteUser
getUsers
userExists
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/user.php b/lib/user.php index 816caff8dd8..ad5198d0374 100644 --- a/lib/user.php +++ b/lib/user.php @@ -161,9 +161,7 @@ class OC_User { if( $run ){ //delete the user from all backends foreach(self::$_usedBackends as $backend){ - if($backend->implementsActions(OC_USER_BACKEND_DELETE_USER)){ - $backend->deleteUser($uid); - } + $backend->deleteUser($uid); } // We have to delete the user from all groups foreach( OC_Group::getUserGroups( $uid ) as $i ){ @@ -323,11 +321,9 @@ class OC_User { public static function getUsers(){ $users=array(); foreach(self::$_usedBackends as $backend){ - if($backend->implementsActions(OC_USER_BACKEND_GET_USERS)){ - $backendUsers=$backend->getUsers(); - if(is_array($backendUsers)){ - $users=array_merge($users,$backendUsers); - } + $backendUsers=$backend->getUsers(); + if(is_array($backendUsers)){ + $users=array_merge($users,$backendUsers); } } return $users; @@ -340,11 +336,9 @@ class OC_User { */ public static function userExists($uid){ foreach(self::$_usedBackends as $backend){ - if($backend->implementsActions(OC_USER_BACKEND_USER_EXISTS)){ - $result=$backend->userExists($uid); - if($result===true){ - return true; - } + $result=$backend->userExists($uid); + if($result===true){ + return true; } } return false; |