From 2d0ada79f156cfca001f06278156ee4fea848837 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 16 Dec 2013 16:19:37 +0000 Subject: [PATCH] mkws_config.service_proxy_auth_domain no longer need be specified: it is extracted automatically from mkws_config.pazpar2_url if not given. --- tools/htdocs/mkws.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 8ebdb0b..d3adf6d 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -906,7 +906,8 @@ function mkws_html_all() { if (mkws_config.use_service_proxy) mkws_service_proxy_auth(mkws_config.service_proxy_auth, - mkws_config.service_proxy_auth_domain); + mkws_config.service_proxy_auth_domain, + mkws_config.pazpar2_url); if (mkws_config.responsive_design_width) { // Responsive web design - change layout on the fly based on @@ -1015,9 +1016,14 @@ function mkws_html_perpage() { * The username/password is configured in the apache config file * for the site. */ -function mkws_service_proxy_auth(auth_url, auth_domain) { +function mkws_service_proxy_auth(auth_url, auth_domain, pp2_url) { debug("Run service proxy auth URL: " + auth_url); + if (!auth_domain) { + auth_domain = pp2_url.replace(/^http:\/\/(.*?)\/.*/, '$1'); + debug("guessed auth_domain '" + auth_domain + "' from pp2_url '" + pp2_url + "'"); + } + var request = new pzHttpRequest(auth_url, function(err) { alert("HTTP call for authentication failed: " + err) return; -- 1.7.10.4