aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/User
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-04-09 15:47:40 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-04-09 15:47:40 +0200
commit5385a30970f3e168982be5554dbe618df363574c (patch)
tree7f7177e5467944093ac2dd8dc0dfba431723364f /core/Command/User
parente0fcf6b700f4233cfd1057e18ad9f3b41e4b9874 (diff)
downloadnextcloud-server-5385a30970f3e168982be5554dbe618df363574c.tar.gz
nextcloud-server-5385a30970f3e168982be5554dbe618df363574c.zip
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>
Diffstat (limited to 'core/Command/User')
-rw-r--r--core/Command/User/ListCommand.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/Command/User/ListCommand.php b/core/Command/User/ListCommand.php
index f25d6c2dae9..c30d2a55395 100644
--- a/core/Command/User/ListCommand.php
+++ b/core/Command/User/ListCommand.php
@@ -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;