Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion core/Command/User/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,12 +37,15 @@
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();
}

Expand Down Expand Up @@ -73,6 +77,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$rows[] = [' '];
$rows[] = ['user directories', $userDirectoryCount];

$disabledUsers = $this->config->getUsersForUserValue('core', 'enabled', 'false');
$disabledUsersCount = count($disabledUsers);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈 should maybe add a dedicated function for this instead. But I geuss disabled users shouldn't be too many :-X

$rows[] = ['disabled users', $disabledUsersCount];

$table->setRows($rows);
$table->render();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion core/register_command.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
$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()));
Expand Down