[Mapbender-commits] r8542 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 17 06:57:50 PST 2013


Author: armin11
Date: 2013-01-17 06:57:50 -0800 (Thu, 17 Jan 2013)
New Revision: 8542

Modified:
   trunk/mapbender/http/php/mod_wmc2ol.php
Log:
Show owsproxy secured wms in openlayers client.

Modified: trunk/mapbender/http/php/mod_wmc2ol.php
===================================================================
--- trunk/mapbender/http/php/mod_wmc2ol.php	2013-01-17 12:51:03 UTC (rev 8541)
+++ trunk/mapbender/http/php/mod_wmc2ol.php	2013-01-17 14:57:50 UTC (rev 8542)
@@ -388,9 +388,11 @@
 		$has_permission=$admin->getLayerPermission($wms_id, $layer_name, $userId);
 		if ($has_permission || $layer_id==''){
 			$getMapUrl = $xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href;
-			if (getWmsGetMapUrl($wms_id) != false) {
-				$e = new mb_notice("mod_wmc2ol.php: update GetMap found in database - change url to :".$getMapUrl);
-				$getMapUrl = getWmsGetMapUrl($wms_id);
+			if (strpos($getMapUrl, OWSPROXY) === false) {
+				if (getWmsGetMapUrl($wms_id) != false) {
+					$e = new mb_notice("mod_wmc2ol.php: update GetMap found in database - change url to :".$getMapUrl);
+					$getMapUrl = getWmsGetMapUrl($wms_id);
+				}
 			}
 			$html.="		\"".$getMapUrl."\",\n";
 			$html.="		{\n";
@@ -457,9 +459,11 @@
 			($layer_id=='' && $xml->LayerList->Layer[$i]->attributes()->hidden=='0')){
 			$html.="	layer".$i." = new OpenLayers.Layer.WMS( \"".$xml->LayerList->Layer[$i]->Title."\",\n";
 			$getMapUrl = $xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href;
-			if (getWmsGetMapUrl($wms_id) != false) {
-				$e = new mb_notice("mod_wmc2ol.php: update GetMap found in database - change url to :".$getMapUrl);
-				$getMapUrl = getWmsGetMapUrl($wms_id);
+			if (strpos($getMapUrl, OWSPROXY) === false) {
+				if (getWmsGetMapUrl($wms_id) != false) {
+					$e = new mb_notice("mod_wmc2ol.php: update GetMap found in database - change url to :".$getMapUrl);
+					$getMapUrl = getWmsGetMapUrl($wms_id);
+				}
 			}
 			$html.="		\"".$getMapUrl."\",\n";
 			$html.="		{\n";



More information about the Mapbender_commits mailing list