]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use translated Hint instead of english error on password policy 5434/head
authorJoas Schilling <coding@schilljs.com>
Wed, 14 Jun 2017 10:17:16 +0000 (12:17 +0200)
committerJoas Schilling <coding@schilljs.com>
Fri, 16 Jun 2017 08:44:46 +0000 (10:44 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
settings/Controller/UsersController.php

index e217e189463d26dc7ccec101b7cd789637e19e92..36ac263b8cd83900ab958d69d1e1fc318ee8db12 100644 (file)
@@ -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.');
                        }