[Mapbender-commits] r2209 - branches/2.4.5/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Mar 7 10:36:23 EST 2008


Author: christoph
Date: 2008-03-07 10:36:23 -0500 (Fri, 07 Mar 2008)
New Revision: 2209

Modified:
   branches/2.4.5/http/php/mod_editWMS_Metadata.php
   branches/2.4.5/http/php/mod_insertWmcIntoDb.php
   branches/2.4.5/http/php/mod_loadCapabilities.php
   branches/2.4.5/http/php/mod_loadCapabilitiesList.php
   branches/2.4.5/http/php/mod_loadwms.php
   branches/2.4.5/http/php/nestedSets.php
Log:
fixed problems at 
http://center/wiki/index.php/Version_RC1_2.4.5_PostgreSQL_UTF-8

Modified: branches/2.4.5/http/php/mod_editWMS_Metadata.php
===================================================================
--- branches/2.4.5/http/php/mod_editWMS_Metadata.php	2008-03-07 15:35:17 UTC (rev 2208)
+++ branches/2.4.5/http/php/mod_editWMS_Metadata.php	2008-03-07 15:36:23 UTC (rev 2209)
@@ -17,31 +17,21 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+import_request_variables("PG");
 require_once(dirname(__FILE__)."/mb_validatePermission.php");
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
 
-$secParams = SID."&guiID=".$_REQUEST["guiID"]."&elementID=".$_REQUEST["elementID"];
-
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
 <title>Edit WMS Metadata</title>
-
 <?php
 echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';   
 include_once '../include/dyn_css.php';
-#Error reporting 
-error_reporting(E_ALL);
-ini_set('display_errors', TRUE);
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
 
 $adm = new administration();
-
 ?>
-
 <script language="JavaScript">
 var dTarget;
 function save()
@@ -54,7 +44,7 @@
 {
 	var url = String(document.location);
 	url = url.substr(0, url.indexOf('?'));
-	window.open(url+"?<?php echo strip_tags(SID);?>&guiID=<?php echo $_REQUEST["guiID"]?>&elementID=<?php echo $_REQUEST["elementID"];?>&delete_preview=1&layer_id="+layer_id,'delete preview', 'height=50, width=150, dependent=yes');
+	window.open(url+"?<?php echo strip_tags(SID);?>&guiID=<?php echo $gui_id;?>&elementID=<?php echo $e_id;?>&delete_preview=1&layer_id="+layer_id,'delete preview', 'height=50, width=150, dependent=yes');
 	document.getElementById(layer_id+"_dp").style.display="none";
 }
 
@@ -64,7 +54,7 @@
     var dp =
 window.open('../tools/datepicker/datepicker.php?m=Jan_Feb_Mrz_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez&d=Mo_Di_Mi_Do_Fr_Sa_So&t=heute','dp','left=200,top=200,width=230,height=210,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0');
     dp.focus();
-    return false
+    return false;
 }
 </script>
 </head>
@@ -308,8 +298,7 @@
 
 #Use select box to select a wms
 
-if (isset($_REQUEST['show_wms_list']) && $_REQUEST['show_wms_list'] == true)
-{
+//if (isset($_REQUEST['show_wms_list']) && $_REQUEST['show_wms_list'] == true){
 
     #Querying information from wms data table 
     $wms_sql = "SELECT wms_id, wms_title FROM wms WHERE wms_owner = $1 ORDER BY wms_title";
@@ -343,7 +332,7 @@
 
     if(isset($_REQUEST['wmsList']) == true && $_REQUEST['wmsList'] <>0)
     editWMSByWMSID ($_REQUEST['wmsList']);
-}
+//}
 
 echo "</table>";
 

Modified: branches/2.4.5/http/php/mod_insertWmcIntoDb.php
===================================================================
--- branches/2.4.5/http/php/mod_insertWmcIntoDb.php	2008-03-07 15:35:17 UTC (rev 2208)
+++ branches/2.4.5/http/php/mod_insertWmcIntoDb.php	2008-03-07 15:36:23 UTC (rev 2209)
@@ -22,10 +22,6 @@
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
 require_once(dirname(__FILE__)."/../extensions/JSON.php");
 
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
-
-
 $json = new Services_JSON();
 $mapObject = $json->decode($_REQUEST["mapObject"]);
 $user_id = $_SESSION["mb_user_id"];

Modified: branches/2.4.5/http/php/mod_loadCapabilities.php
===================================================================
--- branches/2.4.5/http/php/mod_loadCapabilities.php	2008-03-07 15:35:17 UTC (rev 2208)
+++ branches/2.4.5/http/php/mod_loadCapabilities.php	2008-03-07 15:36:23 UTC (rev 2209)
@@ -17,11 +17,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-include(dirname(__FILE__)."/../php/mb_validatePermission.php");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-$secParams = SID."&guiID=".$_REQUEST["guiID"]."&elementID=".$_REQUEST["elementID"];
 import_request_variables("PG");
