[Mapbender-commits] r8760 - trunk/mapbender/http_auth/http

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jan 24 01:49:12 PST 2014


Author: armin11
Date: 2014-01-24 01:49:11 -0800 (Fri, 24 Jan 2014)
New Revision: 8760

Modified:
   trunk/mapbender/http_auth/http/index.php
Log:
Exchange http with https if set in HTTP_AUTH_PROXY

Modified: trunk/mapbender/http_auth/http/index.php
===================================================================
--- trunk/mapbender/http_auth/http/index.php	2014-01-22 16:52:18 UTC (rev 8759)
+++ trunk/mapbender/http_auth/http/index.php	2014-01-24 09:49:11 UTC (rev 8760)
@@ -463,6 +463,7 @@
 	$new = "http_auth/". $layerId."?";
         $pattern = "#owsproxy/[a-z0-9]{32}\/[a-z0-9]{32}\?#m";
 	$httpAuthUrl = preg_replace($pattern,$new,$owsUrl);
+	//replace 
 	//also replace the getcapabilities url with authenticated one ;-)
 	if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != '') {
 		$wmsUrl = parse_url(MAPBENDER_PATH);
@@ -472,6 +473,14 @@
 		$pattern = "#mapbender/php/wms.php\?layer_id=".$layerId."&#m";
 	}
 	$httpAuthUrl = preg_replace($pattern,"/".$new,$httpAuthUrl);
+	//use always https for url
+	if (defined("HTTP_AUTH_PROXY") && HTTP_AUTH_PROXY != '') {
+		$parsed_url = parse_url(HTTP_AUTH_PROXY);
+		if ($parsed_url['scheme'] == "https") {
+			$httpAuthUrl = preg_replace("#http:#","https:",$httpAuthUrl);
+			$httpAuthUrl = preg_replace("#:80/#",":443/",$httpAuthUrl);
+		}
+	}
 	return $httpAuthUrl;
 }
 



More information about the Mapbender_commits mailing list