From e433379c469ab8dba80cb76f906d794e4f61b132 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 25 Oct 2012 13:42:18 +0200 Subject: Standardize login password reset, user reset password and host set OTP dialogs In all dialogs: * validation notification was standardized * can be confirmed by enter User pwd dialog has fixed focus of first element. https://fedorahosted.org/freeipa/ticket/2884 https://fedorahosted.org/freeipa/ticket/3200 Standartize password reset dialog --- install/ui/ipa.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'install/ui/ipa.js') diff --git a/install/ui/ipa.js b/install/ui/ipa.js index fa26a2ad..cc62f089 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -1672,7 +1672,10 @@ IPA.unauthorized_dialog = function(spec) { name: 'verify_password', type: 'password', required: true, - label: IPA.get_message('password.verify_password', "Verify Password") + label: IPA.get_message('password.verify_password', "Verify Password"), + validators: [IPA.same_password_validator({ + other_field: 'new_password' + })] } ] } @@ -1946,24 +1949,12 @@ IPA.unauthorized_dialog = function(spec) { var new_password = that.new_password_widget.save(); var verify_password = that.verify_password_widget.save(); - if (new_password[0] !== verify_password[0]) { - var message = IPA.get_message('password.password_must_match', - "Passwords must match"); - that.reset_error_box.html(message); - that.reset_error_box.css('display', 'block'); - return; - } else { - that.reset_error_box.css('display', 'none'); - } - - IPA.display_activity_icon(); + that.reset_error_box.css('display', 'none'); var result = IPA.reset_password(username[0], password[0], new_password[0]); - IPA.hide_activity_icon(); - if (result.status === 'ok') { that.on_reset_success(); } else { -- cgit