diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/CreateUserController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/CreateUserController.js index c493b4a99297da18ca38fbca344b30f13e0bf365..369a0b5117b89e77814554b57eedbeb9168acd0f 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/CreateUserController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/CreateUserController.js @@ -54,7 +54,7 @@ function CreateUserController() { } }); } else { - Util.showError("Passwords are not equal.", function() {}); + Util.showError("Passwords are not equal."); } } diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordController.js index 1fb21c58d5a19457c5e3583f578bb47bd032b436..8aaa6bb9b3f467683ee33963841ba887bec0b87e 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordController.js @@ -20,16 +20,21 @@ function ResetPasswordController(userId) { this.resetPassword = function() { var _this = this; - mainController.serverFacade.registerUserPassword( - _this._resetPasswordModel.userId, - _this._resetPasswordModel.password, - function(isRegistered) { - if(isRegistered) { - Util.showSuccess("Password has been reset on the file authentication service."); - } else { - Util.showError("Password can't be reset."); - } - }); + + if(_this._createUserModel.password === _this._createUserModel.passwordRepeat) { + mainController.serverFacade.registerUserPassword( + _this._resetPasswordModel.userId, + _this._resetPasswordModel.password, + function(isRegistered) { + if(isRegistered) { + Util.showSuccess("Password has been reset on the file authentication service."); + } else { + Util.showError("Password can't be reset."); + } + }); + } else { + Util.showError("Passwords are not equal."); + } } this.init = function() { diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordModel.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordModel.js index 64cda7fdf31380f090ee95c9c4814cc5c9ddefc2..8e26f49a055f004e15148b8d1c76c309fa451a75 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordModel.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordModel.js @@ -17,4 +17,5 @@ function ResetPasswordModel(userId) { this.userId = userId; this.password = null; + this.passwordRepeat = null; } \ No newline at end of file diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordView.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordView.js index 23a0dfb849c9598468507a588faea39a213815c7..9ba118b37488f117abe2c3271779a1b56fe8e5f1 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordView.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/UserManager/modal/ResetPasswordView.js @@ -49,13 +49,20 @@ function ResetPasswordView(resetPasswordController, resetPasswordModel) { // // Password // - var $passField = FormUtil._getInputField('text', null, 'Password', null, true); + var $passField = FormUtil._getInputField('password', null, 'Password', null, true); $passField.change(function(event) { _this._resetPasswordModel.password = $(this).val(); }); var $passwordGroup = FormUtil.getFieldForComponentWithLabel($passField, "Password", null); $window.append($passwordGroup); + var $passFieldRepeat = FormUtil._getInputField('password', null, 'Repeat the same password', null, true); + $passFieldRepeat.change(function(event) { + _this._resetPasswordModel.passwordRepeat = $(this).val(); + }); + var $passwordGroupRepeat = FormUtil.getFieldForComponentWithLabel($passFieldRepeat, "Password Repeat", null); + $window.append($passwordGroupRepeat); + // // Buttons //