From c5ce14c83ac6c00f2db9d1b43273c25b8282c873 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 3 Aug 2011 15:26:54 -0500 Subject: Fixed error after login on IE The IE does not resend the request body during negotiation, so after after a successful authentication the server could not find the JSON request to parse. The Web UI has been modified to detect this error and resend the initialization request. Ticket #1540 --- install/ui/ipa.js | 74 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 13 deletions(-) (limited to 'install/ui/ipa.js') diff --git a/install/ui/ipa.js b/install/ui/ipa.js index d53ee7b12..8a3dd4e7d 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -70,8 +70,35 @@ var IPA = ( function () { var batch = IPA.batch_command({ name: 'ipa_init', + retry: false, on_success: on_success, - on_error: on_error + on_error: function(xhr, text_status, error_thrown) { + + // On IE the request is missing after authentication, + // so the request needs to be resent. + if (error_thrown.name == 'IPA Error 909') { + batch.execute(); + + } else { + var ajax = this; + + var dialog = IPA.error_dialog({ + xhr: xhr, + text_status: text_status, + error_thrown: error_thrown, + command: batch + }); + + dialog.on_cancel = function() { + dialog.close(); + if (on_error) { + on_error.call(ajax, xhr, text_status, error_thrown); + } + }; + + dialog.open(); + } + } }); batch.add_command(IPA.command({ @@ -243,12 +270,23 @@ IPA.command = function(spec) { that.execute = function() { function dialog_open(xhr, text_status, error_thrown) { + + var ajax = this; + var dialog = IPA.error_dialog({ xhr: xhr, text_status: text_status, error_thrown: error_thrown, command: that }); + + dialog.on_cancel = function() { + dialog.close(); + if (that.on_error) { + that.on_error.call(ajax, xhr, text_status, error_thrown); + } + }; + dialog.open(); } @@ -399,6 +437,7 @@ IPA.batch_command = function (spec) { method: that.method, args: that.args, options: that.options, + retry: that.retry, on_success: function(data, text_status, xhr) { for (var i=0; i