From ea5ae4b1cf1aa912ca4b88a7f2dbb59594b28cdb Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 3 May 2012 10:48:23 +0200 Subject: User password widget modified. Currently the user password is shown as follows in the details page: Password: Reset Password This is inconsistent with the rest of the page because the 'Reset Password' is an action, not the value of the password. Now password is shown as follows: Password: ******* (if set) Password: (if not set) Reset password link was removed as well the dialog for reset password was removed from password widget. The dialog was moved to its own object and can be now showed independently. An action for showing this dialog should be created. https://fedorahosted.org/freeipa/ticket/2248 --- install/ui/test/data/ipa_init.json | 1 + install/ui/user.js | 185 ++++++++++++++++++++++--------------- ipalib/plugins/internal.py | 1 + 3 files changed, 114 insertions(+), 73 deletions(-) diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index 7ceda5703..01201f69e 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -425,6 +425,7 @@ "current_password": "Current Password", "current_password_required": "Current password is required", "new_password": "New Password", + "new_password_required": "New password is required", "password_change_complete": "Password change complete", "password_must_match": "Passwords must match", "reset_password": "Reset Password", diff --git a/install/ui/user.js b/install/ui/user.js index 65d3de726..61db5315e 100644 --- a/install/ui/user.js +++ b/install/ui/user.js @@ -107,7 +107,8 @@ IPA.user.entity = function(spec) { 'uid', { factory: IPA.user_password_widget, - name: 'userpassword' + name: 'has_password', + metadata: IPA.get_entity_param('user', 'userpassword') }, { name: 'krbpasswordexpiration', @@ -430,118 +431,154 @@ IPA.user_adder_dialog = function(spec) { IPA.user_password_widget = function(spec) { spec = spec || {}; + spec.read_only = true; var that = IPA.input_widget(spec); + that.set_value = spec.set_value || '******'; + that.unset_value = spec.unset_value || ''; that.create = function(container) { that.widget_create(container); - $('', { - href: 'jslink', - title: 'userpassword', - text: IPA.messages.password.reset_password, - click: function() { - that.show_dialog(); - return false; - } + that.display_control = $('