summaryrefslogtreecommitdiffstats
path: root/settings/Controller/UsersController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-14 12:17:16 +0200
committerJoas Schilling <coding@schilljs.com>2017-06-14 12:17:16 +0200
commite62e7a201df19dcd09a022ea4923beaa92a4fc3c (patch)
tree061b883e03a773fe9c7dfaff99a12e7ad0b5de1f /settings/Controller/UsersController.php
parent0f8c1b13a39541fecdb149f41e9904d89a60ea64 (diff)
downloadnextcloud-server-e62e7a201df19dcd09a022ea4923beaa92a4fc3c.tar.gz
nextcloud-server-e62e7a201df19dcd09a022ea4923beaa92a4fc3c.zip
Use translated Hint instead of english error on password policy
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/Controller/UsersController.php')
-rw-r--r--settings/Controller/UsersController.php4
1 files changed, 4 insertions, 0 deletions
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.');
}