From 461318de191119b655fe204288147166941cc63c Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Tue, 13 Oct 2020 12:09:35 +0200 Subject: [PATCH] fix: [UI] Show warning if notification when creating new user could not be send --- app/Controller/UsersController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php index 4bccd7bfe..4eb2d43c2 100644 --- a/app/Controller/UsersController.php +++ b/app/Controller/UsersController.php @@ -751,7 +751,9 @@ class UsersController extends AppController $password = isset($this->request->data['User']['password']) ? $this->request->data['User']['password'] : false; $result = $this->User->initiatePasswordReset($user, true, true, $password); if ($result && empty(Configure::read('MISP.disable_emailing'))) { - $notification_message .= ' User notified of new credentials.'; + $notification_message .= ' ' . __('User notified of new credentials.'); + } else { + $notification_message .= ' ' . __('User notification of new credentials could not be send.'); } } if ($this->_isRest()) { @@ -762,7 +764,7 @@ class UsersController extends AppController $user['User']['password'] = '******'; return $this->RestResponse->viewData($user, $this->response->type()); } else { - $this->Flash->success(__('The user has been saved.' . $notification_message)); + $this->Flash->success(__('The user has been saved.') . $notification_message); $this->redirect(array('action' => 'index')); } } else {