From d7e790dd0710ee754ec49280910e19a8746e9b0c Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 26 Jul 2011 09:30:59 -0500 Subject: Fixed problem setting host OTP. The handler for host 'Set OTP' button has been modified to obtain the primary key from the entity and return false to stop the normal event processing. Ticket #1511 --- install/ui/host.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/install/ui/host.js b/install/ui/host.js index bbac4edd7..f5e9c74e5 100644 --- a/install/ui/host.js +++ b/install/ui/host.js @@ -246,8 +246,6 @@ IPA.host_provisioning_status_widget = function (spec) { var that = IPA.widget(spec); - that.facet = spec.facet; - that.create = function(container) { that.widget_create(container); @@ -326,8 +324,11 @@ IPA.host_provisioning_status_widget = function (spec) { var button = $('input[name=unprovision]', that.container); that.unprovision_button = IPA.button({ name: 'unprovision', - 'label': IPA.messages.objects.host.delete_key_unprovision, - 'click': that.show_unprovision_dialog + label: IPA.messages.objects.host.delete_key_unprovision, + click: function() { + that.show_unprovision_dialog(); + return false; + } }); button.replaceWith(that.unprovision_button); @@ -336,8 +337,11 @@ IPA.host_provisioning_status_widget = function (spec) { that.enroll_button = $('input[name=enroll]', that.container); button = IPA.button({ name: 'enroll', - 'label': IPA.messages.objects.host.set_otp, - 'click': that.set_otp + label: IPA.messages.objects.host.set_otp, + click: function() { + that.set_otp(); + return false; + } }); that.enroll_button.replaceWith(button); @@ -373,13 +377,12 @@ IPA.host_provisioning_status_widget = function (spec) { dialog.init(); dialog.open(that.container); - - return false; }; that.unprovision = function(on_success, on_error) { - var pkey = that.facet.get_primary_key(); + var entity = IPA.get_entity(that.entity_name); + var pkey = entity.get_primary_key(); var command = IPA.command({ name: that.entity_name+'_disable_'+pkey, @@ -396,7 +399,8 @@ IPA.host_provisioning_status_widget = function (spec) { that.set_otp = function() { - var pkey = that.facet.get_primary_key(); + var entity = IPA.get_entity(that.entity_name); + var pkey = entity.get_primary_key(); var otp = that.otp_input.val(); that.otp_input.val(''); -- cgit