Skip to content

Commit

Permalink
Merge pull request #44753 from nextcloud/feat/add-disabled-option-for…
Browse files Browse the repository at this point in the history
…-user-list

feat(occ): Add --disabled option to occ user:list
  • Loading branch information
Pytal authored Apr 9, 2024
2 parents e0fcf6b + 5385a30 commit beb839b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/Command/User/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ protected function configure() {
->setName('user:list')
->setDescription('list configured users')
->addOption(
'disabled',
'd',
InputOption::VALUE_NONE,
'List disabled users only'
)->addOption(
'limit',
'l',
InputOption::VALUE_OPTIONAL,
Expand All @@ -71,7 +76,11 @@ protected function configure() {
}

protected function execute(InputInterface $input, OutputInterface $output): int {
$users = $this->userManager->searchDisplayName('', (int) $input->getOption('limit'), (int) $input->getOption('offset'));
if ($input->getOption('disabled')) {
$users = $this->userManager->getDisabledUsers((int) $input->getOption('limit'), (int) $input->getOption('offset'));
} else {
$users = $this->userManager->searchDisplayName('', (int) $input->getOption('limit'), (int) $input->getOption('offset'));
}

$this->writeArrayInOutputFormat($input, $output, $this->formatUsers($users, (bool)$input->getOption('info')));
return 0;
Expand Down

0 comments on commit beb839b

Please sign in to comment.