summaryrefslogtreecommitdiffstats
path: root/lib/group.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-05-08 17:46:35 +0200
committerBart Visscher <bartv@thisnet.nl>2012-05-10 09:14:26 +0200
commite77ba0280a0ebceef348750f5ff9738012e2b8fb (patch)
tree581e41f677eb86ba79cc3f243cce24e04dfd352c /lib/group.php
parentac2e0cd6e450607585fbac2ec00a952744a4a36b (diff)
downloadnextcloud-server-e77ba0280a0ebceef348750f5ff9738012e2b8fb.tar.gz
nextcloud-server-e77ba0280a0ebceef348750f5ff9738012e2b8fb.zip
Implement default functions in OC_Group backend
Simplifies calling these functions, and makes code simpler functions: inGroup getUserGroups getGroups usersInGroup
Diffstat (limited to 'lib/group.php')
-rw-r--r--lib/group.php14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/group.php b/lib/group.php
index 9b2959d1f73..bc98e877ade 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -84,7 +84,7 @@ class OC_Group {
OC_Hook::emit( "OC_Group", "pre_createGroup", array( "run" => &$run, "gid" => $gid ));
if($run){
- //create the user in the first backend that supports creating users
+ //create the group in the first backend that supports creating groups
foreach(self::$_usedBackends as $backend){
if(!$backend->implementsActions(OC_GROUP_BACKEND_CREATE_GROUP))
continue;
@@ -141,9 +141,6 @@ class OC_Group {
*/
public static function inGroup( $uid, $gid ){
foreach(self::$_usedBackends as $backend){
- if(!$backend->implementsActions(OC_GROUP_BACKEND_IN_GROUP))
- continue;
-
if($backend->inGroup($uid,$gid)){
return true;
}
@@ -224,9 +221,6 @@ class OC_Group {
public static function getUserGroups( $uid ){
$groups=array();
foreach(self::$_usedBackends as $backend){
- if(!$backend->implementsActions(OC_GROUP_BACKEND_GET_USER_GROUPS))
- continue;
-
$groups=array_merge($backend->getUserGroups($uid),$groups);
}
return $groups;
@@ -241,9 +235,6 @@ class OC_Group {
public static function getGroups(){
$groups=array();
foreach(self::$_usedBackends as $backend){
- if(!$backend->implementsActions(OC_GROUP_BACKEND_GET_GROUPS))
- continue;
-
$groups=array_merge($backend->getGroups(),$groups);
}
return $groups;
@@ -270,9 +261,6 @@ class OC_Group {
public static function usersInGroup($gid){
$users=array();
foreach(self::$_usedBackends as $backend){
- if(!$backend->implementsActions(OC_GROUP_BACKEND_GET_USERS))
- continue;
-
$users=array_merge($backend->usersInGroup($gid),$users);
}
return $users;