Update manager.php

add a function getUserGroupIds for retrieving group ids instead of group objects. this significantly improves performance when using many (nested) groups.
This commit is contained in:
macjohnny 2014-06-12 09:41:23 +02:00
parent 5def2a72dd
commit ede2aa236e
1 changed files with 12 additions and 0 deletions

View File

@ -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