svn commit: r905 - trunk/mapbender/http/php/mod_filteredWms_layer_topic.php

christoph at osgeo.org christoph at osgeo.org
Tue Nov 21 04:21:37 EST 2006


Author: christoph
Date: 2006-11-21 09:21:37+0000
New Revision: 905

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

Log:
* include via dirname(__FILE__)
* changed WMS filtering (prev. getWMSByOwnGuis, now getWMS WHERE owner = user)

Modified: trunk/mapbender/http/php/mod_filteredWms_layer_topic.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredWms_layer_topic.php?view=diff&rev=905&p1=trunk/mapbender/http/php/mod_filteredWms_layer_topic.php&p2=trunk/mapbender/http/php/mod_filteredWms_layer_topic.php&r1=904&r2=905
==============================================================================
--- trunk/mapbender/http/php/mod_filteredWms_layer_topic.php	(original)
+++ trunk/mapbender/http/php/mod_filteredWms_layer_topic.php	2006-11-21 09:21:37+0000
@@ -18,10 +18,10 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 import_request_variables("PG");
-require_once("../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
-require_once("../php/mb_validatePermission.php");
+require_once(dirname(__FILE__)."/mb_validatePermission.php");
 $self = $PHP_SELF . "?".SID."&guiID=".$_REQUEST["guiID"]."&elementID=".$_REQUEST["elementID"];
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
@@ -80,8 +80,16 @@
 $logged_user_id = $_SESSION["mb_user_id"];
 
 $admin = new administration();
-$own_gui_id_array = $admin->getGuisByOwner($logged_user_id);
-$own_wms_id_array = $admin->getWmsByOwnGuis($own_gui_id_array);
+$own_gui_id_array = $admin->getGuisByOwner($logged_user_id,true);
+#$own_wms_id_array = $admin->getWmsByOwnGuis($own_gui_id_array);
+$own_wms_id_array = array();
+$sql = "SELECT wms_id FROM wms WHERE wms_owner = $1";
+$v = array($logged_user_id);
+$t = array('i');
+$res = db_prep_query($sql,$v,$t);
+while($row = db_fetch_array($res)){
+	array_push($own_wms_id_array,$row['wms_id']);
+}
 $cnt_wms = count($own_wms_id_array); 
 $own_layer_id_array = $admin->getLayerByWms($selected_wms);
 $cnt_layer = count($own_layer_id_array);




More information about the Mapbender_commits mailing list