summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-08-30 22:01:10 +0200
committerGitHub <noreply@github.com>2017-08-30 22:01:10 +0200
commitee14659ae8f62da48420f3dd2cb8ed167bfca5dd (patch)
treebe18613d86126b01ca2dd07e8a60ee1ba06fade5
parent969eea2c0df49b4029c83e2ee8663f62e8512937 (diff)
parentd26ec44617e5bcda11f5f03a90a35790fc8f6f45 (diff)
downloadnextcloud-server-ee14659ae8f62da48420f3dd2cb8ed167bfca5dd.tar.gz
nextcloud-server-ee14659ae8f62da48420f3dd2cb8ed167bfca5dd.zip
Merge pull request #6216 from nextcloud/allow-to-sort-groups-by-name
Allow to sort groups by name
-rw-r--r--config/config.sample.php7
-rw-r--r--settings/users.php24
2 files changed, 21 insertions, 10 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 9f6ef668c5e..ed2ecbb87b3 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -943,6 +943,13 @@ $CONFIG = array(
'ldapUserCleanupInterval' => 51,
/**
+ * Sort groups in the user settings by name instead of the user count
+ *
+ * By enabling this the user count beside the group name is disabled as well.
+ */
+'sort_groups_by_name' => false,
+
+/**
* Comments
*
* Global settings for the Comments infrastructure
diff --git a/settings/users.php b/settings/users.php
index 8dedb703ada..76c6b5848eb 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -45,19 +45,23 @@ $groupManager = \OC::$server->getGroupManager();
// Set the sort option: SORT_USERCOUNT or SORT_GROUPNAME
$sortGroupsBy = \OC\Group\MetaData::SORT_USERCOUNT;
-$isLDAPUsed = false;
-if (\OC_App::isEnabled('user_ldap')) {
- $isLDAPUsed =
- $groupManager->isBackendUsed('\OCA\User_LDAP\Group_LDAP')
- || $groupManager->isBackendUsed('\OCA\User_LDAP\Group_Proxy');
- if ($isLDAPUsed) {
- // LDAP user count can be slow, so we sort by group name here
- $sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME;
+$config = \OC::$server->getConfig();
+
+if ($config->getSystemValue('sort_groups_by_name', false)) {
+ $sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME;
+} else {
+ $isLDAPUsed = false;
+ if (\OC_App::isEnabled('user_ldap')) {
+ $isLDAPUsed =
+ $groupManager->isBackendUsed('\OCA\User_LDAP\Group_LDAP')
+ || $groupManager->isBackendUsed('\OCA\User_LDAP\Group_Proxy');
+ if ($isLDAPUsed) {
+ // LDAP user count can be slow, so we sort by group name here
+ $sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME;
+ }
}
}
-$config = \OC::$server->getConfig();
-
$isAdmin = OC_User::isAdminUser(OC_User::getUser());
$isDisabled = !OC_User::isEnabled(OC_User::getUser());