diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2017-07-05 22:18:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-05 22:18:49 +0200 |
commit | 75f97852b419c9ced6339b960a4ddc3f01f5e213 (patch) | |
tree | 9082418023ab3f4b08bbed140f3d700d7167ef74 | |
parent | 60398b919be713ddb1813956061fee638c54317a (diff) | |
parent | e62e7a201df19dcd09a022ea4923beaa92a4fc3c (diff) | |
download | nextcloud-server-75f97852b419c9ced6339b960a4ddc3f01f5e213.tar.gz nextcloud-server-75f97852b419c9ced6339b960a4ddc3f01f5e213.zip |
Merge pull request #5404 from nextcloud/use-translated-hint-insteadof-english-error
Use translated Hint instead of english error on password policy
-rw-r--r-- | settings/Controller/UsersController.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 102eb615847..a193f9bc8de 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; @@ -423,6 +424,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.'); } |