diff options
Diffstat (limited to 'core/Command/User/ResetPassword.php')
-rw-r--r-- | core/Command/User/ResetPassword.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php index 798f5dad585..174a9f4068d 100644 --- a/core/Command/User/ResetPassword.php +++ b/core/Command/User/ResetPassword.php @@ -27,8 +27,10 @@ */ namespace OC\Core\Command\User; +use OC\Core\Command\Base; +use OCP\IUser; use OCP\IUserManager; -use Symfony\Component\Console\Command\Command; +use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -37,7 +39,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; -class ResetPassword extends Command { +class ResetPassword extends Base { /** @var IUserManager */ protected $userManager; @@ -133,4 +135,16 @@ class ResetPassword extends Command { } return 0; } + + /** + * @param string $argumentName + * @param CompletionContext $context + * @return string[] + */ + public function completeArgumentValues($argumentName, CompletionContext $context) { + if ($argumentName === 'user') { + return array_map(static fn (IUser $user) => $user->getUID(), $this->userManager->search($context->getCurrentWord())); + } + return []; + } } |