mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Merge pull request #6216 from nextcloud/allow-to-sort-groups-by-name
Allow to sort groups by name
This commit is contained in:
commit
ee14659ae8
2 changed files with 21 additions and 10 deletions
|
|
@ -942,6 +942,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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue