X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=3316f28b013817623e7e2678b8acdeed4a90d39c;hb=87b0570da13378210bbf9f1a0e90752194f7db39;hp=3632a643871ae9ab2ff427fc1edf9939cd177209;hpb=779b8c03f3340a2a02753f6276438514ad6fa0ec;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index 3632a64..3316f28 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -14,6 +14,7 @@ window.mkws = { $: $, // Our own local copy of the jQuery object authenticated: false, + authenticating: false, active: false, log_level: 1, // Will be overridden from mkws.config, but // initial value allows jQuery popup to use logging. @@ -445,6 +446,7 @@ mkws.pagerNext = function(tname) { * for the site. */ function authenticateSession(auth_url, auth_domain, pp2_url) { + mkws.authenticating = true; log("service proxy authentication on URL: " + auth_url); if (!auth_domain) { @@ -458,6 +460,7 @@ mkws.pagerNext = function(tname) { }, auth_domain); request.get(null, function(data) { + mkws.authenticating = false; if (!$.isXMLDoc(data)) { alert("Service Proxy authentication response is not a valid XML document"); return; @@ -650,14 +653,12 @@ mkws.pagerNext = function(tname) { } */ - if (mkws.config.use_service_proxy) { - if (!mkws.authenticated) { - authenticateSession(mkws.config.service_proxy_auth, - mkws.config.service_proxy_auth_domain, - mkws.config.pazpar2_url); - } - } else { - // raw pp2 + if (mkws.config.use_service_proxy && !mkws.authenticated && !mkws.authenticating) { + authenticateSession(mkws.config.service_proxy_auth, + mkws.config.service_proxy_auth_domain, + mkws.config.pazpar2_url); + } else if (!mkws.authenticating) { + // raw pp2 or we have a session already open runAutoSearches(); }