Skip to content

Commit

Permalink
Merge pull request #12306 from nextcloud/disabled-ldap-fix
Browse files Browse the repository at this point in the history
Disabled ldap fix
  • Loading branch information
MorrisJobke authored Nov 6, 2018
2 parents ccd89f3 + 7260d22 commit c92d35a
Show file tree
Hide file tree
Showing 12 changed files with 2,707 additions and 1,375 deletions.
4 changes: 2 additions & 2 deletions settings/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function usersList() {
}

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);
Expand All @@ -214,7 +214,7 @@ public function usersList() {
}
};
$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',
Expand Down
4,021 changes: 2,674 additions & 1,347 deletions settings/js/1.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/1.js.map

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions settings/js/2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion settings/js/2.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/4.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/5.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions settings/js/settings-admin-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/settings-admin-security.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/settings-vue.js.map

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit c92d35a

Please sign in to comment.