diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-04-26 12:37:48 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-29 00:59:09 -0300 |
commit | 668fe7df51e097a762d9f03e0329a06d0751cd78 (patch) | |
tree | 5d4cb3e398e6cfee2122af5838db617a6c7c62a2 /settings/users.php | |
parent | 8f5f26c88d53b13a9ea7e5d9fe531decf0356879 (diff) | |
download | nextcloud-server-668fe7df51e097a762d9f03e0329a06d0751cd78.tar.gz nextcloud-server-668fe7df51e097a762d9f03e0329a06d0751cd78.zip |
UserManager can now count disabled users
Users page takes advantage of that
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'settings/users.php')
-rw-r--r-- | settings/users.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/settings/users.php b/settings/users.php index 9f3433aa33a..4d214bf9502 100644 --- a/settings/users.php +++ b/settings/users.php @@ -45,6 +45,7 @@ $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') @@ -95,17 +96,13 @@ if($isAdmin) { } $subAdmins = false; } -$disabledUsers = 0; -foreach (OC_User::getUsers() as $uid) { - if(!$userManager->get($uid)->isEnabled()) { - $disabledUsers++; - } -} -$disabledUsersGroup = array( + +$disabledUsers = $isLDAPUsed ? 0 : $userManager->countDisabledUsers(); +$disabledUsersGroup = [ 'id' => '_disabledUsers', 'name' => '_disabledUsers', 'usercount' => $disabledUsers -); +]; // load preset quotas $quotaPreset=$config->getAppValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB'); |