+include(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -78,7 +75,7 @@
 		}
 		else{
 			var gui_id=document.form1.guiList.options[listIndex].value;
-			document.form1.action = '../php/mod_loadwms.php?<?php echo $secParams ?>';
+			document.form1.action = '../php/mod_loadwms.php?<?php echo SID; ?>';
 			document.form1.submit();
 		}
 	}

Modified: branches/2.4.5/http/php/mod_loadCapabilitiesList.php
===================================================================
--- branches/2.4.5/http/php/mod_loadCapabilitiesList.php	2008-03-07 15:35:17 UTC (rev 2208)
+++ branches/2.4.5/http/php/mod_loadCapabilitiesList.php	2008-03-07 15:36:23 UTC (rev 2209)
@@ -17,11 +17,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-require(dirname(__FILE__)."/../php/mb_validatePermission.php");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
 import_request_variables("PG");
+require(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -90,7 +87,7 @@
       }
       else{
          var gui_id=document.form1.guiList.options[listIndex].value;
-			document.form1.action='../php/mod_loadwms.php';
+			document.form1.action='../php/mod_loadwms.php<?php echo SID;?>';
 			document.form1.submit();
       }
    }
@@ -102,13 +99,13 @@
       }
       var gui_ind = document.form1.guiList.selectedIndex;
       var ind = document.form1.wmsID.selectedIndex;
-      var ind2 = document.form1.guiID.selectedIndex;
-      var permission = confirm("Load " + document.form1.wmsID.options[ind].text + " FROM " + document.form1.guiID.options[ind2].value + " INTO "+document.form1.guiList.options[gui_ind].value+" ?");
+      var ind2 = document.form1.guiID_.selectedIndex;
+      var permission = confirm("Load " + document.form1.wmsID.options[ind].text + " FROM " + document.form1.guiID_.options[ind2].value + " INTO "+document.form1.guiList.options[gui_ind].value+" ?");
       if(permission == true){
          document.form1.submit();
       }
       else{
-         document.form1.guiID.selectedIndex = -1;
+         document.form1.guiID_.selectedIndex = -1;
       }
 }
 </script>
@@ -124,7 +121,7 @@
 
 
 ###INSERT
-if(isset($wmsID) && isset($guiID)){
+if(isset($wmsID) && isset($guiID_)){
 	$sql_pos = "SELECT MAX(gui_wms_position) AS my_gui_wms_position FROM gui_wms WHERE fkey_gui_id = $1";
 	$v = array($guiList);
 	$t = array('s');
@@ -137,7 +134,7 @@
 	}
 
 	$sql = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1 AND fkey_wms_id = $2";
-	$v = array($guiID,$wmsID);
+	$v = array($guiID_,$wmsID);
 	$t = array('s','i');
 	$res = db_prep_query($sql,$v,$t);
 	$cnt = 0;
@@ -153,7 +150,7 @@
 	}
 
 	$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id = $1 AND gui_layer_wms_id = $2";
-	$v = array($guiID, $wmsID);
+	$v = array($guiID_, $wmsID);
 	$t = array("s", "i");
 	$res = db_prep_query($sql, $v, $t);
 	$cnt = 0;
@@ -194,7 +191,6 @@
 	$count=0;
 	echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
 	while($row = db_fetch_array($res)){
-		$gui_id[$count]=$row["gui_id"];
 		$gui_name[$count]=$row["gui_name"];
 		$gui_description[$count]=$row["gui_description"];
 		$count++;
@@ -277,7 +273,7 @@
 		$v = array($wmsID);
 		$t = array("s");
 		$res = db_prep_query($sql, $v, $t);
-		echo "<select class='select2' name='guiID' size='20' onchange='load()'>";
+		echo "<select class='select2' name='guiID_' size='20' onchange='load()'>";
 		$cnt = 0;
 		while($row = db_fetch_array($res)){
 			echo "<option value='".$row["fkey_gui_id"]."' ";

Modified: branches/2.4.5/http/php/mod_loadwms.php
===================================================================
--- branches/2.4.5/http/php/mod_loadwms.php	2008-03-07 15:35:17 UTC (rev 2208)
+++ branches/2.4.5/http/php/mod_loadwms.php	2008-03-07 15:36:23 UTC (rev 2209)
@@ -17,19 +17,16 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-require_once("mb_validatePermission.php");
+require_once("mb_validateSession.php");
 require_once("../classes/class_wms.php"); 
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
 
-
 echo "file: ".$_REQUEST["xml_file"];
 
-$gui_id = $_REQUEST["guiList"];
+$guiList = $_REQUEST["guiList"];
 $xml = $_REQUEST["xml_file"];
 
 $mywms = new wms();
 $mywms->createObjFromXML($xml);      
-$mywms->writeObjInDB($gui_id);
+$mywms->writeObjInDB($guiList);
 $mywms->displayWMS();
 ?>

Modified: branches/2.4.5/http/php/nestedSets.php
===================================================================
--- branches/2.4.5/http/php/nestedSets.php	2008-03-07 15:35:17 UTC (rev 2208)
+++ branches/2.4.5/http/php/nestedSets.php	2008-03-07 15:36:23 UTC (rev 2209)
@@ -17,10 +17,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 import_request_variables("PG");
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>



More information about the Mapbender_commits mailing list