summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-07-09 12:19:50 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-14 21:26:37 +0200
commitab2c7e06a4ea3c751058b6b72dc9b8832836669a (patch)
tree709a7a31a74be44d08dc038b3169f1cb4144a4d5 /settings/ajax
parent9ee1c7ff7143c9d75a5f5a9f9477cc73f5d97717 (diff)
downloadnextcloud-server-ab2c7e06a4ea3c751058b6b72dc9b8832836669a.tar.gz
nextcloud-server-ab2c7e06a4ea3c751058b6b72dc9b8832836669a.zip
remove dead code
do not filter groups. but update the user count according to the filter improve phpdoc improve metadata runtime cache add metadata tests
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/grouplist.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/settings/ajax/grouplist.php b/settings/ajax/grouplist.php
index 91700adc359..52df98c4e5e 100644
--- a/settings/ajax/grouplist.php
+++ b/settings/ajax/grouplist.php
@@ -27,6 +27,12 @@ if (isset($_GET['pattern']) && !empty($_GET['pattern'])) {
} else {
$pattern = '';
}
+if (isset($_GET['filterGroups']) && !empty($_GET['filterGroups'])) {
+ $filterGroups = intval($_GET['filterGroups']) === 1;
+} else {
+ $filterGroups = false;
+}
+$groupPattern = $filterGroups ? $pattern : '';
$groups = array();
$adminGroups = array();
$groupManager = \OC_Group::getManager();
@@ -36,13 +42,7 @@ $isAdmin = OC_User::isAdminUser(OC_User::getUser());
//groups will be filtered out later
$groupsInfo = new \OC\Group\MetaData(OC_User::getUser(), true, $groupManager);
$groupsInfo->setSorting($groupsInfo::SORT_USERCOUNT);
-list($adminGroups, $groups) = $groupsInfo->get($pattern);
-
-$accessibleGroups = $groupManager->search($pattern);
-if(!$isAdmin) {
- $subadminGroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
- $accessibleGroups = array_intersect($groups, $subadminGroups);
-}
+list($adminGroups, $groups) = $groupsInfo->get($groupPattern, $pattern);
OC_JSON::success(
array('data' => array('adminGroups' => $adminGroups, 'groups' => $groups)));