mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
feat(occ): Add --disabled option to occ user:list
Allows to easily list disabled users from cli in a efficient way Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
e0fcf6b700
commit
5385a30970
1 changed files with 10 additions and 1 deletions
|
|
@ -45,6 +45,11 @@ class ListCommand extends Base {
|
|||
->setName('user:list')
|
||||
->setDescription('list configured users')
|
||||
->addOption(
|
||||
'disabled',
|
||||
'd',
|
||||
InputOption::VALUE_NONE,
|
||||
'List disabled users only'
|
||||
)->addOption(
|
||||
'limit',
|
||||
'l',
|
||||
InputOption::VALUE_OPTIONAL,
|
||||
|
|
@ -71,7 +76,11 @@ class ListCommand extends Base {
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue