Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormacjohnny <estebanmarin@gmx.ch>2014-06-12 11:41:23 +0400
committermacjohnny <estebanmarin@gmx.ch>2014-06-12 11:41:23 +0400
commitede2aa236e0834fd4fac2ea59e7ef9c0a397ff06 (patch)
treea28f10ceda9eeb7d923405d3b0cd77b52e8b903d /lib/private/group
parent5def2a72dddb92bb2289839054ae39c1850c891d (diff)
Update manager.php
add a function getUserGroupIds for retrieving group ids instead of group objects. this significantly improves performance when using many (nested) groups.
Diffstat (limited to 'lib/private/group')
-rw-r--r--lib/private/group/manager.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php
index dae6443e9d4..150f4c18905 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