[Mapbender-commits] r2376 - branches/2.5/http/sld

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Apr 10 19:06:36 EDT 2008


Author: mschulz
Date: 2008-04-10 19:06:36 -0400 (Thu, 10 Apr 2008)
New Revision: 2376

Modified:
   branches/2.5/http/sld/sld_config.php
   branches/2.5/http/sld/sld_edit_filter.php
   branches/2.5/http/sld/sld_filter_parse.php
   branches/2.5/http/sld/sld_main.php
   branches/2.5/http/sld/sld_parse.php
Log:
added mb_validateSession urlParameters to sld related urls

Modified: branches/2.5/http/sld/sld_config.php
===================================================================
--- branches/2.5/http/sld/sld_config.php	2008-04-10 23:01:35 UTC (rev 2375)
+++ branches/2.5/http/sld/sld_config.php	2008-04-10 23:06:36 UTC (rev 2376)
@@ -25,14 +25,12 @@
  */
 
 include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-
-session_start();
-
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 include_once(dirname(__FILE__)."/sld_parse.php");
 
 // this should come from mapbender.conf
-$SLD_MAIN = "sld_main.php?".SID;
-$SLD_FUNCTION_HANDLER = "sld_function_handler.php";
+$SLD_MAIN = "sld_main.php?".$urlParameters;
+$SLD_FUNCTION_HANDLER = "sld_function_handler.php?".$urlParameters;
 $MAPBENDER_URL = "http://".$_SERVER["HTTP_HOST"].dirname($_SERVER['PHP_SELF']);
 
 function char_encode($s){
@@ -42,15 +40,15 @@
 	return $s;
 }
 
-if (isset($_REQUEST["wms_id"]) && isset($_REQUEST["gui_id"]))
+if (isset($_REQUEST["sld_wms_id"]) && isset($_REQUEST["sld_gui_id"]))
 {
-	$_SESSION["sld_wms_id"] = $_REQUEST["wms_id"];
-	$_SESSION["sld_gui_id"] = $_REQUEST["gui_id"];
+	$_SESSION["sld_wms_id"] = $_REQUEST["sld_wms_id"];
+	$_SESSION["sld_gui_id"] = $_REQUEST["sld_gui_id"];
 }
 
-if (isset($_REQUEST["layer_name"]))
+if (isset($_REQUEST["sld_layer_name"]))
 {
-	$_SESSION["sld_layer_name"] = $_REQUEST["layer_name"];
+	$_SESSION["sld_layer_name"] = $_REQUEST["sld_layer_name"];
 }
 
 if (isset($_SESSION["sld_wms_id"]) && isset($_SESSION["sld_layer_name"]))

Modified: branches/2.5/http/sld/sld_edit_filter.php
===================================================================
--- branches/2.5/http/sld/sld_edit_filter.php	2008-04-10 23:01:35 UTC (rev 2375)
+++ branches/2.5/http/sld/sld_edit_filter.php	2008-04-10 23:06:36 UTC (rev 2376)
@@ -31,7 +31,7 @@
 
 
 include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-session_start();
+require_once(dirname(__FILE__)."/sld_config.php");
 include_once(dirname(__FILE__)."/sld_filter_parse.php");
 
 //get the neccessary variables from the request or from the session
@@ -91,22 +91,22 @@
 					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new UnaryLogicOp("Not");
 					break;
 				case "PROPERTYISEQUALTO":
-					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsEqualTo");
+					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsEqualTo");
 					break;
 				case "PROPERTYISNOTEQUALTO":
-					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsNotEqualTo");
+					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsNotEqualTo");
 					break;
 				case "PROPERTYISGREATERTHAN":
-					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsGreaterThan");
+					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsGreaterThan");
 					break;
 				case "PROPERTYISGREATERTHANOREQUALTO":
-					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsGreaterThanOrEqualTo");
+					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsGreaterThanOrEqualTo");
 					break;
 				case "PROPERTYISLESSTHAN":
-					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsLessThan");
+					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsLessThan");
 					break;
 				case "PROPERTYISLESSTHANOREQUALTO":
-					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("ogc:PropertyIsLessThanOrEqualTo");
+					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new BinaryComparisonOp("PropertyIsLessThanOrEqualTo");
 					break;
 				case "PROPERTYISLIKE":
 					$_SESSION["sld_filter_objects"][$_REQUEST["id"]]->operations[] = new PropertyIsLike();
@@ -175,7 +175,7 @@
 	}
 	
 	
-	header("Location: sld_edit_filter.php");
+	header("Location: sld_edit_filter.php?".$urlParameters);
 	exit();
 }
 else
@@ -221,7 +221,7 @@
 	if ($first_load != 1) echo " onLoad=\"setFilter();\"";
 	echo ">\n";
 	
-	echo "<form name=\"editFilter\" action=\"sld_edit_filter.php\" method=\"post\">\n";
+	echo "<form name=\"editFilter\" action=\"sld_edit_filter.php?".$urlParameters."\" method=\"post\">\n";
 	
 	echo "<table cellspacing=\"0\" cellpadding=\"0\">\n";
 	echo "<tr align=\"center\"><td class=\"bg2 text3\">Filter bearbeiten</td></tr>\n";

