diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-05-13 17:11:55 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-13 17:11:55 +0300 |
commit | 27b12d29011a15002a47178fcb3219cd3cd7dfa5 (patch) | |
tree | 066710989658db9ae767b78f6a55d1d50b49342a /settings | |
parent | f8979a9ee2bf76bc146b0723283f05c027da8bde (diff) | |
parent | decb4789bbf3983713b7f4c9d7ee0e984a0b2ceb (diff) |
Merge pull request #24530 from owncloud/backport-24526-forward-user-manager-error-messages-to-ui
[9.0] 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(); }); |