From 2ae82137cd816b53cdf60ecba986e938f81d09e9 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Fri, 6 Apr 2018 20:56:02 +0200 Subject: Group filtering, disable state, ocs api final update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- settings/users.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'settings/users.php') diff --git a/settings/users.php b/settings/users.php index af0bf1dd4da..62be3322bee 100644 --- a/settings/users.php +++ b/settings/users.php @@ -113,16 +113,22 @@ $disabledUsersGroup = [ $allGroups = array_merge_recursive($adminGroup, $groups); /* QUOTAS PRESETS */ -$quotaPreset=$config->getAppValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB'); -$quotaPreset=explode(',', $quotaPreset); -foreach($quotaPreset as &$preset) { - $preset=trim($preset); +$quotaPreset = $config->getAppValue('files', 'quota_preset', '1 GB, 5 GB, 10 GB'); +$quotaPreset = explode(',', $quotaPreset); +foreach ($quotaPreset as &$preset) { + $preset = trim($preset); } -$quotaPreset=array_diff($quotaPreset, array('default', 'none')); -$defaultQuota=$config->getAppValue('files', 'default_quota', 'none'); +$quotaPreset = array_diff($quotaPreset, array('default', 'none')); +$defaultQuota = $config->getAppValue('files', 'default_quota', 'none'); \OC::$server->getEventDispatcher()->dispatch('OC\Settings\Users::loadAdditionalScripts'); +/* TOTAL USERS COUNT */ +function addition($v, $w) { + return $v+$w; +} +$userCount = array_reduce($userManager->countUsers(), 'addition', 0); + /* FINAL DATA */ $serverData = array(); // groups @@ -132,7 +138,7 @@ $serverData['subadmingroups'] = $groups; $serverData['subadmins'] = $subAdmins; $serverData['sortGroups'] = $sortGroupsBy; $serverData['quotaPreset'] = $quotaPreset; -$serverData['userCount'] = $userManager->countUsers(); +$serverData['userCount'] = $userCount-$disabledUsers; // Settings $serverData['defaultQuota'] = $defaultQuota; $serverData['canChangePassword'] = $canChangePassword; -- cgit v1.2.3