mirror of
https://github.com/nextcloud/server.git
synced 2026-04-05 09:06:35 -04:00
normalize userid in user:setting
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
8393ae2777
commit
975becb22e
1 changed files with 8 additions and 3 deletions
|
|
@ -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')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue