diff options
author | macjohnny <estebanmarin@gmx.ch> | 2014-06-16 07:50:53 +0200 |
---|---|---|
committer | macjohnny <estebanmarin@gmx.ch> | 2014-06-16 07:50:53 +0200 |
commit | e5224782fa4acb6f8f42aa437fb3f21c35e73e64 (patch) | |
tree | ee5ace64f6c95653c7995ab45f582d7a56bfc807 /lib | |
parent | 4d6fc6f3095f3d91ef7a55b7bc5ccafb82fd85f1 (diff) | |
parent | 767aa4e35ff4d8c9bd61996b15b286a86a9f92db (diff) | |
download | nextcloud-server-e5224782fa4acb6f8f42aa437fb3f21c35e73e64.tar.gz nextcloud-server-e5224782fa4acb6f8f42aa437fb3f21c35e73e64.zip |
Merge pull request #9022 from owncloud/speedup-nested-ldap-groups
drastic speedup for nested ldap groups
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/group.php | 7 | ||||
-rw-r--r-- | lib/private/group/manager.php | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/private/group.php b/lib/private/group.php index 8dc38129205..bd9e3d37d1f 100644 --- a/lib/private/group.php +++ b/lib/private/group.php @@ -187,12 +187,7 @@ class OC_Group { public static function getUserGroups($uid) { $user = self::$userManager->get($uid); if ($user) { - $groups = self::getManager()->getUserGroups($user); - $groupIds = array(); - foreach ($groups as $group) { - $groupIds[] = $group->getGID(); - } - return $groupIds; + return self::getManager()->getUserGroupIds($user); } else { return array(); } diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php index dae6443e9d4..3613c7547bd 100644 --- a/lib/private/group/manager.php +++ b/lib/private/group/manager.php @@ -182,6 +182,18 @@ class Manager extends PublicEmitter { $this->cachedUserGroups[$uid] = array_values($groups); return $this->cachedUserGroups[$uid]; } + /** + * @param \OC\User\User $user + * @return array with group names + */ + public function getUserGroupIds($user) { + $groupIds = array(); + foreach ($this->backends as $backend) { + $groupIds = array_merge($groupIds, $backend->getUserGroups($user->getUID())); + + } + return $groupIds; + } /** * get a list of all display names in a group |