diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-10 11:05:26 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-11 12:08:00 +0300 |
commit | decb4789bbf3983713b7f4c9d7ee0e984a0b2ceb (patch) | |
tree | a0adafcc34e3944871a50ccd384ab24f13418808 /settings | |
parent | a3bdcfbb90494b7fefa7c8c39c092a8aef9bfce1 (diff) |
Pass on the error message from the user manager to the UI
Diffstat (limited to 'settings')
-rw-r--r-- | settings/controller/userscontroller.php | 6 | ||||
-rw-r--r-- | settings/js/users/users.js | 2 |
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 261d9a8eb52..02d3a25be70 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -825,7 +825,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(); }); |