From a0c64044b25ab4d6a80ac9bcf3084a8166de6e19 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 18 Nov 2016 18:34:01 +0100 Subject: [PATCH] Make JS aware of password verification Signed-off-by: Lukas Reschke --- settings/Controller/UsersController.php | 1 + settings/js/federationsettingsview.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 8f077270392..77d65877ba3 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -672,6 +672,7 @@ class UsersController extends Controller { * @todo merge into saveUserSettings * * @NoAdminRequired + * @PasswordConfirmationRequired * * @param string $username * @param string $displayName diff --git a/settings/js/federationsettingsview.js b/settings/js/federationsettingsview.js index 7aaa225a861..e42828ca456 100644 --- a/settings/js/federationsettingsview.js +++ b/settings/js/federationsettingsview.js @@ -90,10 +90,18 @@ _onInputChanged: function(e) { var self = this; + var $dialog = $('.oc-dialog:visible'); + if (OC.PasswordConfirmation.requiresPasswordConfirmation()) { + if($dialog.length === 0) { + OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this._onInputChanged, this, e)); + } + return; + } var $target = $(e.target); var value = $target.val(); var field = $target.attr('id'); this._config.set(field, value); + var savingData = this._config.save({ error: function(jqXHR) { OC.msg.finishedSaving('#personal-settings-container .msg', jqXHR); -- 2.39.5