Skip to content

Commit e7af913

Browse files
committed
feat(objectstore): get multibucket mappings for all users with --all
Signed-off-by: Kent Delante <[email protected]>
1 parent 655c14e commit e7af913

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/files/lib/Command/Object/Multi/Users.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ protected function configure(): void {
3333
->setDescription('Get the mapping between users and object store buckets')
3434
->addOption('bucket', 'b', InputOption::VALUE_REQUIRED, 'Only list users using the specified bucket')
3535
->addOption('object-store', 'o', InputOption::VALUE_REQUIRED, 'Only list users using the specified object store configuration')
36-
->addOption('user', 'u', InputOption::VALUE_REQUIRED, 'Only show the mapping for the specified user, ignores all other options');
36+
->addOption('user', 'u', InputOption::VALUE_REQUIRED, 'Only show the mapping for the specified user, ignores all other options')
37+
->addOption('all', 'a', InputOption::VALUE_NONE, 'Show the mapping for all users');
3738
}
3839

3940
public function execute(InputInterface $input, OutputInterface $output): int {
40-
if ($userId = $input->getOption('user')) {
41+
if ($input->getOption('all')) {
42+
$users = $this->userManager->getSeenUsers();
43+
} elseif ($userId = $input->getOption('user')) {
4144
$user = $this->userManager->get($userId);
4245
if (!$user) {
4346
$output->writeln("<error>User $userId not found</error>");
@@ -57,7 +60,7 @@ public function execute(InputInterface $input, OutputInterface $output): int {
5760
$this->config->getUsersForUserValue('homeobjectstore', 'objectstore', $objectStore)
5861
));
5962
} else {
60-
$users = $this->userManager->getSeenUsers();
63+
return 0;
6164
}
6265
}
6366

0 commit comments

Comments
 (0)