From e667b31df549a9e8bd749dc6999b1526fec52d5f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 14 Jun 2017 12:17:16 +0200 Subject: [PATCH] Use translated Hint instead of english error on password policy Signed-off-by: Joas Schilling --- settings/Controller/UsersController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index e217e189463..36ac263b8cd 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -33,6 +33,7 @@ namespace OC\Settings\Controller; use OC\Accounts\AccountManager; use OC\AppFramework\Http; use OC\ForbiddenException; +use OC\HintException; use OC\Settings\Mailer\NewUserMailHelper; use OC\Security\IdentityProof\Manager; use OCP\App\IAppManager; @@ -406,6 +407,9 @@ class UsersController extends Controller { $user = $this->userManager->createUser($username, $password); } catch (\Exception $exception) { $message = $exception->getMessage(); + if ($exception instanceof HintException && $exception->getHint()) { + $message = $exception->getHint(); + } if (!$message) { $message = $this->l10n->t('Unable to create user.'); } -- 2.39.5