[Pkg-owncloud-commits] [owncloud] 37/223: Update manager.php
David Prévot
taffit at moszumanska.debian.org
Sun Jun 22 01:54:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit ede2aa236e0834fd4fac2ea59e7ef9c0a397ff06
Author: macjohnny <estebanmarin at gmx.ch>
Date: Thu Jun 12 09:41:23 2014 +0200
Update manager.php
add a function getUserGroupIds for retrieving group ids instead of group objects. this significantly improves performance when using many (nested) groups.
---
lib/private/group/manager.php | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php
index dae6443..150f4c1 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list