From df841cc0735a094396e1a9aa126614b10847c57d Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 6 Nov 2018 10:53:40 +0100 Subject: [PATCH] Show disabled even if empty if ldap enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- settings/Controller/UsersController.php | 4 ++-- settings/src/views/Users.vue | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 8460144aeb4..12c3e47dfea 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -192,7 +192,7 @@ class UsersController extends Controller { } if ($this->isAdmin) { - $disabledUsers = $isLDAPUsed ? 0 : $this->userManager->countDisabledUsers(); + $disabledUsers = $isLDAPUsed ? -1 : $this->userManager->countDisabledUsers(); $userCount = $isLDAPUsed ? 0 : array_reduce($this->userManager->countUsers(), function($v, $w) { return $v + (int)$w; }, 0); @@ -214,7 +214,7 @@ class UsersController extends Controller { } }; $userCount += $isLDAPUsed ? 0 : $this->userManager->countUsersOfGroups($groupsInfo->getGroups()); - $disabledUsers = $isLDAPUsed ? 0 : $this->userManager->countDisabledUsersOfGroups($groupsNames); + $disabledUsers = $isLDAPUsed ? -1 : $this->userManager->countDisabledUsersOfGroups($groupsNames); } $disabledUsersGroup = [ 'id' => 'disabled', diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue index c4c2951ac95..15d3205956d 100644 --- a/settings/src/views/Users.vue +++ b/settings/src/views/Users.vue @@ -315,8 +315,8 @@ export default { // group name item.text = group.name; - // users count - if (group.usercount - group.disabled > 0) { + // users count for all groups + if (group.usercount - group.disabled > 0 || group.usercount === -1) { item.utils.counter = group.usercount - group.disabled; } @@ -363,8 +363,11 @@ export default { if (disabledGroup && disabledGroup.text) { disabledGroup.text = t('settings', 'Disabled users'); // rename disabled group disabledGroup.icon = 'icon-disabled-users'; // set icon - if (disabledGroup.utils && disabledGroup.utils.counter > 0) { - groups.unshift(disabledGroup); // add disabled if not empty + if (disabledGroup.utils && ( + disabledGroup.utils.counter > 0 // add disabled if not empty + || disabledGroup.utils.counter === -1) // add disabled if ldap enabled + ) { + groups.unshift(disabledGroup); } } -- 2.39.5