svn commit: r931 - trunk/mapbender/http/php/mod_loadWFSCapabilities.php

christoph at osgeo.org christoph at osgeo.org
Tue Nov 21 11:07:50 EST 2006


Author: christoph
Date: 2006-11-21 16:07:49+0000
New Revision: 931

Modified:
   trunk/mapbender/http/php/mod_loadWFSCapabilities.php

Log:
* include via dirname(__FILE__)
* added parameter for getGuisByOwner

Modified: trunk/mapbender/http/php/mod_loadWFSCapabilities.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadWFSCapabilities.php?view=diff&rev=931&p1=trunk/mapbender/http/php/mod_loadWFSCapabilities.php&p2=trunk/mapbender/http/php/mod_loadWFSCapabilities.php&r1=930&r2=931
==============================================================================
--- trunk/mapbender/http/php/mod_loadWFSCapabilities.php	(original)
+++ trunk/mapbender/http/php/mod_loadWFSCapabilities.php	2006-11-21 16:07:49+0000
@@ -19,8 +19,8 @@
 
 session_start();
 
-include("../php/mb_validateSession.php");
-include("../../conf/mapbender.conf");
+include(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__)."/../../conf/mapbender.conf");
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
 import_request_variables("PG");
@@ -91,7 +91,10 @@
 
 <?php
 $con = db_connect(DBSERVER,OWNER,PW);
-
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
+echo count($ownguis)."<br>";
 echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
 
 echo "<table cellpadding='0' cellspacing='0' border='0'>";
@@ -99,29 +102,34 @@
 echo "<td>";
 echo"GUI";
 echo"<br>";
-$sql = "SELECT * from gui_mb_user, gui WHERE gui.gui_id = gui_mb_user.fkey_gui_id ";
-$sql .= "AND gui.gui_public = 1 AND gui_mb_user.fkey_mb_user_id = $1 Order BY fkey_gui_id ;";
-$v = array($_SESSION["mb_user_id"]);
-$t = array('i');
-$res = db_prep_query($sql,$v,$t);
-$count=0;
-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++;
+#$sql = "SELECT * from gui_mb_user, gui WHERE gui.gui_id = gui_mb_user.fkey_gui_id ";
+#$sql .= "AND gui.gui_public = 1 AND gui_mb_user.fkey_mb_user_id = $1 Order BY fkey_gui_id ;";
+#$v = array($_SESSION["mb_user_id"]);
+#$t = array('i');
+#$res = db_prep_query($sql,$v,$t);
+#$count=0;
+$gui_id =array();
+if (count($ownguis)>0){
+	for($i=0; $i<count($ownguis); $i++){
+		$gui_id[$i]=$ownguis[$i];
+	}
 }
 
   echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
-  for ($i=0; $i<$count;$i++){
-      echo "<option value='".$gui_id[$i]."' ";
-	   if($guiList && $guiList == $gui_name[$i]){
-         echo "selected";
-      }
-      echo ">".$gui_name[$i]."</option>";
-  }
-  $arrayGUIs=$_SESSION["mb_user_guis"];
-  echo count($arrayGUIs);
+	for ($i=0; $i<count($ownguis);$i++){
+   		echo "<option value='".$gui_id[$i]."' ";
+	   if($guiList && $guiList == $gui_id[$i]){
+	      echo "selected";
+	      $selected_gui_id=$gui_id[$i];
+	   }
+	   else{
+	      if ($i==0){
+	         echo "selected";
+	         $selected_gui_id=$gui_id[$i];
+			}
+	   }
+	   echo ">".$gui_id[$i]."</option>";
+   }
 echo "</select><br><br>";
 
 echo "</td>";




More information about the Mapbender_commits mailing list