Modified: branches/2.5/http/sld/sld_filter_parse.php
===================================================================
--- branches/2.5/http/sld/sld_filter_parse.php	2008-04-10 23:01:35 UTC (rev 2375)
+++ branches/2.5/http/sld/sld_filter_parse.php	2008-04-10 23:06:36 UTC (rev 2376)
@@ -27,7 +27,6 @@
 
 
 include_once(dirname(__FILE__)."/classes/StyledLayerDescriptor.php");
-session_start();
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
 /**

Modified: branches/2.5/http/sld/sld_main.php
===================================================================
--- branches/2.5/http/sld/sld_main.php	2008-04-10 23:01:35 UTC (rev 2375)
+++ branches/2.5/http/sld/sld_main.php	2008-04-10 23:06:36 UTC (rev 2376)
@@ -25,33 +25,17 @@
  * @package sld_main
  * @author Markus Krzyzanowski
  */
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+require_once(dirname(__FILE__)."/sld_config.php");
 require_once(dirname(__FILE__)."/../classes/class_wfs_conf.php");
 $classWfsConf = new wfs_conf();
 
-include_once(dirname(__FILE__)."/sld_config.php");
-include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-
-if (isset($_REQUEST["wms_id"]) && isset($_REQUEST["gui_id"]))
-{
-	$_SESSION["sld_wms_id"] = $_REQUEST["wms_id"];
-	$_SESSION["sld_gui_id"] = $_REQUEST["gui_id"];
-}
-
-if (isset($_REQUEST["layer_name"]))
-{
-	$_SESSION["sld_layer_name"] = $_REQUEST["layer_name"];
-}
-
 //read custom sld for this user&wms&layer&gui from the db instead using sld.xml
 
 $con = db_connect($DBSERVER,$OWNER,$PW);
 db_select_db($DB,$con);
 
 //Read the layer_id from the DB
-//$sql = "SELECT * FROM layer WHERE fkey_wms_id=".$_SESSION["sld_wms_id"]." AND layer_name='".$_SESSION["sld_layer_name"]."';";
-//$res = db_query($sql);
-
 $dbutils = new DbUtils();
 $layer_id = $dbutils->getLayerIdFromLayerName($_SESSION["sld_wms_id"], $_SESSION["sld_layer_name"]);
 if ( $layer_id )
@@ -148,8 +132,8 @@
 $sld_url = "";
 $mb_sld_url = "";
 //$sld_url = "http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/sld_function_handler.php?function=getusersld&layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
-$sld_url = $MAPBENDER_URL."/sld_function_handler.php?function=getusersld&gui_id=".$_SESSION["sld_gui_id"]."&layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
-$mb_sld_url = $MAPBENDER_URL."/sld_function_handler.php?function=getusersld&gui_id=".$_SESSION["sld_gui_id"]."&wms_id=".$_SESSION["sld_wms_id"]."&user_id=".$mb_user_id;
+$sld_url = $MAPBENDER_URL."/sld_function_getusersld.php?function=getusersld&sld_gui_id=".$_SESSION["sld_gui_id"]."&sld_layer_id=".$layer_id."&user_id=".$mb_user_id."&forcesld=1";
+$mb_sld_url = $MAPBENDER_URL."/sld_function_getusersld.php?function=getusersld&sld_gui_id=".$_SESSION["sld_gui_id"]."&sld_wms_id=".$_SESSION["sld_wms_id"]."&user_id=".$mb_user_id;
 echo "<!-- $sld_url -->";
 echo "<!-- $previewMapUrl -->";
 ## - 2.Zeile
@@ -262,11 +246,11 @@
 //echo "      <form id=\"sld_editor_form\" action=\"http://".$_SERVER["HTTP_HOST"]."/mapbender/sld/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
 echo "      <form id=\"sld_editor_form\" action=\"".$MAPBENDER_URL."/".$SLD_FUNCTION_HANDLER."\" method=post >\n";
 
-echo "      <a href='".$SLD_FUNCTION_HANDLER."?function=getdefaultsld' onclick='if(!confirm(\"Aktuelle SLD-Definition ersetzen?\")) return false;'>\n";
+echo "      <a href='".$SLD_FUNCTION_HANDLER."&function=getdefaultsld' onclick='if(!confirm(\"Aktuelle SLD-Definition ersetzen?\")) return false;'>\n";
 echo "      <img src='./img/script.png' border='0' alt='Standard SLD aus WMS auslesen'>\n";
 echo "      </a> Standard &ouml;ffnen<br /><br />\n";
 
-echo "      <input type='image' src='./img/script_save.png' border='0' alt='�nderungen an die Map senden'>\n";
+echo "      <input type='image' src='./img/script_save.png' border='0' alt='Änderungen an die Map senden'>\n";
 echo "      SLD speichern<br>\n";
 echo "      <input type='hidden' name='function' value='save'>\n";
 echo "      <br /><a href=\"".$sld_url."\" target=_new>";	

Modified: branches/2.5/http/sld/sld_parse.php
===================================================================
--- branches/2.5/http/sld/sld_parse.php	2008-04-10 23:01:35 UTC (rev 2375)
+++ branches/2.5/http/sld/sld_parse.php	2008-04-10 23:06:36 UTC (rev 2376)
@@ -33,7 +33,6 @@
  * @author Markus Krzyzanowski
  */
 
-session_start();
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
 /**



More information about the Mapbender_commits mailing list