summaryrefslogtreecommitdiffstats
path: root/lib/group.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-11 16:21:09 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-11 16:25:28 -0400
commita1c88a3e39695a463ff7d0dda74dbdbb59d86f5c (patch)
tree39cefd2a127bababa2b548467b09f75b2b9dd616 /lib/group.php
parent4f1b3631ba3356fb3890180b65281b9653a0e714 (diff)
downloadnextcloud-server-a1c88a3e39695a463ff7d0dda74dbdbb59d86f5c.tar.gz
nextcloud-server-a1c88a3e39695a463ff7d0dda74dbdbb59d86f5c.zip
Add search, limit, offset parameters to usersInGroups()
Diffstat (limited to 'lib/group.php')
-rw-r--r--lib/group.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/group.php b/lib/group.php
index e47b770f597..72cf5dc89af 100644
--- a/lib/group.php
+++ b/lib/group.php
@@ -264,10 +264,10 @@ class OC_Group {
* @brief get a list of all users in a group
* @returns array with user ids
*/
- public static function usersInGroup($gid){
+ public static function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$users=array();
foreach(self::$_usedBackends as $backend){
- $users=array_merge($backend->usersInGroup($gid),$users);
+ $users = array_merge($backend->usersInGroup($gid, $search, $limit, $offset), $users);
}
return $users;
}
@@ -277,10 +277,11 @@ class OC_Group {
* @param array $gids
* @returns array with user ids
*/
- public static function usersInGroups($gids){
+ public static function usersInGroups($gids, $search = '', $limit = -1, $offset = 0) {
$users = array();
- foreach($gids as $gid){
- $users = array_merge(array_diff(self::usersInGroup($gid), $users), $users);
+ foreach ($gids as $gid) {
+ // TODO Need to apply limits to groups as total
+ $users = array_merge(array_diff(self::usersInGroup($gid, $search, $limit, $offset), $users), $users);
}
return $users;
}