summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2016-05-11 19:41:13 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-05-11 19:41:13 +0200
commitbc1d70f08c4042c457dc3e1bf25c5a34412ac2fb (patch)
treebb573a3135f533cabddc6fa79e93ba5d1714a2eb
parentee0ebd192a394e4f9d4c9dd2c78b1b4d6a211c7a (diff)
downloadnextcloud-server-bc1d70f08c4042c457dc3e1bf25c5a34412ac2fb.tar.gz
nextcloud-server-bc1d70f08c4042c457dc3e1bf25c5a34412ac2fb.zip
Pass on the error message from the user manager to the UI (#24526)
-rw-r--r--settings/Controller/UsersController.php6
-rw-r--r--settings/js/users/users.js2
2 files changed, 6 insertions, 2 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index f5b7f2d2e5d..5f74eaa82fb 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -355,9 +355,13 @@ class UsersController extends Controller {
try {
$user = $this->userManager->createUser($username, $password);
} catch (\Exception $exception) {
+ $message = $exception->getMessage();
+ if (!$message) {
+ $message = $this->l10n->t('Unable to create user.');
+ }
return new DataResponse(
array(
- 'message' => (string)$this->l10n->t('Unable to create user.')
+ 'message' => (string) $message,
),
Http::STATUS_FORBIDDEN
);
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 9706ac9fbcd..03f471bc3b4 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -840,7 +840,7 @@ $(document).ready(function () {
}).fail(function(result) {
OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
message: result.responseJSON.message
- }));
+ }, undefined, {escape: false}));
}).success(function(){
$('#newuser').get(0).reset();
});