summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-08-19 11:23:27 +0200
committerGitHub <noreply@github.com>2020-08-19 11:23:27 +0200
commitbc2b42250820197c3f71518299c401515f6ee1cc (patch)
tree0d5de9cd15611c5ab7ff76eddc970db8b0117405
parent4ff492a4927accb2e09559467477a1815c90593b (diff)
parent7506cbb1c4a3f48d21c3ace6bee705aad2e1f91a (diff)
downloadnextcloud-server-bc2b42250820197c3f71518299c401515f6ee1cc.tar.gz
nextcloud-server-bc2b42250820197c3f71518299c401515f6ee1cc.zip
Merge pull request #22299 from nextcloud/enh/noid/show-disabled-user-count-in-userreport
Show disabled user count in occ user:report
-rw-r--r--core/Command/User/Report.php10
-rw-r--r--core/register_command.php2
2 files changed, 10 insertions, 2 deletions
diff --git a/core/Command/User/Report.php b/core/Command/User/Report.php
index b7fecee61bb..66bc9bd3de1 100644
--- a/core/Command/User/Report.php
+++ b/core/Command/User/Report.php
@@ -27,6 +27,7 @@
namespace OC\Core\Command\User;
+use OCP\IConfig;
use OCP\IUserManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
@@ -36,12 +37,15 @@ use Symfony\Component\Console\Output\OutputInterface;
class Report extends Command {
/** @var IUserManager */
protected $userManager;
+ /** @var IConfig */
+ private $config;
/**
* @param IUserManager $userManager
*/
- public function __construct(IUserManager $userManager) {
+ public function __construct(IUserManager $userManager, IConfig $config) {
$this->userManager = $userManager;
+ $this->config = $config;
parent::__construct();
}
@@ -73,6 +77,10 @@ class Report extends Command {
$rows[] = [' '];
$rows[] = ['user directories', $userDirectoryCount];
+ $disabledUsers = $this->config->getUsersForUserValue('core', 'enabled', 'false');
+ $disabledUsersCount = count($disabledUsers);
+ $rows[] = ['disabled users', $disabledUsersCount];
+
$table->setRows($rows);
$table->render();
return 0;
diff --git a/core/register_command.php b/core/register_command.php
index 412e8ba8678..c2a3f76b6c3 100644
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -162,7 +162,7 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
$application->add(new OC\Core\Command\User\Disable(\OC::$server->getUserManager()));
$application->add(new OC\Core\Command\User\Enable(\OC::$server->getUserManager()));
$application->add(new OC\Core\Command\User\LastSeen(\OC::$server->getUserManager()));
- $application->add(new OC\Core\Command\User\Report(\OC::$server->getUserManager()));
+ $application->add(\OC::$server->get(\OC\Core\Command\User\Report::class));
$application->add(new OC\Core\Command\User\ResetPassword(\OC::$server->getUserManager()));
$application->add(new OC\Core\Command\User\Setting(\OC::$server->getUserManager(), \OC::$server->getConfig(), \OC::$server->getDatabaseConnection()));
$application->add(new OC\Core\Command\User\ListCommand(\OC::$server->getUserManager(), \OC::$server->getGroupManager()));