]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make JS aware of password verification
authorLukas Reschke <lukas@statuscode.ch>
Fri, 18 Nov 2016 17:34:01 +0000 (18:34 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 21 Nov 2016 10:30:02 +0000 (11:30 +0100)
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
settings/Controller/UsersController.php
settings/js/federationsettingsview.js

index 8f077270392bce032708784544697b9058f559fd..77d65877ba342d56b0ffa6e74cf209e73af25920 100644 (file)
@@ -672,6 +672,7 @@ class UsersController extends Controller {
         * @todo merge into saveUserSettings
         *
         * @NoAdminRequired
+        * @PasswordConfirmationRequired
         *
         * @param string $username
         * @param string $displayName
index 7aaa225a8610223616f5ec650b969b42f2bcb888..e42828ca456d538316548ee0389a9aceaa547937 100644 (file)
                _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);