diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-02-19 11:40:07 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-06-02 12:53:52 +0200 |
commit | 478393e15ad3d6c884368f0b1a922eda6f9ffe0e (patch) | |
tree | 9447ce1813a66d3aa6ae8ecef751123bea2c4494 /settings/ajax | |
parent | e681e1eec094385e2a41ea301834d6593d97ec0b (diff) | |
download | nextcloud-server-478393e15ad3d6c884368f0b1a922eda6f9ffe0e.tar.gz nextcloud-server-478393e15ad3d6c884368f0b1a922eda6f9ffe0e.zip |
load groups when clicking on them
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/userlist.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/settings/ajax/userlist.php b/settings/ajax/userlist.php index b1c26429534..7ca1d535a46 100644 --- a/settings/ajax/userlist.php +++ b/settings/ajax/userlist.php @@ -32,10 +32,19 @@ if (isset($_GET['limit'])) { } else { $limit = 10; } +if (isset($_GET['gid']) && !empty($_GET['gid'])) { + $gid = $_GET['gid']; +} else { + $gid = false; +} $users = array(); $userManager = \OC_User::getManager(); if (OC_User::isAdminUser(OC_User::getUser())) { - $batch = OC_User::getDisplayNames('', $limit, $offset); + if($gid !== false) { + $batch = OC_Group::displayNamesInGroup($gid, '', $limit, $offset); + } else { + $batch = OC_User::getDisplayNames('', $limit, $offset); + } foreach ($batch as $uid => $displayname) { $user = $userManager->get($uid); $users[] = array( @@ -50,6 +59,12 @@ if (OC_User::isAdminUser(OC_User::getUser())) { } } else { $groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()); + if($gid !== false && in_array($gid, $groups)) { + $groups = array($gid); + } elseif($gid !== false) { + //don't you try to investigate loops you must not know about + $groups = array(); + } $batch = OC_Group::usersInGroups($groups, '', $limit, $offset); foreach ($batch as $uid) { $user = $userManager->get($uid); |