svn commit: r88 - trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php

uli at osgeo.org uli at osgeo.org
Wed Apr 19 04:56:04 EDT 2006


Author: uli
Date: 2006-04-19 08:56:03+0000
New Revision: 88

Modified:
   trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php

Log:
code cleaning in process

Modified: trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php?view=diff&rev=88&p1=trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php&p2=trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php&r1=87&r2=88
==============================================================================
--- trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php	(original)
+++ trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList.php	2006-04-19 08:56:03+0000
@@ -16,12 +16,9 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#$gui_id = $_REQUEST["gui_id"];
 require_once("../../conf/mapbender.conf");
 require_once("../php/mb_validateSession.php");
 import_request_variables("PG");
-
-
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
@@ -59,9 +56,7 @@
 <!--
 <?php
 
-/*get infos from gui_element ********************************************************************************************/
-
-/*
+/*get infos from gui_element ***************************************************************
 $sql_target = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMS' AND fkey_gui_id = '".$logged_gui_id."'";
 $res_target = db_query($sql_target);
 $cnt_target = 0;
@@ -157,9 +152,9 @@
 
 ######   SQL   #####################################################################################
 
-/*get infos from gui_element ********************************************************************************************/
+/*get infos from gui_element ********************************************************/
 
-/*get group from logged user  ********************************************************************************************/
+/*get group from logged user  *******************************************************/
 $sql_user_group = "SELECT * FROM mb_user_mb_group WHERE fkey_mb_user_id= $1 ";
 $array_values = array($logged_user_id);
 $array_types = array('s');
@@ -169,24 +164,28 @@
 	$group_id[$cnt_user_group] = $row["fkey_mb_group_id"];
 	$cnt_user_group++;
 }
-/*get group from logged user  ********************************************************************************************/
+/*get group from logged user  ************************************************************/
 
-# recheck
+# Thekla, please recheck
 /*get group name  ********************************************************************************************/								 
 if(count($group_id) > 0){
-	$sql_group = "SELECT mb_group_id, mb_group_name, mb_group_description FROM mb_group WHERE mb_group_id IN (";
+	$v = array();
+	$t = array();
+	$sql_group = "SELECT mb_group_id, mb_group_name, mb_group_description FROM mb_group WHERE mb_group_id IN (";	
 	for($i=0; $i < count($group_id); $i++){
 		if($i>0){ $sql_group .= ",";}
-		$sql_group .= "'".$group_id[$i]."'";
-		$sql_group.= ") ORDER BY mb_group_name";
-		$res_group = db_query($sql_group);
-		while($row = db_fetch_array($res_group)){
-			$mb_group_description[$cnt_group] = $row["mb_group_description"];
-			$my_group_name[$cnt_group] = $row["mb_group_name"];
-			$my_group_id[$cnt_group] = $row["mb_group_id"];
-			$cnt_group++;
-		}			
-	}					 
+		$sql_group .= "$".strval($i + 1);
+		array_push($v,$group_id[$i]);
+		array_push($t,"i");
+	}		
+	$sql_group.= ") ORDER BY mb_group_name";	
+	$res_group = db_prep_query($sql_group,$v,$t);	
+	while($row = db_fetch_array($res_group)){
+		$mb_group_description[$cnt_group] = $row["mb_group_description"];
+		$my_group_name[$cnt_group] = $row["mb_group_name"];
+		$my_group_id[$cnt_group] = $row["mb_group_id"];
+		$cnt_group++;
+	}				 
 }
 /*get group name  ********************************************************************************************/							 
 




More information about the Mapbender_commits mailing list