diff options
author | Robin Appelman <robin@icewind.nl> | 2023-01-12 17:33:03 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2023-01-12 17:33:03 +0100 |
commit | 975becb22e5699b64f034ea6c3107376f46f2d80 (patch) | |
tree | ce7352652e487e8dd5d204c620a9d92e28661b9d /core/Command | |
parent | 8393ae27777777ff2ddcba10a9e124e36c30d634 (diff) | |
download | nextcloud-server-975becb22e5699b64f034ea6c3107376f46f2d80.tar.gz nextcloud-server-975becb22e5699b64f034ea6c3107376f46f2d80.zip |
normalize userid in user:setting
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/User/Setting.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/Command/User/Setting.php b/core/Command/User/Setting.php index 6e7c15375d1..fac5c3c976c 100644 --- a/core/Command/User/Setting.php +++ b/core/Command/User/Setting.php @@ -113,9 +113,14 @@ class Setting extends Base { } protected function checkInput(InputInterface $input) { - $uid = $input->getArgument('uid'); - if (!$input->getOption('ignore-missing-user') && !$this->userManager->userExists($uid)) { - throw new \InvalidArgumentException('The user "' . $uid . '" does not exist.'); + if (!$input->getOption('ignore-missing-user')) { + $uid = $input->getArgument('uid'); + $user = $this->userManager->get($uid); + if (!$user) { + throw new \InvalidArgumentException('The user "' . $uid . '" does not exist.'); + } + // normalize uid + $input->setArgument('uid', $user->getUID()); } if ($input->getArgument('key') === '' && $input->hasParameterOption('--default-value')) { |