Skip to content

Commit 1a079fd

Browse files
authored
Merge pull request #12331 from nextcloud/backport/12306/stable14
[14] Disabled ldap fix
2 parents 390518c + 21c9146 commit 1a079fd

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

settings/Controller/UsersController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function usersList() {
192192
}
193193

194194
if ($this->isAdmin) {
195-
$disabledUsers = $isLDAPUsed ? 0 : $this->userManager->countDisabledUsers();
195+
$disabledUsers = $isLDAPUsed ? -1 : $this->userManager->countDisabledUsers();
196196
$userCount = $isLDAPUsed ? 0 : array_reduce($this->userManager->countUsers(), function($v, $w) {
197197
return $v + (int)$w;
198198
}, 0);
@@ -214,7 +214,7 @@ public function usersList() {
214214
}
215215
};
216216
$userCount += $isLDAPUsed ? 0 : $this->userManager->countUsersOfGroups($groupsInfo->getGroups());
217-
$disabledUsers = $isLDAPUsed ? 0 : $this->userManager->countDisabledUsersOfGroups($groupsNames);
217+
$disabledUsers = $isLDAPUsed ? -1 : $this->userManager->countDisabledUsersOfGroups($groupsNames);
218218
}
219219
$disabledUsersGroup = [
220220
'id' => 'disabled',

settings/js/settings-vue.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-vue.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/src/views/Users.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ export default {
315315
// group name
316316
item.text = group.name;
317317
318-
// users count
319-
if (group.usercount - group.disabled > 0) {
318+
// users count for all groups
319+
if (group.usercount - group.disabled > 0 || group.usercount === -1) {
320320
item.utils.counter = group.usercount - group.disabled;
321321
}
322322
@@ -363,8 +363,11 @@ export default {
363363
if (disabledGroup && disabledGroup.text) {
364364
disabledGroup.text = t('settings', 'Disabled users'); // rename disabled group
365365
disabledGroup.icon = 'icon-disabled-users'; // set icon
366-
if (disabledGroup.utils && disabledGroup.utils.counter > 0) {
367-
groups.unshift(disabledGroup); // add disabled if not empty
366+
if (disabledGroup.utils && (
367+
disabledGroup.utils.counter > 0 // add disabled if not empty
368+
|| disabledGroup.utils.counter === -1) // add disabled if ldap enabled
369+
) {
370+
groups.unshift(disabledGroup);
368371
}
369372
}
370373

0 commit comments

Comments
 (0)