summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
Diffstat (limited to 'settings')
-rw-r--r--settings/users.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/settings/users.php b/settings/users.php
index 5da6902b8fa..c438e5fbfd0 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -41,12 +41,10 @@ $groupManager = \OC_Group::getManager();
$sortGroupsBy = \OC\Group\MetaData::SORT_USERCOUNT;
if (class_exists('\OCA\user_ldap\GROUP_LDAP')) {
- $backends = $groupManager->getBackends();
- foreach ($backends as $backend) {
- if ($backend instanceof \OCA\user_ldap\GROUP_LDAP) {
- // LDAP user count can be slow, so we sort by gorup name here
- $sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME;
- }
+ $isLDAPUsed = $groupManager->isBackendUsed('\OCA\user_ldap\GROUP_LDAP');
+ if ($isLDAPUsed) {
+ // LDAP user count can be slow, so we sort by group name here
+ $sortGroupsBy = \OC\Group\MetaData::SORT_GROUPNAME;
}
}