summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2023-01-19 17:45:01 +0100
committerGitHub <noreply@github.com>2023-01-19 17:45:01 +0100
commita25645648e7153ed25b93ed5265cd8f0f6799c3a (patch)
tree790f56a767a794c2004077d04e2e5cff21543934 /core
parent6be58756f41835d9c880222978b405766d3134ec (diff)
parent975becb22e5699b64f034ea6c3107376f46f2d80 (diff)
downloadnextcloud-server-a25645648e7153ed25b93ed5265cd8f0f6799c3a.tar.gz
nextcloud-server-a25645648e7153ed25b93ed5265cd8f0f6799c3a.zip
Merge pull request #36123 from nextcloud/user-settings-normalize-uid
normalize userid in user:setting
Diffstat (limited to 'core')
-rw-r--r--core/Command/User/Setting.php11
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')) {