diff options
Diffstat (limited to 'settings')
-rw-r--r-- | settings/users.php | 24 |
1 files changed, 14 insertions, 10 deletions
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()); |