diff options
-rw-r--r-- | lib/private/group/manager.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php index 3613c7547bd..fc90d4cb643 100644 --- a/lib/private/group/manager.php +++ b/lib/private/group/manager.php @@ -179,7 +179,7 @@ class Manager extends PublicEmitter { $groups[$groupId] = $this->get($groupId); } } - $this->cachedUserGroups[$uid] = array_values($groups); + $this->cachedUserGroups[$uid] = $groups; return $this->cachedUserGroups[$uid]; } /** @@ -187,6 +187,9 @@ class Manager extends PublicEmitter { * @return array with group names */ public function getUserGroupIds($user) { + if (isset($this->cachedUserGroups[$uid])) { + return array_keys($this->cachedUserGroups[$uid]); + } $groupIds = array(); foreach ($this->backends as $backend) { $groupIds = array_merge($groupIds, $backend->getUserGroups($user->getUID())); |