Merge pull request #12331 from nextcloud/backport/12306/stable14

[14] Disabled ldap fix
This commit is contained in:
Morris Jobke 2018-11-07 16:19:55 +01:00 committed by GitHub
commit 1a079fd514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View File

@ -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',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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);
}
}