summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-01-07 16:28:06 +0100
committerRobin Appelman <robin@icewind.nl>2019-01-07 16:28:06 +0100
commit3991aa01662484012887b89fc12ded2650c1c8d7 (patch)
tree638a7b2e0838c2008fc249d7206b91ea27261b5a /apps/provisioning_api/lib
parent8508e296e38852a612816d07b954c3b0308028d8 (diff)
downloadnextcloud-server-3991aa01662484012887b89fc12ded2650c1c8d7.tar.gz
nextcloud-server-3991aa01662484012887b89fc12ded2650c1c8d7.zip
forward error message from password policy
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 27d66a83c81..e710cf6c668 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();