Merge pull request #13921 from nextcloud/backport/13412/stable14

[stable14] forward error message from password policy
This commit is contained in:
Morris Jobke 2019-01-30 15:24:31 +01:00 committed by GitHub
commit 257f9c4a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -512,7 +512,11 @@ class UsersController extends AUserData {
$targetUser->setQuota($quota);
break;
case 'password':
$targetUser->setPassword($value);
try {
$targetUser->setPassword($value);
} catch (HintException $e) { // password policy error
throw new OCSException($e->getMessage(), 103);
}
break;
case 'language':
$languagesCodes = $this->l10nFactory->findAvailableLanguages();