diff --git a/plugins/change-password/drivers/pdo.php b/plugins/change-password/drivers/pdo.php index 9b7078d87..6c535aac7 100644 --- a/plugins/change-password/drivers/pdo.php +++ b/plugins/change-password/drivers/pdo.php @@ -107,6 +107,7 @@ class ChangePasswordDriverPDO } catch (\Exception $oException) { + \SnappyMail\Log::error('change-password', $oException->getMessage()); if ($this->oLogger) { $this->oLogger->WriteException($oException); } diff --git a/plugins/change-password/js/ChangePasswordUserSettings.js b/plugins/change-password/js/ChangePasswordUserSettings.js index bee0b33f2..c76a9b428 100644 --- a/plugins/change-password/js/ChangePasswordUserSettings.js +++ b/plugins/change-password/js/ChangePasswordUserSettings.js @@ -63,9 +63,28 @@ } else { this.reset(true); rl.pluginRemoteRequest( - (...args) => { - console.dir(...args); - this.onChangePasswordResponse(...args); + (iError, data) { + this.reset(false); + if (iError) { + this.passwordUpdateError(true); + if (131 === iError) { + // Notification.CurrentPasswordIncorrect + this.currentPasswordError(true); + } + this.errorDescription((data && rl.i18n(data.ErrorMessageAdditional)) + || rl.i18n('NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD')); + } else { + this.currentPassword(''); + this.newPassword(''); + this.newPassword2(''); + this.passwordUpdateSuccess(true); +/* + const refresh = rl.app.refresh; + rl.app.refresh = ()=>{}; + rl.setData(data.Result); + rl.app.refresh = refresh; +*/ + } }, 'ChangePassword', { @@ -101,30 +120,6 @@ this.newPassword(''); this.newPassword2(''); } - - onChangePasswordResponse(iError, data) { - this.reset(false); - if (iError) { - this.passwordUpdateError(true); - if (131 === iError) { - // Notification.CurrentPasswordIncorrect - this.currentPasswordError(true); - } - this.errorDescription((data && rl.i18n(data.ErrorMessageAdditional)) - || rl.i18n('NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD')); - } else { - this.currentPassword(''); - this.newPassword(''); - this.newPassword2(''); - this.passwordUpdateSuccess(true); -/* - const refresh = rl.app.refresh; - rl.app.refresh = ()=>{}; - rl.setData(data.Result); - rl.app.refresh = refresh; -*/ - } - } } rl.addSettingsViewModel(