diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-29 01:35:04 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-29 01:35:04 -0300 |
commit | 854dfef1992f088689f11c860cecbd5ccb6a20ed (patch) | |
tree | 125b8c4764397ad8c548ea99b52c56304a6ab78a /settings/users.php | |
parent | 130780056109d8b65e7b9abe40c89e26a75c5e35 (diff) | |
parent | c0e4fd0605318f02929ce1366b0fb884f26681a3 (diff) | |
download | nextcloud-server-854dfef1992f088689f11c860cecbd5ccb6a20ed.tar.gz nextcloud-server-854dfef1992f088689f11c860cecbd5ccb6a20ed.zip |
Merge pull request #1234 from nextcloud/rebase-413-by-faldon
Disabling users in WebUI
Diffstat (limited to 'settings/users.php')
-rw-r--r-- | settings/users.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/settings/users.php b/settings/users.php index 1986592af75..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') @@ -59,12 +60,15 @@ $config = \OC::$server->getConfig(); $isAdmin = OC_User::isAdminUser(OC_User::getUser()); +$isDisabled = !OC_User::isEnabled(OC_User::getUser()); + $groupsInfo = new \OC\Group\MetaData( OC_User::getUser(), $isAdmin, $groupManager, \OC::$server->getUserSession() ); + $groupsInfo->setSorting($sortGroupsBy); list($adminGroup, $groups) = $groupsInfo->get(); @@ -93,6 +97,13 @@ if($isAdmin) { $subAdmins = false; } +$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'); $quotaPreset=explode(',', $quotaPreset); @@ -111,6 +122,7 @@ $tmpl = new OC_Template("settings", "users/main", "user"); $tmpl->assign('groups', $groups); $tmpl->assign('sortGroups', $sortGroupsBy); $tmpl->assign('adminGroup', $adminGroup); +$tmpl->assign('disabledUsersGroup', $disabledUsersGroup); $tmpl->assign('isAdmin', (int)$isAdmin); $tmpl->assign('subadmins', $subAdmins); $tmpl->assign('numofgroups', count($groups) + count($adminGroup)); |