namespace OC\Core\Command\User;
+use OCP\IConfig;
use OCP\IUserManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
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();
}
$rows[] = array(' ');
$rows[] = array('user directories', $userDirectoryCount);
+ $disabledUsers = $this->config->getUsersForUserValue('core', 'enabled', 'false');
+ $disabledUsersCount = count($disabledUsers);
+ $rows[] = ['disabled users', $disabledUsersCount];
+
$table->setRows($rows);
$table->render();
}
$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->query(\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()));