From 917ca1caf2be691307866963e83ef9a5047d741d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 7 Jan 2019 16:28:06 +0100 Subject: [PATCH] forward error message from password policy Signed-off-by: Robin Appelman --- apps/provisioning_api/lib/Controller/UsersController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 86b8cf951b..edb42efa2c 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -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();