svn commit: r157 - trunk/mapbender/owsproxy/http/index.php

uli at osgeo.org uli at osgeo.org
Fri Apr 28 11:00:24 EDT 2006


Author: uli
Date: 2006-04-28 15:00:24+0000
New Revision: 157

Modified:
   trunk/mapbender/owsproxy/http/index.php

Log:
replacement of onlineresources in capablities-documents included

Modified: trunk/mapbender/owsproxy/http/index.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/owsproxy/http/index.php?view=diff&rev=157&p1=trunk/mapbender/owsproxy/http/index.php&p2=trunk/mapbender/owsproxy/http/index.php&r1=156&r2=157
==============================================================================
--- trunk/mapbender/owsproxy/http/index.php	(original)
+++ trunk/mapbender/owsproxy/http/index.php	2006-04-28 15:00:24+0000
@@ -6,10 +6,9 @@
 $imageformats = array("image/png","image/gif","image/jpeg", "image/jpg");
 /***** conf *****/
 
-
 $myKeys = array_keys($_REQUEST);
 for($i=0; $i<count($myKeys); $i++){
-	$tmp[$i] = strtolower($myKeys[$i]);
+	$tmp[$i] = removeQM(strtolower($myKeys[$i]));
 	$$tmp[$i]  = $_REQUEST[$myKeys[$i]];
 }
 
@@ -32,7 +31,11 @@
 $t = array("s");
 $res = db_prep_query($sql, $v, $t);
 if($row = db_fetch_array($res)){
-	$wms_id = $row["wms_id"];	
+	$wms_id = $row["wms_id"];
+	$wms_getcapabilities = $row["wms_getcapabilities"];	
+	$wms_getmap = $row["wms_getmap"];
+	$wms_getfeatureinfo = $row["wms_getfeatureinfo"];
+	$wms_getcapabilities_doc = $row["wms_getcapabilities_doc"];
 }
 else{
 	throwE(array("No wms data available."));
@@ -47,9 +50,14 @@
 /*************  prepare and send the response ************/
 $or = $n->checkURL($row["wms_getmap"]);
 $or = completeURL($or);
-sendResponse($or);
-
-
+switch (strtolower($request)) {
+	case 'getcapabilities':
+		getCapabilities($or);
+		break;
+	default:
+		sendResponse($or);
+}
+/*********************************************************/
 function throwE($e){
 	global $format, $imageformats;
 	if(in_array($format,$imageformats)){
@@ -109,4 +117,13 @@
 	if($format == 'image/gif'){header("Content-Type: image/gif");}
 	readfile($or);
 }
+function getCapabilities($url){
+	global $wms_getcapabilities,$wms_getmap,$wms_getfeatureinfo,$wms_getcapabilities_doc;
+	global $sid,$wms;
+	$t = array(htmlentities($wms_getcapabilities),htmlentities($wms_getmap),htmlentities($wms_getfeatureinfo));
+	$new = OWSPROXY ."/". $sid ."/".$wms."?";
+	$r = str_replace($t,$new,$wms_getcapabilities_doc);
+	header("Content-Type: application/xml");
+	echo $r;
+}
 ?>
\ No newline at end of file




More information about the Mapbender_commits mailing list