mirror of
https://github.com/nextcloud/server.git
synced 2026-07-05 12:34:39 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user