svn commit: r52 - trunk/mapbender/http/php

uli at osgeo.org uli at osgeo.org
Thu Apr 13 17:02:33 EDT 2006


Author: uli
Date: 2006-04-13 21:02:33+0000
New Revision: 52

Added:
   trunk/mapbender/http/php/
   trunk/mapbender/http/php/database-mysql.php
   trunk/mapbender/http/php/database-pgsql.php
   trunk/mapbender/http/php/mb_getGUIs.php
   trunk/mapbender/http/php/mb_listGUIs.php
   trunk/mapbender/http/php/mb_listWMCs.php
   trunk/mapbender/http/php/mb_validateInput.php
   trunk/mapbender/http/php/mb_validateSession.php
   trunk/mapbender/http/php/mod_WMSpreferences.php
   trunk/mapbender/http/php/mod_changeEPSG.php
   trunk/mapbender/http/php/mod_changeEPSG_dynamic.php
   trunk/mapbender/http/php/mod_changePassword.php
   trunk/mapbender/http/php/mod_createJSObjFromDB.php
   trunk/mapbender/http/php/mod_createJSObjFromXML.php
   trunk/mapbender/http/php/mod_createUser.php
   trunk/mapbender/http/php/mod_deleteFilteredGUI.php
   trunk/mapbender/http/php/mod_deleteGUI.php
   trunk/mapbender/http/php/mod_deleteWMS.php
   trunk/mapbender/http/php/mod_digitize.php
   trunk/mapbender/http/php/mod_editElementVars.php
   trunk/mapbender/http/php/mod_editElements.php
   trunk/mapbender/http/php/mod_editFilteredGroup.php
   trunk/mapbender/http/php/mod_editFilteredUser.php
   trunk/mapbender/http/php/mod_editGroup.php
   trunk/mapbender/http/php/mod_editGuiWms.php
   trunk/mapbender/http/php/mod_editGuiWmsMeta.php
   trunk/mapbender/http/php/mod_editSelf.php
   trunk/mapbender/http/php/mod_editUser.php
   trunk/mapbender/http/php/mod_edit_element_vars.php
   trunk/mapbender/http/php/mod_edit_metadata.php
   trunk/mapbender/http/php/mod_evalArea.php
   trunk/mapbender/http/php/mod_exportElement.php
   trunk/mapbender/http/php/mod_exportGUI.php
   trunk/mapbender/http/php/mod_export_image.php
   trunk/mapbender/http/php/mod_filteredGroup_Gui.php
   trunk/mapbender/http/php/mod_filteredGroup_User.php
   trunk/mapbender/http/php/mod_filteredGroup_filteredGui.php
   trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php
   trunk/mapbender/http/php/mod_filteredGui_User.php
   trunk/mapbender/http/php/mod_filteredGui_filteredGroup.php
   trunk/mapbender/http/php/mod_filteredGui_filteredUser.php
   trunk/mapbender/http/php/mod_filteredGui_group.php
   trunk/mapbender/http/php/mod_filteredUser_Group.php
   trunk/mapbender/http/php/mod_filteredUser_Gui.php
   trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php
   trunk/mapbender/http/php/mod_filteredUser_filteredGui.php
   trunk/mapbender/http/php/mod_forgottenPassword.php
   trunk/mapbender/http/php/mod_gazLayerObj_conf.php
   trunk/mapbender/http/php/mod_gazLayerObj_edit.php
   trunk/mapbender/http/php/mod_gazetteer_conf.php
   trunk/mapbender/http/php/mod_gazetteer_edit.php
   trunk/mapbender/http/php/mod_getStyles.php
   trunk/mapbender/http/php/mod_group_filteredGui.php
   trunk/mapbender/http/php/mod_group_filteredUser.php
   trunk/mapbender/http/php/mod_group_gui.php
   trunk/mapbender/http/php/mod_group_user.php
   trunk/mapbender/http/php/mod_gui_filteredGroup.php
   trunk/mapbender/http/php/mod_gui_filteredUser.php
   trunk/mapbender/http/php/mod_gui_group.php
   trunk/mapbender/http/php/mod_gui_owner.php
   trunk/mapbender/http/php/mod_gui_user.php
   trunk/mapbender/http/php/mod_loadCapabilities.php
   trunk/mapbender/http/php/mod_loadCapabilitiesList.php
   trunk/mapbender/http/php/mod_loadCapabilities_temp.php
   trunk/mapbender/http/php/mod_loadWFSCapabilities.php
   trunk/mapbender/http/php/mod_loadwfs.php
   trunk/mapbender/http/php/mod_loadwms.php
   trunk/mapbender/http/php/mod_loadwms_temp.php
   trunk/mapbender/http/php/mod_log.php
   trunk/mapbender/http/php/mod_logout.php
   trunk/mapbender/http/php/mod_map1.php
   trunk/mapbender/http/php/mod_mapOV.php
   trunk/mapbender/http/php/mod_monitorCapabilities.php
   trunk/mapbender/http/php/mod_newGui.php
   trunk/mapbender/http/php/mod_printView1.php
   trunk/mapbender/http/php/mod_renameGUI.php
   trunk/mapbender/http/php/mod_saveWKT.php
   trunk/mapbender/http/php/mod_showLoggedUser.php
   trunk/mapbender/http/php/mod_simpleWMSpreferences.php
   trunk/mapbender/http/php/mod_treefolderAdmin.php
   trunk/mapbender/http/php/mod_treefolderClient.php
   trunk/mapbender/http/php/mod_updateWMS.php
   trunk/mapbender/http/php/mod_usemap.php
   trunk/mapbender/http/php/mod_user_filteredGroup.php
   trunk/mapbender/http/php/mod_user_filteredGui.php
   trunk/mapbender/http/php/mod_user_group.php
   trunk/mapbender/http/php/mod_user_gui.php
   trunk/mapbender/http/php/mod_wfs.php
   trunk/mapbender/http/php/mod_wfsLayerObj_conf.php
   trunk/mapbender/http/php/mod_wfs_conf.php
   trunk/mapbender/http/php/mod_wfs_edit.php
   trunk/mapbender/http/php/mod_wfs_gazetteer.php
   trunk/mapbender/http/php/mod_wfs_result.php
   trunk/mapbender/http/php/mod_wfs_save.php
   trunk/mapbender/http/php/mod_wfsrequest.php
   trunk/mapbender/http/php/mod_zoomCoords.php
   trunk/mapbender/http/php/mod_zoomCoords_en.php
   trunk/mapbender/http/php/nestedSets.php

Log:
import Mapbender source without history

Added: trunk/mapbender/http/php/database-mysql.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/database-mysql.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/database-mysql.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,363 @@
+<?php
+/**
+ * \file
+ * \brief MySQL database connection/querying layer
+ * 
+ * MySQL database connection/querying layer
+ *
+ * example:
+ * \code
+ * include_once("afwphp/database-mysql.php");  
+ * $sys_dbhost=...                            
+ * $sys_dbuser=...                            
+ * $sys_dbpasswd=...                           
+ * $sys_dbname=...                            
+ *                                             
+ * db_connect();                               
+ * ...                                         
+ * $rs = db_query("select * from table");      
+ * while($row = db_fetch_array($rs));
+ *  ...
+ * \endcode
+ */
+
+/* SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: database-mysql.php,v 1.11 2005/10/20 12:15:16 thekla_wirkus Exp $
+ */
+
+/**
+ * System-wide database type
+ *
+ * @var	constant		$sys_database_type
+ */
+$sys_database_type='mysql';
+
+/**
+ *  Connect to the database
+ *
+ *  Notice the global vars that must be set up
+ *  Notice the global vars $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname that must be set up 
+ *  in other functions in this library
+ */
+include_once("../classes/class_mb_exception.php");
+function db_escapestring($unescaped_string)
+{
+	return @mysql_escape_string($unescaped_string);
+}
+ 
+function db_escape_string($unescaped_string)
+{
+	return @mysql_escape_string($unescaped_string);
+}
+
+function db_connect($DBSERVER="",$OWNER="",$PW="") {
+	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,
+		$conn,$conn_update,$sys_db_use_replication,$sys_dbreadhost;
+
+	if ($DBSERVER)
+		$sys_dbhost = $DBSERVER; 
+	if ($OWNER)
+		$sys_dbuser = $OWNER; 
+	if ($PW)
+		$sys_dbpasswd = $PW; 
+		
+	if ($sys_db_use_replication) {
+		//
+		//  if configured for replication, $conn is the read-only host
+		//  we do not connect to update server until needed
+		//
+		$conn = @mysql_pconnect($sys_dbreadhost,$sys_dbuser,$sys_dbpasswd);
+		$conn_update=@mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
+	} else {
+		$conn = @mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd);
+//		echo "@mysql_pconnect($sys_dbhost,$sys_dbuser,$sys_dbpasswd)";
+	}
+	if ($sys_dbname)
+		@mysql_select_db($sys_dbname);
+	return $conn;
+}
+
+function db_select_db($DB,$con="") {
+	global $conn,$sys_dbname; 
+	$sys_dbname = $DB;	
+	$_con = $con ? $con : $conn;
+	$ret = @mysql_select_db($sys_dbname,$_con);
+	if ($ret){
+		return true;
+	}
+	else {
+		return false;
+	}
+//	echo "$ret=@mysql_select_db($sys_dbname,$_con);";
+}
+
+/**
+ *  Query the database
+ *
+ *  @param		$qstring (string)	SQL statement
+ *  @param		$limit (int)		How many rows do you want returned
+ *  @param		$offset (int)		Of matching rows, return only rows starting here
+ */
+function db_query($qstring,$limit='-1',$offset=0) {
+	global $QUERY_COUNT,$sys_db_use_replication,$sys_db_is_dirty,$DB,
+		$sys_dbname,$conn,$conn_update,$sys_dbhost,$sys_dbuser,$sys_dbpasswd;
+
+	$QUERY_COUNT++;
+	if(!$sys_dbname && $DB)
+	$sys_dbname = $DB;
+	db_select_db($sys_dbname,$conn);
+	
+	if ($limit > 0) {
+		if (!$offset || $offset < 0) {
+			$offset=0;
+		}
+		$qstring=$qstring." LIMIT $offset,$limit";
+	}
+//	if ($GLOBALS['IS_DEBUG'])
+		$GLOBALS['G_DEBUGQUERY'] .= $qstring . "<P><BR>\n";
+
+	//
+	//are we configured to try to use replication?
+	//
+	if ($sys_db_use_replication) {
+		//
+		//if we haven't yet done an insert/update, 
+		//read from the read-only db
+		//
+		if (!$sys_db_is_dirty && eregi("^( )*(select)",$qstring)) {
+			if ($QUERY_COUNT%3==0) {
+				// 1/3rd of read queries go to master for now
+				return @mysql_db_query($sys_dbname,$qstring,$conn_update);
+			} else {
+				return @mysql_db_query($sys_dbname,$qstring,$conn);
+			}
+		} else {
+			//must be an update/insert/delete query - go to master server
+			$sys_db_is_dirty=true;
+			return @mysql_db_query($sys_dbname,$qstring,$conn_update);
+		}
+	} else {
+		$ret = @mysql_db_query($sys_dbname,$qstring,$conn);
+//		echo "@mysql_db_query($sys_dbname,$qstring,$conn); ret=$ret<br>";
+		if(!$ret){
+			$e = new mb_exception("db_query($qstring)=$ret db_error=".db_error());
+		}
+		return $ret;
+	}
+	//echo "SQL__".$qstring;
+}
+
+/**
+ *	Begin a transaction
+ *
+ *	Begin a transaction for databases that support them
+ *	may cause unexpected behavior in databases that don't
+ */
+function db_begin() {
+	return db_query("BEGIN WORK");
+}
+
+/**
+ * Commit a transaction
+ *
+ * Commit a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_commit() {
+	return db_query("COMMIT");
+}
+
+/**
+ * Roll back a transaction
+ *
+ * Rollback a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_rollback() {
+	return db_query("ROLLBACK");
+}
+
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_numrows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @mysql_numrows($qhandle);
+	} else {
+		return 0;
+	}
+}
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ * php 3,4,5
+ */
+function db_num_rows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @mysql_num_rows($qhandle);
+	} else {
+		return 0;
+	}
+}
+
+/**
+ *  Frees a database result properly 
+ *
+ *  @param	$qhandle (string)	Query result set handle
+ */
+function db_free_result($qhandle) {
+	return @mysql_free_result($qhandle);
+}
+
+/**
+ *  Reset a result set.
+ *
+ *  Reset is useful for db_fetch_array sometimes you need to start over
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ */
+function db_reset_result($qhandle,$row=0) {
+	return mysql_data_seek($qhandle,$row);
+}
+
+/**
+ *  Returns a field from a result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ *  @param		$field (string)	Field name
+ */
+function db_result($qhandle,$row,$field) {
+	return @mysql_result($qhandle,$row,$field);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ */
+function db_numfields($lhandle) {
+	return @mysql_numfields($lhandle);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ * php 3,4,5
+ */
+function db_num_fields($lhandle) {
+	return @mysql_num_fields($lhandle);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fieldname($lhandle,$fnumber) {
+	   return @mysql_fieldname($lhandle,$fnumber);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_affected_rows($qhandle) {
+	return @mysql_affected_rows();
+}
+
+/**
+ *  Fetch an array
+ *
+ *  Returns an associative array from 
+ *  the current row of this database result
+ *  Use db_reset_result to seek a particular row
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_fetch_array($qhandle) {
+	return @mysql_fetch_array($qhandle);
+}
+
+/**                                                       
+ * fetch a row into an array 
+ * 
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fetch_row($qhandle,$fnumber=0) {
+	  return @mysql_fetch_row($qhandle);
+}
+
+/**
+ *  Returns the last primary key from an insert
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$table_name (string)	Is the name of the table you inserted into
+ *  @param		$pkey_field_name (string)	Is the field name of the primary key
+ */
+function db_insertid($qhandle="",$table_name="",$pkey_field_name="") {
+	return @mysql_insert_id();
+}
+
+function db_insert_id($qhandle="",$table_name="",$pkey_field_name="") {
+	return @mysql_insert_id();
+}
+
+/**
+ * Returns the last error from the database
+ */
+function db_error() {
+	return @mysql_error();
+}
+
+/**
+ * Get the flags associated with the specified field in a result 
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ *
+ * 					Examples: "not_null", "primary_key", "unique_key", "multiple_key",					 
+ *                    "blob", "unsigned", "zerofill","binary", "enum",                  
+ *                    "auto_increment", "timestamp"                                     
+ */
+
+function db_field_flags($lhandle,$fnumber) {
+	   return @mysql_field_flags($lhandle,$fnumber);
+}
+
+/**                                                       
+ * Get the type of the specified field  
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_type($lhandle,$fnumber) {               
+	   return @mysql_field_type($lhandle,$fnumber);         
+}                                                         
+
+/**                                                       
+ * Get the length of the specified field                                                            
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_len($lhandle,$fnumber) {               
+	   return @mysql_field_len($lhandle,$fnumber);         
+} 
+
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/database-pgsql.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/database-pgsql.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/database-pgsql.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,386 @@
+<?php
+#$Id: database-pgsql.php,v 1.17 2005/11/22 15:54:12 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/database-pgsql.php,v 1.17 2005/11/22 15:54:12 astrid_emde Exp $
+/**
+ * \file
+ * \brief MySQL database connection/querying layer
+ * 
+ * MySQL database connection/querying layer
+ *
+ * example:
+ * \code
+ * include_once("afwphp/database-mysql.php");  
+ * $sys_dbhost=...                            
+ * $sys_dbuser=...                            
+ * $sys_dbpasswd=...                           
+ * $sys_dbname=...                            
+ *                                             
+ * db_connect();                               
+ * ...                                         
+ * $rs = db_query("select * from table");      
+ * while($row = db_fetch_array($rs));
+ *  ...
+ * \endcode
+ */
+
+/* SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: database-pgsql.php,v 1.17 2005/11/22 15:54:12 astrid_emde Exp $
+ */
+
+/**
+ * System-wide database type
+ *
+ * @var	constant		$sys_database_type
+ */
+$sys_database_type='pgsql';
+
+/**
+ *  Connect to the database
+ *
+ *  Notice the global vars that must be set up
+ *  Notice the global vars $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname that must be set up 
+ *  in other functions in this library
+ */
+include_once("../classes/class_mb_exception.php");
+ 
+function db_escape_string($unescaped_string)
+{
+	
+	return @pg_escape_string(stripslashes($unescaped_string));
+
+}
+$DB = DB;
+function db_connect($DBSERVER="",$OWNER="",$PW="") {
+	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug;
+	global $conn,$conn_update,$DB;
+	
+	//global DBSERVER,OWNER,PW,DB;
+	$db_debug=0;
+	if ($DBSERVER)
+		$sys_dbhost = $DBSERVER; 
+	if ($OWNER)
+		$sys_dbuser = $OWNER; 
+	if ($PW && $PW != null)
+		$sys_dbpasswd = $PW; 
+	if($GLOBALS['DB'])
+		$sys_dbname = $DB;
+			
+	$connstring = "";
+	if ($sys_dbuser)		
+		$connstring.=" user=$sys_dbuser";
+	if ($sys_dbname)		
+		$connstring.=" dbname=$sys_dbname";		
+	if ($sys_dbhost)		
+		$connstring.=" host=$sys_dbhost";		
+	if ($sys_dbpasswd)		
+		$connstring.=" password=$sys_dbpasswd";		
+	
+	if ($db_debug)
+		echo $connstring." ";		
+
+	$conn = pg_connect($connstring);		
+
+		#if(isset($sys_db_clientencoding) && $sys_db_clientencoding > "")
+		#{
+		#pg_set_client_encoding ( $conn, $sys_db_clientencoding);
+		#}
+	#return $conn;
+	if ($db_debug)
+		echo "conn=".$conn;
+#echo $connstring;
+#if(!$conn)
+#{echo "FEHLER in Connection";
+#pg_error($conn);}	
+	
+	return $conn;
+}
+
+function db_select_db($DB,$con="") {
+	global $conn,$sys_dbname; 
+#	$sys_dbname = DB;	
+#	$_con = $con ? $con : $conn;
+#	$ret = @mysql_select_db($sys_dbname,$_con);
+//	echo "$ret=@mysql_select_db($sys_dbname,$_con);";
+}
+
+/**
+ *  Query the database
+ *
+ *  @param		$qstring (string)	SQL statement
+ *  @param		$limit (int)		How many rows do you want returned
+ *  @param		$offset (int)		Of matching rows, return only rows starting here
+ */
+function db_query($qstring) {
+	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug,
+		$conn,$conn_update,$QUERY_COUNT,$DBSERVER,$OWNER,$PW,$DB;
+	$QUERY_COUNT++;
+	
+	$ret = pg_exec($qstring);
+	#echo "SQL: ".$qstring;
+	/*if(!$ret){
+		echo db_error();
+		$handle = fopen("../tmp/sql.txt", "a");
+		fwrite($handle, $qstring." -- ".$_SERVER["SCRIPT_NAME"]."\n");
+		fclose($handle);
+	}	
+	*/
+	if(!$ret){
+			$e = new mb_exception("db_query($qstring)=$ret db_error=".db_error());
+		}
+	return $ret;	
+}
+
+/**
+ *	Begin a transaction
+ *
+ *	Begin a transaction for databases that support them
+ *	may cause unexpected behavior in databases that don't
+ */
+function db_begin() {
+	return db_query("BEGIN WORK");
+}
+
+/**
+ * Commit a transaction
+ *
+ * Commit a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_commit() {
+	return db_query("COMMIT");
+}
+
+/**
+ * Roll back a transaction
+ *
+ * Rollback a transaction for databases that support them
+ * may cause unexpected behavior in databases that don't
+ */
+function db_rollback() {
+	return db_query("ROLLBACK");
+}
+
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_numrows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @pg_numrows($qhandle);
+	} else {
+		return 0;
+	}
+}
+/**
+ * Returns the number of rows in this result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *	php > 4.2
+ */ 
+function db_num_rows($qhandle) {
+	// return only if qhandle exists, otherwise 0
+	if ($qhandle) {
+		return @pg_num_rows($qhandle);
+	} else {
+		return 0;
+	}
+}
+
+/**
+ *  Frees a database result properly 
+ *
+ *  @param	$qhandle (string)	Query result set handle
+ */
+function db_free_result($qhandle) {
+	return @pg_freeresult($qhandle);
+}
+
+/**
+ *  Reset a result set.
+ *
+ *  Reset is useful for db_fetch_array sometimes you need to start over
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ */
+function db_reset_result($qhandle,$row=0) {
+#dummy
+	return 0;#mysql_data_seek($qhandle,$row);
+	
+}
+
+/**
+ *  Returns a field from a result set
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$row (int)		Row number
+ *  @param		$field (string)	Field name
+ */
+function db_result($qhandle,$row,$field) {
+	return @pg_result($qhandle,$row,$field);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ */
+function db_numfields($lhandle) {
+	return @pg_numfields($lhandle);
+}
+
+/**
+ *  Returns the number of fields in this result set
+ *
+ *  @param		$lhandle (string)	Query result set handle
+ *	php >4.2
+ */
+function db_num_fields($lhandle) {
+	return @pg_num_fields($lhandle);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fieldname($lhandle,$fnumber) {
+	   return @pg_fieldname($lhandle,$fnumber);
+}
+
+/**
+ *  Returns the number of rows changed in the last query
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_affected_rows($qhandle) {
+	
+	return @pg_cmdtuples($qhandle);
+}
+
+/**
+ *  Fetch an array
+ *
+ *  Returns an associative array from 
+ *  the current row of this database result
+ *  Use db_reset_result to seek a particular row
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ */
+function db_fetch_array($qhandle) {
+	return @pg_fetch_array($qhandle);
+}
+function db_fetch_all($qhandle){
+		return @pg_fetch_all($qhandle);
+}
+/**                                                       
+ * fetch a row into an array 
+ * 
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */
+function db_fetch_row($qhandle,$fnumber=0) {
+	  return pg_fetch_row($qhandle);
+}
+
+/**
+ *  Returns the last primary key from an insert
+ *
+ *  @param		$qhandle (string)	Query result set handle
+ *  @param		$table_name (string)	Is the name of the table you inserted into
+ *  @param		$pkey_field_name (string)	Is the field name of the primary key
+ */
+function db_insertid($qhandle="",$table_name="",$pkey_field_name="") {
+	$res=db_query("SELECT max($pkey_field_name) AS id FROM $table_name");
+    if ($res && db_numrows($res) > 0) {
+        return @db_result($res,0,'id');
+    } else {
+        return 0;
+    }
+}
+
+
+
+
+function db_insert_id($qhandle="",$table_name="",$pkey_field_name="") {
+		global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug,
+		$conn,$conn_update,$QUERY_COUNT,$DBSERVER,$OWNER,$PW,$DB;
+	/*	
+	$oid =pg_last_oid($qhandle);
+	echo $oid;
+	
+	$res=db_query("SELECT ".$pkey_field_name." FROM ".$table_name." WHERE oid =".$oid );
+    if ($res && db_numrows($res) > 0) {
+        return @db_result($res,0,0);
+    } else {
+        return 0;
+    }*/
+    $res=db_query("SELECT max($pkey_field_name) AS id FROM $table_name");
+    if ($res && db_numrows($res) > 0) {
+        return db_result($res,0,'id');
+    } else {
+        return 0;
+    }
+}
+
+function db_last_oid()
+      {
+      	global $sys_dbhost,$sys_dbuser,$sys_dbpasswd,$sys_dbname,$db_debug,
+		$conn,$conn_update,$QUERY_COUNT;
+        global $DBSERVER,$OWNER,$PW,$DB	;
+             return pg_getlastoid($conn);
+      }
+
+
+/**
+ * Returns the last error from the database
+ */
+function db_error() {
+	return @pg_errormessage();
+}
+
+/**
+ * Get the flags associated with the specified field in a result 
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ *
+ * 					Examples: "not_null", "primary_key", "unique_key", "multiple_key",					 
+ *                    "blob", "unsigned", "zerofill","binary", "enum",                  
+ *                    "auto_increment", "timestamp"                                     
+ */
+
+function db_field_flags($lhandle,$fnumber) {
+	   print "db_field_flags()	isn't implemented";
+	   
+}
+
+/**                                                       
+ * Get the type of the specified field  
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_type($lhandle,$fnumber) {               
+	   return @pg_fieldtype($lhandle,$fnumber);         
+}                                                         
+
+/**                                                       
+ * Get the length of the specified field                                                            
+ *
+ *  @param		$lhandle	(string) Query result set handle
+ *  @param		$fnumber (int)	Column number
+ */                                                       
+                                                          
+function db_field_len($lhandle,$fnumber) {               
+	   return @pg_fieldlen($lhandle,$fnumber);         
+} 
+
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/mb_getGUIs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_getGUIs.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mb_getGUIs.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,68 @@
+<?php
+# $Id: mb_getGUIs.php,v 1.5 2005/11/23 13:48:19 astrid_emde Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mb_getGUIs.php,v 1.5 2005/11/23 13:48:19 astrid_emde Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#returns an array of all guis of the user
+function mb_getGUIs($mb_user_id){
+   $arrayGuis = array();
+   
+   if(isset($mb_user_id)){
+	  $sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = " . $mb_user_id;
+	  $res_groups = db_query($sql_groups);
+	  $cnt_groups = 0;
+	  while(db_fetch_row($res_groups)){
+	    $mb_user_groups[$cnt_groups] = db_result($res_groups,$cnt_groups,"fkey_mb_group_id");
+	    $cnt_groups++;
+	  }
+
+	  $count_g = 0;
+	  
+	  if($cnt_groups > 0){
+	  $sql_g = "SELECT DISTINCT gui.gui_id FROM gui JOIN gui_mb_group ";     
+	  $sql_g .= " ON gui.gui_id = gui_mb_group.fkey_gui_id WHERE( gui_mb_group.fkey_mb_group_id IN (";  
+	  for($i=0; $i<count($mb_user_groups);$i++){
+	       if($i > 0){$sql_g .= ",";}
+	       $sql_g .= $mb_user_groups[$i];
+	   }
+	   $sql_g .= "))";
+	   $res_g = db_query($sql_g);
+	 
+	   while(db_fetch_row($res_g)){
+	      $arrayGuis[$count_g] = db_result($res_g, $count_g, "gui_id");
+	      $count_g++;
+	   }
+	  }
+	  
+	  $sql_guis = "SELECT DISTINCT gui.gui_id FROM gui JOIN gui_mb_user ";  
+	  $sql_guis .= "ON gui.gui_id = gui_mb_user.fkey_gui_id WHERE (gui_mb_user.fkey_mb_user_id = ".$mb_user_id.") ";
+	  $sql_guis .= " AND gui.gui_public = 1";  
+	  
+	  $res_guis = db_query($sql_guis);
+	  $count_guis = 0;
+	  while(db_fetch_row($res_guis)){
+	   if( !in_array(db_result($res_guis,$count_guis,"gui_id"),$arrayGuis)){
+	      $arrayGuis[$count_g] = db_result($res_guis,$count_guis,"gui_id");
+	      $count_g++;
+	   }
+	   $count_guis++;
+	  }
+  }
+  return $arrayGuis;
+}       
+?>

Added: trunk/mapbender/http/php/mb_listGUIs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_listGUIs.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mb_listGUIs.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,69 @@
+<?php
+# $Id: mb_listGUIs.php,v 1.13 2005/11/18 14:23:58 astrid_emde Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mb_listGUIs.php,v 1.13 2005/11/18 14:23:58 astrid_emde Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+# list of user-guis after login:
+function mb_listGUIs($arrayGUIs){
+	echo "<form name='listGUIsForm' target='_blank'>";
+	echo "<table width = '50%' ><tr><td>";
+	echo "<h2><font align='left' color='#000000'>Ma</font><font color='#0000CE'>p</font><font color='#C00000'>b</font><font color='#000000'>ender GUI list </font> </h2>";
+	echo "</td><td>";
+	
+	if (count($arrayGUIs)>0){
+	   $sql_list_guis = "SELECT DISTINCT gui_id,gui_name,gui_description FROM gui WHERE gui_id IN (";
+	   for($i=0; $i<count($arrayGUIs); $i++){
+	      if($i>0){$sql_list_guis .= ",";}
+	      $sql_list_guis .= "'". $arrayGUIs[$i]."'";
+	   }
+	
+	   $sql_list_guis .= ") ORDER BY gui_name";
+	   $res_list_guis = db_query($sql_list_guis);
+
+		echo "<a href=\"../php/mod_editSelf.php?".SID."\" class='list_guis' target=_blank>Change personal settings</a>";
+	   echo "</td><td align = 'right'>";
+	   echo "<a href=\"../php/mod_logout.php?".SID."\"><img src =\"../img/button_gray/logout_off.png\" border='0' onmouseover='this.src=\"../img/button_gray/logout_over.png\"' onmouseout='this.src=\"../img/button_gray/logout_off.png\"' title=\"Logout\"></a>";
+	   echo "</td></tr></table>";
+	   echo "<table width='50%' class='list_guis' border='1' cellpadding='3' rules='rows'><tr style='background-color:#F0F0F0;' width='80px'><td ><b>GUI name</b></td><td><b>GUI description</b></td></tr>";
+	   $cnt_list_guis = 0;
+	
+	   while($row = db_fetch_array($res_list_guis)){
+	      echo "<tr ";
+	      if(($cnt_list_guis % 2) == 0){ echo " style='background-color:#ffffff;' ";}
+	      echo ">";
+	      echo "<td><b><a href='index.php?".strip_tags (SID)."&gui_id=".$row["gui_id"]."'>".$row["gui_name"]."</a><b></td>";
+	      echo "<td>".$row["gui_description"]."</td>";
+	      echo "</tr>";
+	      $cnt_list_guis++;
+	   }   
+
+	}else{
+		echo "<a href=\"../php/mod_editSelf.php?".SID."\" class='list_guis' target=_blank>Change personal settings</a>";
+	   echo "</td><td align = 'right'>";
+	   echo "<a href=\"../php/mod_logout.php?".SID."\"><img src =\"../img/button_gray/logout_off.png\" border='0' onmouseover='this.src=\"../img/button_gray/logout_over.png\"' onmouseout='this.src=\"../img/button_gray/logout_off.png\"' title=\"Logout\"></a>";
+	   echo "</td><tr>" ;
+	   	echo "<td><br>There are no guis available for this user</td></tr>";
+		echo "</table>";
+
+	}
+
+	echo "</form>";
+
+}
+
+?>

Added: trunk/mapbender/http/php/mb_listWMCs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_listWMCs.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mb_listWMCs.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,204 @@
+<?php
+# $Id: mb_listWMCs.php,v 1.21 2006/03/16 15:26:34 c_baudson Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mb_listWMCs.php,v 1.21 2006/03/16 15:26:34 c_baudson Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ob_start(); 
+session_start();
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<!-- 
+Licensing: See the GNU General Public License for more details.
+http://www.gnu.org/copyleft/gpl.html
+or:
+mapbender/licence/ 
+-->
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Select web map contect document from list</title>
+
+</head>
+<body>
+<?php
+echo "<form name='delete_wmc' action='" . $PHP_SELF . "?".SID."' method='POST'>";
+echo "<input type='hidden' id='delete_wmc' name='del_wmc_id' value ='' />";
+echo "</form>";
+
+function mb_listWMCs($wmcList){
+	
+ 		global $DBSERVER,$DB,$OWNER,$PW;
+		$con = db_connect($DBSERVER,$OWNER,$PW);
+		db_select_db(DB,$con);
+		
+	   $display = "<h2 style='font-family: Arial, Helvetica, sans-serif; color: #808080;background-color: White;'><font align='left' color='#000000'>Ma</font><font color='#0000CE'>p</font><font color='#C00000'>b</font><font color='#000000'>ender WMC list </font> </h2>";
+	   $display .= "<table width='90%' style='font-family: Arial, Helvetica, sans-serif;font-size : 12px;color: #808080;' border='1' cellpadding='3' rules='rows'><tr style='background-color:#F0F0F0;' width='80px'><td ><b>WMC name</b></td><td><b>last update</b></td><td colspan=5></td></tr>";
+		
+		
+	if(count($wmcList)>0){ 
+	   $sql_list_wmcs = "SELECT DISTINCT wmc_id, wmc_title, wmc_timestamp FROM mb_user_wmc ";
+	   $sql_list_wmcs .= "WHERE wmc_id IN (";
+	   for($i=0; $i<count($wmcList); $i++){
+	      if($i>0){$sql_list_wmcs .= ",";}
+	      $sql_list_wmcs .= "'". $wmcList[$i]."'";
+	   }
+	   $sql_list_wmcs .= ") ";
+	   $sql_list_wmcs .= "ORDER BY wmc_timestamp DESC";
+	   
+	   $res_list_wmcs = db_query($sql_list_wmcs);
+	   $cnt_list_wmcs = 0;
+	   while($row = db_fetch_array($res_list_wmcs)){
+	      $display .= "<tr  onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'";
+	      if(($cnt_list_wmcs % 2) == 0){ $display .= "  ";}
+	      $display .= ">";
+	      $display .= "<td>".$row["wmc_title"]."</td>";
+	      $timestamp = date("M d Y H:i:s", $row["wmc_timestamp"]); 
+	      $this_id = $row["wmc_id"];
+	      $display .= "<td>".$timestamp. "</td>";
+
+	      $display .= "<td><a href=\"" . $_SERVER['PHP_SELF'] ."?" . SID . "&action=load&wmc_id=".$this_id."\"><img src=\"../img/button_gray/wmc_load.png\" title=\"load this WMC\"  border=0></a></td>";
+	      $display .= "<td><a href=\"" . $_SERVER['PHP_SELF'] ."?" . SID . "&action=merge&wmc_id=".$this_id."\"><img src=\"../img/button_gray/wmc_merge.png\" title=\"merge WMC\"  border=0></a></td>";
+	      $display .= "<td><a href=\"" . $_SERVER['PHP_SELF'] ."?" . SID . "&action=append&wmc_id=".$this_id."\"><img src=\"../img/button_gray/wmc_append.png\" title=\"append WMC\"  border=0></a></td>";
+	      $display .= "<td><a href='../javascripts/mod_displayWmc.php?wmc_id=".$this_id."' target = '_blank'><img src=\"../img/button_gray/wmc_xml.png\" title=\"display WMC XML\"  border=0></a></td>";
+	      
+	      $display .= "<td><a href=\"" . $_SERVER['PHP_SELF'] ."?" . SID . "&action=delete&wmc_id=".$this_id."\"><img src=\"../img/button_gray/del.png\" title=\"delete this WMC\"  border=0></a></td>";
+	      $display .= "</tr>";
+	      $cnt_list_wmcs++;
+	   }   
+	}else{
+		$display .= "<tr>There are no WMCs availiable</tr>";
+	}	
+	$display .= "</table>";
+	   
+   return $display;
+}
+
+
+require_once("../classes/class_administration.php");
+require_once("../classes/class_wmc.php");
+$admin = new administration();
+$wmcList = $admin->getWmcByOwner($_SESSION["mb_user_id"]);
+		
+//	global $frameName;
+//	$frameName = $e_target; 
+//	include("../classes/class_wmc.php");
+
+if ($_POST["del_wmc_id"] ) {
+	$result = $admin->deleteWmc($_POST["del_wmc_id"], $_SESSION["mb_user_id"]);
+	if (!$result) {
+      echo "<script language='javascript'>";
+      echo "alert('WMC could not be deleted!');";
+      echo "</script>";
+	}
+}
+
+		
+echo mb_listWMCs($wmcList);
+
+if ($_GET["wmc_id"] && $_GET["action"] == "delete" && in_array($_GET["wmc_id"], $wmcList)){
+	      echo "<script language='javascript'>";
+	      echo "value = confirm('Do you really want to delete this document?');";
+	      echo "if (value == true) {";
+	      echo "document.delete_wmc.del_wmc_id.value = '" . $_GET["wmc_id"] . "';";
+	      echo "document.delete_wmc.submit();";
+	      echo "}";
+	      echo "</script>";
+}
+
+ if ($_GET["wmc_id"] && ($_GET["action"] == "append" || $_GET["action"] == "merge" || $_GET["action"] == "load") && in_array($_GET["wmc_id"], $wmcList)){
+
+	$con = db_connect($DBSERVER,$OWNER,$PW);
+	db_select_db(DB,$con);
+	$sql = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMS' AND fkey_gui_id = '".$_SESSION['mb_user_gui']."'";
+	$res = db_query($sql);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){ 
+	   $e_target = $row["e_target"];
+	   $e_require = $row["e_requires"];
+	   $cnt++;
+	}
+	$target = explode(",", $e_target);
+
+	$wmc = new wmc();
+	$wmc->createObjFromWMC($_GET["wmc_id"]);
+	
+	if ($_GET["action"] == "append") {
+		$js = $wmc->createJsObjFromWMC("window.opener.", trim($target[1]));
+	}
+	elseif ($_GET["action"] == "merge") {
+		$js = $wmc->mergeExistingJsObjWithWMC("window.opener.", trim($target[1]));
+	}
+	elseif ($_GET["action"] == "load") {
+		$js = "var index = window.opener.getMapObjIndexByName('" . trim($target[1]) . "');\n";
+		$js .= "while(window.opener.mb_mapObj[index].wms.length > 0){window.opener.mb_mapObjremoveWMS(index,0);}";
+		$js .= "window.opener.deleteWmsObject();\n";
+		$js .= $wmc->createJsObjFromWMC("window.opener.", trim($target[1]));
+	}
+	
+	// display all JavaScript statements as debugging text
+	//echo $js;
+	echo "<script language='javascript'>";
+		if($cnt > 1){ echo "alert('addWMS: ID not unique!');\n";}
+		echo "var mod_addWMS_data = '".$e_require."';\n";
+		echo "var mod_addWMS_target1 = '".trim($target[0])."';\n";
+		echo "var mod_addWMS_target2 = '".trim($target[1])."';\n";
+	
+		echo $js;
+
+		// adjust the size of the navFrame
+		echo "window.opener.document.getElementById(mod_addWMS_target2).style.width = window.opener.mb_mapObj[ind].width;\n";
+		echo "window.opener.document.getElementById(mod_addWMS_target2).style.height = window.opener.mb_mapObj[ind].height;\n";
+		
+/*
+		// restate layers
+		echo "alert(changedWmsIds.length);\n";
+		echo "for (var i=0; i<changedWmsIds.length; i++) {\n";
+		echo "alert(changedWmsIds[i]);\n";
+		echo "window.opener.mb_restateLayers(mod_addWMS_target2, changedWmsIds[i]);\n";
+		echo "}\n";
+*/
+		// execute functions that need to be run after a wms update
+		echo "window.opener.mb_execloadWmsSubFunctions();\n";
+
+		// alert: wmc has been loaded
+		$title = $wmc->getTitle();
+		if ($title) {$title = "'" . $title . "' ";}
+		echo "alert(\"WMC " . $title . ": " . $_GET["action"] . " successful.\");\n";
+
+		// reload the map
+		echo "window.opener.setMapRequest(mod_addWMS_target2);\n";
+		
+		// close the 'load wmc' window
+		echo "window.close();";
+		
+		
+	echo "</script>";
+	
+}
+
+
+?>
+
+</body>
+</html>

Added: trunk/mapbender/http/php/mb_validateInput.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_validateInput.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mb_validateInput.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,35 @@
+<?php
+# $Id: mb_validateInput.php,v 1.3 2005/09/13 14:48:59 c_baudson Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mb_validateInput.php,v 1.3 2005/09/13 14:48:59 c_baudson Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+function mb_validateInput($text){
+  $match = array(
+      0 => "/drop/i",
+      1 => "/--/"
+  );
+  for($i=0; $i<count($match);$i++){
+   if( preg_match($match[$i], $text) == true){
+  	   return null;
+      exit;
+   }
+    else{
+    	return $text;
+    }
+  }
+} 
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/mb_validateSession.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_validateSession.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mb_validateSession.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,35 @@
+<?php
+# $Id: mb_validateSession.php,v 1.4 2005/09/13 19:36:58 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mb_validateSession.php,v 1.4 2005/09/13 19:36:58 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#ob_start();
+session_start();
+include_once("../../conf/mapbender.conf");
+if(!isset($_SESSION["mb_user_id"]) || !isset($_SESSION["mb_user_ip"]) || $_SESSION['mb_user_ip'] != $_SERVER['REMOTE_ADDR']){
+   header("Location: ".LOGIN);
+   exit;
+   die();
+} 
+if(isset($_REQUEST["gui_id"])){
+   if( !in_array($_REQUEST["gui_id"],$_SESSION["mb_user_guis"])){
+      header("Location: ".LOGIN);
+      exit;
+      die();
+   }
+}
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_WMSpreferences.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_WMSpreferences.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_WMSpreferences.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,349 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+session_start();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>WMS Preferences</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<STYLE TYPE="text/css">
+		<!--
+   body{
+   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+   	color:#0066cc;
+      font-size:10pt
+   }    
+   
+   table{
+   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+   	color:#0066cc;
+      font-size:10pt
+   } 
+   
+   th{
+   	background-color:silver;
+   }  
+   
+   select{
+		width:240px;
+   }    
+   
+	.up{
+         color:#0066cc;
+         border: solid thin;
+         height:20px;
+         width:60px;
+   }
+   
+	.down{
+         color: black;
+         border: solid thin;
+         height:20px;
+         width:60px;
+   }
+	.remove{
+         color:#0066cc;
+         border: solid thin;
+         height:20px;
+         width:60px;
+   }
+	-->
+</STYLE>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT * FROM gui_element WHERE e_id = 'WMS_preferences' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
+$res = db_query($sql);
+$cnt = 0;
+$vis = "";
+$wmsid = "";
+
+while($row = db_fetch_array($res)){
+   $e_target = $row["e_target"];
+   $cnt++;
+}
+if($cnt > 1){ echo "alert('WMS_preferences: ID not unique!');";}
+echo '<script type="text/javascript">';
+$target = explode(",", $e_target);
+echo "var mod_WMSpreferences_target1 = '".trim($target[0])."';";
+echo "var mod_WMSpreferences_target2 = '".trim($target[1])."';";
+echo "</script>";
+
+$sql_visible = "SELECT * FROM gui_wms WHERE fkey_gui_id = '".$_SESSION["mb_user_gui"]."'"; 
+$res_visible = db_query($sql_visible); 
+$cnt_visible = 0; 
+while($row = db_fetch_array($res_visible)){
+   $gui_wms_visible[$cnt_visible] = $row["gui_wms_visible"];
+   $fkey_wms_id_visible[$cnt_visible] = $row["fkey_wms_id"];
+
+	 if($cnt_visible>0){
+						 $vis .= ",";
+						 $wmsid .= ",";		
+		}
+	 	$vis .= $gui_wms_visible[$cnt_visible];
+		$wmsid .= $fkey_wms_id_visible[$cnt_visible];
+	 #echo "alert($fkey_wms_id_visible[$cnt_visible]);";
+   $cnt_visible++;
+}
+
+
+echo '<script type="text/javascript">';
+echo "var mod_gui_wms_visible = '".$vis."';";
+echo "var mod_fkey_wms_id_visible = '".$wmsid."';";
+//echo "alert(mod_gui_wms_visible);";
+echo "</script>";
+
+
+?>
+<script type="text/javascript">
+<!--
+var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);
+var my = window.opener.mb_mapObj[ind];
+
+function setMapformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_mapformat = tmp[1];
+	loadWMS();
+}
+function setFeatureformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_featureinfoformat = tmp[1];
+	loadWMS();
+}
+function setExceptionformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_exceptionformat = tmp[1];
+	loadWMS();
+}
+
+// CB:
+// this private function swaps the wms at index num with the one at num-1
+// used by up(num)
+//
+function swap(num) {
+
+	//
+	// swap wmses in mb_mapObj
+	//
+	var upper = new Object();
+	upper = my.wms[num-1];
+	var lower = new Object();
+	my.wms[num-1] = my.wms[num];
+	my.wms[num] = upper;
+	
+	window.opener.mb_execloadWmsSubFunctions();
+	//window.opener.frames[mod_WMSpreferences_target2].document.location.reload();
+
+	//
+	// swap layers, styles, querylayers
+	//
+	var upperLayers = my.layers[num-1];
+	var upperStyles = my.styles[num-1];
+	var upperQuerylayers = my.querylayers[num-1];
+	my.layers[num-1] = my.layers[num];
+	my.styles[num-1] = my.styles[num];
+	my.querylayers[num-1] = my.querylayers[num];
+	my.layers[num] = upperLayers;
+	my.styles[num] = upperStyles;
+	my.querylayers[num] = upperQuerylayers;
+
+}
+
+function up(num){
+	var cnt_vis=0;
+	var wms_visible_down = mod_gui_wms_visible.split(",");
+
+	for(var i=0; i < wms_visible_down.length; i++){
+		if (wms_visible_down[i] == 0) {
+			cnt_vis++;		
+		} 
+	}	
+
+	// swap if index is valid
+	if (num > cnt_vis){
+		swap(num);
+
+		loadWMS();
+		window.opener.zoom(mod_WMSpreferences_target1, true, 1.0);
+	}
+}
+
+function down(num){
+	var cnt_vis=0;
+	var wms_visible_down = mod_gui_wms_visible.split(",");
+
+	for(var i=0; i < wms_visible_down.length; i++){
+		if (wms_visible_down[i] == 0){
+			cnt_vis ++;		
+		}
+	}	
+
+	// swap if index is valid
+	if(num >= cnt_vis && num < my.wms.length-1){	
+		swap(num+1);
+
+		loadWMS();
+		window.opener.zoom(mod_WMSpreferences_target1, true, 1.0);
+	}
+}
+
+function remove_wms(num){
+	var cnt_vis=0;
+	var wms_visible_down = mod_gui_wms_visible.split(",");
+	var wms_vis_down = wms_visible_down.length;
+	
+	//check if there are more than two visible wms's
+	for(var i=0; i < wms_visible_down.length; i++){
+		var my_wms_visible = wms_visible_down[i];
+		if(my_wms_visible == 0){
+  			var cnt_vis = cnt_vis+1;		
+		} // end if
+	}// end for	
+  	//alert(num +" length:"+my.wms.length);
+
+	if(my.wms.length - cnt_vis>1){
+	  	var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);  
+  		window.opener.mb_mapObjremoveWMS(ind,num) 
+		window.opener.mb_execloadWmsSubFunctions();
+//  	window.opener.frames[mod_WMSpreferences_target2].document.location.reload();
+  		window.location.reload();
+	}
+	else{
+		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
+	}	
+}
+
+function loadWMS(){
+	var str = "";
+	
+	var wms_visible = mod_gui_wms_visible.split(",");
+	var wms_id_visible = mod_fkey_wms_id_visible.split(",");
+	var bool_wms_vis = false;
+
+	for(var i=0; i < my.wms.length; i++){
+		 var wms_compare = my.wms[i].wms_id;
+				for(var j=0; j < wms_id_visible.length; j++){
+						var wms_new = 0;
+      							if(wms_id_visible[j] == wms_compare){
+      									var my_wms_visible = wms_visible[j];
+      									//alert(my_wms_visible);
+												var bool_wms = true; 
+												break;
+      									}
+      									else {
+														 var bool_wms = false;
+      							   }
+			} //end  for(var j=0; j < wms_id_visible.length; j++){			
+
+	//	if(my_wms_visible == 1){  
+			if(my_wms_visible == 1 || bool_wms == false ){ 
+		
+		str += "<table border='1' rules='rows'>";  
+		str += "<tr>";
+		str += "<th>Title: </th><th  width='300'><div id ='id_"+my.wms[i].wms_id+"' style='cursor:pointer' onmouseover = 'title=\""+my.wms[i].wms_abstract+"\"'><b>"+my.wms[i].wms_title+"</b></div></th>";
+		str += "</tr>";
+		str += "<tr>";
+		str += "<td>ID:</td><td>"+my.wms[i].wms_id+"</td>";
+		str += "</tr>";
+      
+		str += "<tr>";		
+		str += "<td>MapImageFormat: </td><td>";
+		str += "<select onchange='setMapformat(this.value)'>"
+		for(var j=0; j<my.wms[i].data_type.length; j++){
+			if(my.wms[i].data_type[j] == 'map'){
+				str += "<option value='"+i+","+my.wms[i].data_format[j]+"'";
+				if(my.wms[i].data_format[j] == my.wms[i].gui_wms_mapformat){
+					str += "selected";
+				}
+				str += ">"+my.wms[i].data_format[j]+"</option>";
+			}
+		}
+		str += "</select>";
+		str += "</td>";
+		str += "</tr>";
+
+		str += "<tr >";
+		str += "<td>FeatureInfoFormat: </td><td>";
+		str += "<select onchange='setFeatureformat(this.value)'>"
+		for(var j=0; j<my.wms[i].data_type.length; j++){
+			if(my.wms[i].data_type[j] == 'featureinfo'){
+				str += "<option value='"+i+","+my.wms[i].data_format[j]+"'";
+				if(my.wms[i].data_format[j] == my.wms[i].gui_wms_featureinfoformat){
+					str += "selected";
+				}
+				str += ">"+my.wms[i].data_format[j]+"</option>";
+			}
+		}
+		str += "</select>";
+		str += "</td>";
+		str += "</tr>";
+		
+		str += "<tr>";
+		str += "<td>ExceptionFormat: </td><td>";
+		str += "<select onchange='setExceptionformat(this.value)'>"
+		for(var j=0; j<my.wms[i].data_type.length; j++){
+			if(my.wms[i].data_type[j] == 'exception'){
+				str += "<option value='"+i+","+my.wms[i].data_format[j]+"'";
+				if(my.wms[i].data_format[j] == my.wms[i].gui_wms_exceptionformat){
+					str += "selected";
+				}
+				str += ">"+my.wms[i].data_format[j]+"</option>";
+			}
+		}
+		str += "</select>";
+		str += "</td>";
+		str += "</tr>";
+		
+		str += "<tr>";
+    str += "<table>";
+      
+    str += "<p><input class='up' type='button' onclick='up("+i+")' value='up'>&nbsp;&nbsp; ";
+    str += "<input class='down' type='button' onclick='down("+i+")' value='down'>&nbsp;&nbsp; ";
+		str += "<input class='remove' type='button' onclick='remove_wms("+i+")' value='remove'></p><br>";
+		
+		/*str += "<td><input class='up' type='button' onclick='up("+i+")' value='up'></td>";
+		str += "<td ><input class='remove' type='button' onclick='remove_wms("+i+")' value='remove'></td>";
+		str += "</tr>";
+		str += "<table><br />";*/
+
+	} //end  for(var i=0; i < my.wms.length; i++){ 
+	} //neu  END		if(my_wms_visible == 1){
+	document.getElementById('data').innerHTML = str;
+}
+
+// -->
+</script>
+</head>
+<body onload='loadWMS()'>
+<div id='data'><div>
+<form>
+<input type='hidden' name='visibility' value=''>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_changeEPSG.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_changeEPSG.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_changeEPSG.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,215 @@
+<?php
+# $Id: mod_changeEPSG.php,v 1.13 2006/03/09 10:33:11 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_changeEPSG.php,v 1.13 2006/03/09 10:33:11 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+require("mb_validateSession.php");
+$gui_id = $_SESSION["mb_user_gui"];
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Change Spatial Reference System EPSG Code</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+<!--
+
+.epsg{
+	width:100px;
+	border: solid;
+}
+-->
+</style>
+<?php
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'changeEPSG' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+
+# erst noch die History einbauen und dann nach dem Ursprungsextent suchen.....
+echo "<script type='text/javascript'>";
+echo "var myTarget = '".db_result($res,0,"e_target")."';";
+echo "</script>";
+
+
+###transform coordinates
+if(isset($_REQUEST["srs"])){
+  require_once("../../conf/mapbender.conf");
+
+
+  $arraymapObj = split("###", $_REQUEST["srs"]);
+
+  echo "<script type='text/javascript'>";
+  echo "var newExtent = new Array();";
+
+  for($i=0; $i < count($arraymapObj); $i++){
+     $temp = split(",",$arraymapObj[$i]);
+     
+     if(SYS_DBTYPE=='pgsql'){
+		$con = db_connect($DBSERVER,$OWNER,$PW);
+
+	     $sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+	     $resMinx = db_query($sqlMinx);
+	     $minx = db_result($resMinx,0,"minx");
+	
+	     $sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+	     $resMiny = db_query($sqlMiny);
+	     $miny = db_result($resMiny,0,"miny");
+	
+	     $sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+	     $resMaxx =db_query($sqlMaxx);
+	     $maxx = db_result($resMaxx,0,"maxx");
+	
+	     $sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+	     $resMaxy = db_query($sqlMaxy);
+	     $maxy = db_result($resMaxy,0,"maxy");
+
+     }else{
+			$con_string = "host=$GEOS_DBSERVER port=$GEOS_PORT dbname=$GEOS_DB user=$GEOS_OWNER password=$GEOS_PW";
+			$con = pg_connect($con_string) or die ("Error while connecting database");
+
+	     $sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+	     $resMinx = pg_query($con,$sqlMinx);
+	     $minx = pg_fetch_result($resMinx,0,"minx");
+	
+	     $sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+	     $resMiny = pg_query($con,$sqlMiny);
+	     $miny = pg_fetch_result($resMiny,0,"miny");
+	
+	     $sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+	     $resMaxx = pg_query($con,$sqlMaxx);
+	     $maxx = pg_fetch_result($resMaxx,0,"maxx");
+	
+	     $sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+	     $resMaxy = pg_query($con,$sqlMaxy);
+	     $maxy = pg_fetch_result($resMaxy,0,"maxy");
+     }
+
+     #frameName, EPSG, minx, miny, maxx, maxy, width, height
+
+     $extenty = $maxy - $miny;
+     $extentx = $maxx - $minx;
+     $relation_px_x = $temp[6] / $temp[7];
+     $relation_px_y = $temp[7] / $temp[6];
+     $relation_bbox_x = $extentx / $extenty;
+
+     if($relation_bbox_x <= $relation_px_x){
+         $centerx = $minx + ($extentx/2);
+         $minx = $centerx - $relation_px_x * $extenty / 2;
+         $maxx = $centerx + $relation_px_x * $extenty / 2;
+     }
+     if($relation_bbox_x > $relation_px_x){
+         $centery = $miny + ($extenty/2);
+         $miny = $centery - $relation_px_y * $extentx / 2;
+         $maxy = $centery + $relation_px_y * $extentx / 2;
+     }
+     echo "newExtent[".$i."] = '".$temp[0].",".$_REQUEST["newSRS"].",".$minx.",".$miny.",".$maxx.",".$maxy."';";
+}
+  echo "</script>";
+}
+else{
+   echo "<script type='text/javascript'>var newExtent = false;</script>";
+}
+?>
+<script type='text/javascript'>
+<!--
+if(newExtent == false){
+ parent.mb_registerSubFunctions("window.frames['changeEPSG'].mod_changeEPSG_setBox()");
+}
+function mod_changeEPSG_init(){
+//frameName, EPSG, minx, miny, maxx, maxy, width, height
+   var exists = false;
+   if(newExtent){
+      for(var i=0; i<newExtent.length; i++){
+         var temp = newExtent[i].split(",");
+         if(temp[0] == myTarget){
+           for(var ii=0; ii<parent.mb_MapHistoryObj[temp[0]].length; ii++){
+              if(parent.mb_MapHistoryObj[temp[0]][ii].epsg == temp[1]){
+                 exists = ii;
+                 var goback = true;
+              }
+           }
+           var ind = parent.getMapObjIndexByName(temp[0]);
+           if(goback){
+              parent.mb_mapObj[ind].epsg = temp[1];
+              parent.mb_mapObj[ind].extent = parent.mb_MapHistoryObj[temp[0]][exists].extent;
+              parent.setMapRequest(temp[0]);
+           }
+           else{
+               parent.mb_mapObj[ind].epsg = temp[1];
+               parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
+               parent.setMapRequest(temp[0]);
+           }
+         }
+         if(temp[0] != myTarget){
+           var ind = parent.getMapObjIndexByName(temp[0]);
+           parent.mb_mapObj[ind].epsg = temp[1];
+           parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
+           parent.setMapRequest(temp[0]);
+         }
+      }
+   }
+}
+function mod_changeEPSG_setBox(){
+   var myEPSG = parent.mb_mapObj[0].epsg;
+   for(var i=0; i<document.forms[0].epsg.length; i++){
+      if(document.forms[0].epsg.options[i].value == myEPSG){
+         document.forms[0].epsg.selectedIndex = i;
+         isEPSG = true;
+      }
+   }
+}
+function mod_changeEPSG(){
+    str_srs = "";
+    for(var i=0; i<parent.mb_mapObj.length; i++){
+      if(i>0){str_srs += "###";}
+      str_srs += parent.mb_mapObj[i].frameName + "," + parent.mb_mapObj[i].epsg + "," + parent.mb_mapObj[i].extent + ","+parent.mb_mapObj[i].width+","+parent.mb_mapObj[i].height;
+    }
+    document.forms[0].srs.value = str_srs;
+    var ind = document.forms[0].epsg.selectedIndex;
+    document.forms[0].newSRS.value = document.forms[0].epsg.options[ind].value;
+    document.forms[0].submit();
+}
+// -->
+</script>
+</head>
+<body leftmargin="1" topmargin="1" onload="mod_changeEPSG_init()" bgcolor="red">
+<form action="<?php echo $PHP_SELF .'?'.SID  ?>" method='POST'>
+<select class='epsg' name='epsg' onchange='mod_changeEPSG()'>
+<option value="">undefined</option>
+<option value="EPSG:4326">EPSG:4326</option>
+<option value="EPSG:31466">EPSG:31466</option>
+<option value="EPSG:31467">EPSG:31467</option>
+<option value="EPSG:31468">EPSG:31468</option>
+<option value="EPSG:31469">EPSG:31469</option>
+</select>
+<input type="hidden" name="srs" value="">
+<input type="hidden" name="newSRS" value="">
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_changeEPSG_dynamic.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_changeEPSG_dynamic.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_changeEPSG_dynamic.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,252 @@
+<?php
+# $Id: mod_changeEPSG_dynamic.php,v 1.8 2006/03/09 12:13:00 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_changeEPSG_dynamic.php,v 1.8 2006/03/09 12:13:00 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require("mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein, T. Wirkus">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>changeEPSG_dynamic</title>
+<style type="text/css">
+<!--
+
+.epsg{
+	width:100px;
+	border: solid;
+}
+-->
+</style>
+<?php
+$gui_id = $_SESSION["mb_user_gui"];
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'changeEPSG' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+
+/*TW: EPSG_Code dynamic   ********************************************************************************************/
+$cnt_gui_wms = 0;
+$cnt_epsg_wms = 0;
+$cnt_layer_wms = 0;
+
+/*get allocated wms from allocated gui  ********************************************************************************************/								 
+$sql_gui_wms = "SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id IN (";
+$sql_gui_wms .= "'".$gui_id."'";
+$sql_gui_wms.= ") ORDER BY fkey_wms_id";
+# echo"$sql_gui_wms";
+$res_gui_wms = db_query($sql_gui_wms);
+                 while(db_fetch_row($res_gui_wms)){
+                    $fkey_gui_id[$cnt_gui_wms] = db_result($res_gui_wms,$cnt_gui_wms,"fkey_gui_id");
+                    $fkey_wms_id_1[$cnt_gui_wms] = db_result($res_gui_wms,$cnt_gui_wms,"fkey_wms_id");
+						        $cnt_gui_wms++;
+	}					 
+/*get allocated wms from allocated gui  ********************************************************************************************/							 
+	
+/*get allocated layer_id from allocated gui  ********************************************************************************************/								 
+$sql_layer_wms = "SELECT  layer_id FROM layer WHERE fkey_wms_id IN (";
+
+for($i=0; $i<count($fkey_wms_id_1); $i++){
+ if($i>0){ $sql_layer_wms .= ",";}
+ $sql_layer_wms .= "'".$fkey_wms_id_1[$i]."'";
+}
+$sql_layer_wms.= ") ORDER BY layer_id";
+
+$res_layer_wms = db_query($sql_layer_wms);
+                 while($row = db_fetch_array($res_layer_wms)){
+                    $layer_id[$cnt_layer_wms] = $row["layer_id"];
+                    $fkey_wms_id[$cnt_layer_wms] = $row["fkey_wms_id"];
+                    $cnt_layer_wms++;
+}					 							 
+/*get allocated wms from allocated gui  ********************************************************************************************/							 
+	
+	
+/*get allocated epsg-code from allocated wms  ********************************************************************************************/								 
+#$sql_epsg_layer = "SELECT DISTINCT epsg FROM layer_epsg WHERE fkey_layer_id IN (";
+$sql_epsg_wms = "SELECT DISTINCT wms_srs FROM wms_srs WHERE fkey_wms_id IN (";
+for($i=0; $i<count($fkey_wms_id_1); $i++){
+ if($i>0){ $sql_epsg_wms .= ",";}
+  $sql_epsg_wms .= "'".$fkey_wms_id_1[$i]."'";
+       }
+$sql_epsg_wms.= ") ORDER BY wms_srs";
+
+$res_epsg_wms = db_query($sql_epsg_wms);
+                 while($row = db_fetch_array($res_epsg_wms)){
+                    $fkey_wms_id_2[$cnt_epsg_wms] = $row["fkey_wms_id"];
+                    $epsg_code[$cnt_epsg_wms] = $row["wms_srs"];
+                    $cnt_epsg_wms++;  //possible error because increment before echo statement
+		    echo"$epsg_code[$cnt_epsg_wms]";
+                 }		
+
+								 
+# erst noch die History einbauen und dann nach dem Ursprungsextent suchen.....
+echo "<script type='text/javascript'>";
+echo "var myTarget = '".db_result($res,0,"e_target")."';";
+echo "</script>";
+###transform coordinates
+if(isset($_REQUEST["srs"])){
+  require_once("../../conf/mapbender.conf");
+  $con = pg_connect ($con_string) or die ("Error while connecting database DBname");
+
+  $arraymapObj = split("###", $_REQUEST["srs"]);
+
+  echo "<script type='text/javascript'>";
+  echo "var newExtent = new Array();";
+
+  for($i=0; $i < count($arraymapObj); $i++){
+     $temp = split(",",$arraymapObj[$i]);
+ 
+     $sqlMinx = "SELECT X(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as minx";
+     $resMinx = @pg_query($con,$sqlMinx);
+     $minx = pg_result($resMinx,0,"minx");
+
+     $sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(".$temp[2]." ".$temp[3].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as miny";
+     $resMiny = @pg_query($con,$sqlMiny);
+     $miny = pg_result($resMiny,0,"miny");
+
+     $sqlMaxx = "SELECT X(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxx";
+     $resMaxx = @pg_query($con,$sqlMaxx);
+     $maxx = pg_result($resMaxx,0,"maxx");
+
+     $sqlMaxy = "SELECT Y(transform(GeometryFromText('POINT(".$temp[4]." ".$temp[5].")',".str_replace("EPSG:","",$temp[1])."),".str_replace("EPSG:","",$_REQUEST["newSRS"]).")) as maxy";
+     $resMaxy = @pg_query($con,$sqlMaxy);		 
+     $maxy = pg_result($resMaxy,0,"maxy");
+
+
+     #frameName, EPSG, minx, miny, maxx, maxy, width, height
+
+     $extenty = $maxy - $miny;
+     $extentx = $maxx - $minx;
+     $relation_px_x = $temp[6] / $temp[7];
+     $relation_px_y = $temp[7] / $temp[6];
+     $relation_bbox_x = $extentx / $extenty;
+
+     if($relation_bbox_x <= $relation_px_x){
+         $centerx = $minx + ($extentx/2);
+         $minx = $centerx - $relation_px_x * $extenty / 2;
+         $maxx = $centerx + $relation_px_x * $extenty / 2;
+     }
+     if($relation_bbox_x > $relation_px_x){
+         $centery = $miny + ($extenty/2);
+         $miny = $centery - $relation_px_y * $extentx / 2;
+         $maxy = $centery + $relation_px_y * $extentx / 2;
+     }
+     echo "newExtent[".$i."] = '".$temp[0].",".$_REQUEST["newSRS"].",".$minx.",".$miny.",".$maxx.",".$maxy."';";
+
+}
+  echo "</script>";
+}
+else{
+   echo "<script type='text/javascript'>var newExtent = false;</script>";
+}
+
+?>
+<script type='text/javascript'>
+<!--
+if(newExtent == false){
+ parent.mb_registerSubFunctions("window.frames['changeEPSG_dynamic'].mod_changeEPSG_setBox()");
+}
+function mod_changeEPSG_init(){
+//frameName, EPSG, minx, miny, maxx, maxy, width, height
+   var exists = false;
+   if(newExtent){
+      for(var i=0; i<newExtent.length; i++){
+         var temp = newExtent[i].split(",");
+         if(temp[0] == myTarget){
+           for(var ii=0; ii<parent.mb_MapHistoryObj[temp[0]].length; ii++){
+              if(parent.mb_MapHistoryObj[temp[0]][ii].epsg == temp[1]){
+                 exists = ii;
+                 var goback = true;
+              }
+           }
+           var ind = parent.getMapObjIndexByName(temp[0]);
+           if(goback){
+              parent.mb_mapObj[ind].epsg = temp[1];
+              parent.mb_mapObj[ind].extent = parent.mb_MapHistoryObj[temp[0]][exists].extent;
+              parent.setMapRequest(temp[0]);
+           }
+           else{
+               parent.mb_mapObj[ind].epsg = temp[1];
+               parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
+               parent.setMapRequest(temp[0]);
+           }
+         }
+         if(temp[0] != myTarget){
+           var ind = parent.getMapObjIndexByName(temp[0]);
+           parent.mb_mapObj[ind].epsg = temp[1];
+           parent.mb_mapObj[ind].extent = parseFloat(temp[2]) + "," + parseFloat(temp[3]) + "," + parseFloat(temp[4]) + "," + parseFloat(temp[5]);
+           parent.setMapRequest(temp[0]);
+         }
+      }
+   }
+}
+function mod_changeEPSG_setBox(){
+   var myEPSG = parent.mb_mapObj[0].epsg;
+   for(var i=0; i<document.forms[0].epsg.length; i++){
+      if(document.forms[0].epsg.options[i].value == myEPSG){
+         document.forms[0].epsg.selectedIndex = i;
+         isEPSG = true;
+      }
+   }
+}
+function mod_changeEPSG(){
+    str_srs = "";
+    for(var i=0; i<parent.mb_mapObj.length; i++){
+      if(i>0){str_srs += "###";}
+      str_srs += parent.mb_mapObj[i].frameName + "," + parent.mb_mapObj[i].epsg + "," + parent.mb_mapObj[i].extent + ","+parent.mb_mapObj[i].width+","+parent.mb_mapObj[i].height;
+    }
+    document.forms[0].srs.value = str_srs;
+    var ind = document.forms[0].epsg.selectedIndex;
+    document.forms[0].newSRS.value = document.forms[0].epsg.options[ind].value;
+    document.forms[0].submit();
+}
+// -->
+</script>
+</head>
+
+<body leftmargin="1" topmargin="1" onload="mod_changeEPSG_init()" bgcolor="#0066cc">
+ 
+<?php
+/*insert EPSG in selectbox************************************************************************************/
+echo "<form action='" . $PHP_SELF . "?".SID."' method='post'>";
+#echo "<select  class='epsg' name='epsg' onChange='mod_changeEPSG()'><option value=\"\">undefined</option>";
+echo "<select  class='epsg' name='epsg' onChange='mod_changeEPSG()'>";
+		 for($i=0; $i<$cnt_epsg_wms; $i++){
+        echo "<option value='" . $epsg_code[$i] . "' ";
+           if($epsg && $epsg == $epsg_code[$i]){
+           }
+           echo ">" . $epsg_code[$i]  . "</option>";
+																 }
+echo "</select>";
+/*insert EPSG in selectbox************************************************************************************/
+#echo"<input type='text'size='30' name='srs' value=''>";
+echo"<input type='hidden' name='srs' value=''>";
+echo"<input type='hidden' name='newSRS' value=''>";
+echo"</form>"; 
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_changePassword.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_changePassword.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_changePassword.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,215 @@
+<?php
+# $Id: mod_changePassword.php,v 1.12 2006/03/09 10:38:10 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_changePassword.php,v 1.12 2006/03/09 10:38:10 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+import_request_variables("PG");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Password</title>
+<style type="text/css">
+<!--
+
+body{
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+.desc{
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 9px;
+}
+.myButton{
+   font-family: Arial, Helvetica, sans-serif;
+   width : 150px;
+}
+-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+   if(wert == 'newpassword'){
+      if(document.form1.newpassword.value == ""){
+         //alert("Bitte geben Sie ein neues Passwort an.");
+         alert("Please enter a new password.");
+         document.form1.newpassword.focus();
+         document.form1.upd.value='false';
+         return false;
+      }
+      if(document.form1.newpassword.value.length < 6 || document.form1.newpassword.value.search(/\d/) == -1 || document.form1.newpassword.value.search(/\D/) == -1 ){
+         //alert("Bitte beachten Sie die unten\naufgeführten Passwortregeln!");
+         alert("Please note the rules for choosing a password below!");
+         document.form1.newpassword.focus();
+         document.form1.upd.value='false';
+         return false;
+      }
+      var letter =  document.form1.newpassword.value.match(/\D/);
+      if(eval("document.form1.newpassword.value.match(/" + letter + "/gi).length") > 4){
+         //alert("Bitte beachten Sie die unten\naufgeführten Passwortregeln!");
+         alert("Please note the rules for choosing a password below!");
+         document.form1.newpassword.focus();
+         document.form1.upd.value='false';
+         return false;
+      }
+      var integer =  document.form1.newpassword.value.match(/\d/);
+      if(eval("document.form1.newpassword.value.match(/" + integer + "/gi).length") > 4){
+         //alert("Bitte beachten Sie die unten\naufgeführten Passwortregeln!");
+         alert("Please note the rules for choosing a password below!");
+         document.form1.newpassword.focus();
+         document.form1.upd.value='false';
+         return false;
+      }
+      if(document.form1.confirmpassword.value == ""){
+         //alert("Bitte bestätigen Sie das Passwort.");
+         alert("Please confirm the password.");
+         document.form1.confirmpassword.focus();
+         document.form1.upd.value='false';
+         return false;
+      }      
+      if(document.form1.newpassword.value!=document.form1.confirmpassword.value) {
+          //alert("Die Passwörter stimmen nicht überein.");
+          alert("The password entries do not match.");
+          document.form1.confirmpassword.value='';
+          document.form1.confirmpassword.focus();
+          document.form1.upd.value='false';
+          return false;
+      }
+
+      else{
+         document.form1.upd.value='true';
+         document.form1.submit();
+      }
+   }
+}
+</script>
+</head>
+<body>
+<?php
+//the database-params
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle INSERT and DELETE************************************************************************************/
+if($upd){
+   $sql_user_id = "SELECT mb_user_id FROM mb_user WHERE mb_user_id='".$logged_user_id."';";
+   $res_user_id = db_query($sql_user_id);
+   $real_user_id = db_result($res_user_id,0,"mb_user_id");   
+   
+   $sql_password = "SELECT mb_user_password,mb_user_password='".$newpassword."' as new FROM mb_user where mb_user_id='".$real_user_id."'";
+   $res_password = db_query($sql_password);
+   if(db_result($res_password,0,"mb_user_password") != db_result($res_password,0,"new")){
+      
+	$sql_update = "UPDATE mb_user SET mb_user_password=";
+	
+	
+	 if (SYS_DBTYPE=="mysql"){
+	     	$sql_update.= "password('".$newpassword."')";
+	     }else{
+			if (MD5 == 'false'){
+				$sql_update .= "'".$newpassword."'";
+			}else{
+				$sql_update .= "md5('".$newpassword."')";
+			}
+	}
+	     
+	$sql_update .= " WHERE mb_user_id='".$real_user_id."'";
+	#echo $sql_update;
+	
+      db_query($sql_update);
+      echo "<script language='javascript'>";
+      //echo "alert('Passwort wurde geändert!');";
+      echo "alert('Password has been updated!');";
+      echo "</script>";
+   }
+   else{
+      echo "<script language='javascript'>";
+      //echo "alert('Bitte beachten Sie die unten aufgeführten Passwortregeln!');";
+      echo "alert('Please note the rules for choosing a password below!');";
+      echo "</script>";
+   }
+}
+
+
+/*HTML*****************************************************************************************************/
+
+//echo "<fieldset><legend>Passwort &auml;ndern:</legend>";
+echo "<fieldset><legend>Change password:</legend>";
+#echo "<form name='form1' action='" . $PHP_SELF . "' method='post'>";
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<table cellpadding='5' cellspacing='0' border='0'>";
+echo "<td>";
+//echo "neues Passwort:";
+echo "new password:";
+echo "</td>";
+echo "<td>";
+echo "<input type='text' name='newpassword' value=''>";
+echo "</td>";
+echo"</tr>";
+echo"<tr>";
+echo "<td>";
+//echo "Passwort best&auml;tigen:";
+echo "confirm:";
+echo "</td>";
+echo "<td>";
+echo "<input type='text' name='confirmpassword' value=''>";
+echo "</td>";
+echo "</tr>";
+echo"<tr>";
+echo"<td>";
+echo "<input type='hidden' name='profile_id' value='";
+echo "$profile_id";
+echo "'>";
+echo "</td>";
+echo"<td></tr></table>";
+echo "<input type='hidden' name='upd' value=''>";
+//echo "<center><input class='myButton' type='button' name='update' value='&auml;ndern' onClick='validate(\"newpassword\")'></center>";
+echo "<center><input class='myButton' type='button' name='update' value='update' onClick='validate(\"newpassword\")'></center>";
+echo "</form>";
+/*********************************************************************/
+
+?>
+</fieldset><br />
+
+<div class='desc'>
+
+Please note: <br />
+- the password has to be different from the old one<br />
+- the minimum length is six characters<br />
+- it must contain a digit<br />
+- it must not be composed entirely of digits<br />
+- no character may be used more than four times<br /> 
+
+<!--
+Bitte beachten Sie:<br>
+- Das Passwort muss sich von dem alten Passwort unterscheiden<br />
+- Das Passwort muss mindestens 6 Zeichen lang sein<br />
+- Das Passwort muss mindestens eine Zahl enthalten<br />
+- Das Passwort darf nicht ausschlie&szlig;lich aus Zahlen bestehen<br />
+- Kein Zeichen darf mehr als vier mal vorkommen
+-->
+</div>
+
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_createJSObjFromDB.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_createJSObjFromDB.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_createJSObjFromDB.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,35 @@
+<?php
+# $Id: mod_createJSObjFromDB.php,v 1.9 2005/10/04 10:25:09 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_createJSObjFromDB.php,v 1.9 2005/10/04 10:25:09 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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_validateSession.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+$sql = "SELECT fkey_wms_id FROM gui_wms WHERE fkey_gui_id = '".$_SESSION["mb_user_gui"]."' ORDER BY gui_wms_position";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+     $mywms = new wms();
+     $mywms->createObjFromDB($_SESSION["mb_user_gui"],$row["fkey_wms_id"]);
+     $mywms->createJsObjFromWMS();
+     $cnt++;
+} 
+?>      

Added: trunk/mapbender/http/php/mod_createJSObjFromXML.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_createJSObjFromXML.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_createJSObjFromXML.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,47 @@
+<?php
+# $Id: mod_createJSObjFromXML.php,v 1.11 2006/03/09 11:24:27 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_createJSObjFromXML.php,v 1.11 2006/03/09 11:24:27 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WMS</title>
+<?php
+echo "<script type='text/javascript'>";
+require_once("../classes/class_wms.php");
+$mywms = new wms();
+$mywms->createObjFromXML($_REQUEST['caps']);
+if(!$mywms->wms_status){ echo "alert('Error: no valid capabilities-document! Please check whether this server complies to OGC WMS specification.'); </script>"; die; }
+$mywms->optimizeWMS();
+$mywms->createJsObjFromWMS("TRUE");
+echo "parent.mod_addWMS_refresh();";
+echo "</script>";
+?>
+</head>
+<body bgcolor='#ffffff'>
+
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_createUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_createUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_createUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,305 @@
+<?php
+# $Id: mod_createUser.php,v 1.13 2006/03/09 11:24:35 astrid_emde Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_createUser.php,v 1.13 2006/03/09 11:24:35 astrid_emde Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_gui.php");
+require_once("../classes/class_administration.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>createUser</title>
+<style type="text/css">
+  	<!--
+  	body{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+  	a:link{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		text-decoration : none;
+  		color: #808080;
+  	}
+  	a:visited {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	a:active {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	-->
+</style>
+<?php
+$myPW = "**********";
+echo "<script language='JavaScript'>var myPW = '".$myPW."';</script>";
+?>
+<script language="JavaScript">
+
+function validate(val){
+   var ok = validateInput();
+   if(ok == 'true'){
+     var permission = false;
+     if(val == 'save'){
+        permission = confirm("Save changes?");
+     }
+     if(permission == true){
+        if(document.forms[0].password.value == myPW){
+            document.forms[0].password.value = '';
+        }
+        document.forms[0].action.value = val;
+        document.forms[0].submit();
+     }
+   }
+}
+function validateInput(){
+  var str_alert = "Input incorrect!";
+  if(document.forms[0].name.value == ''){
+      alert(str_alert);
+      document.forms[0].name.focus();
+      return 'false';
+  }
+  if(document.forms[0].password.value == ''){
+      alert(str_alert);
+      document.forms[0].password.focus();
+      return 'false';
+  }
+  else if(document.forms[0].password.value != document.forms[0].v_password.value){
+      alert("Password verification failed. Please enter the same password twice.");
+      document.forms[0].password.focus();
+      return 'false';
+  }
+  return 'true';
+}
+
+</script>
+
+</head>
+<body>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+#save
+if($action == 'save'){
+$owner_id =1;
+$resolution = 72;
+$login_count = 0;
+		
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "Insert INTO mb_user (mb_user_name, mb_user_password,mb_user_owner, mb_user_description, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution) VALUES ";
+     $sql.= "('".$name."',";
+     
+     
+	if(SYS_DBTYPE == "mysql") {
+		$sql .= "password('".$password."')";
+	}
+	else {
+		if (MD5 == 'false'){
+			$sql .= "'".$password."'";
+		}else{
+			$sql .= "md5('".$password."')";
+		}
+	}
+	
+	$sql.=",".$owner_id.",'".$description."', '".$email."', '".$phone."', '".$department."', ".$resolution.");";
+	
+     $res = db_query($sql);
+     $selected_user = db_insert_id('platzhalter','mb_user','mb_user_id');
+		 
+	 $sql_owner = "Update mb_user SET mb_user_owner = ";
+     $sql_owner.= "1"; #$selected_user;
+     $sql_owner.= " WHERE mb_user_name ='".$name."'";
+     $res_owner = db_query($sql_owner);	 
+ 	 
+ 	 # removed, because a new user may be inserted in a group with too much rights  
+ 	 $sql_group = "Insert INTO mb_user_mb_group (fkey_mb_user_id, fkey_mb_group_id) VALUES ";
+     $sql_group.= "(".$selected_user.", 20);";
+     $res_group = db_query($sql_group);
+     
+     // CB (begin)
+     // adding new GUIs for new user (copies of gui and gui1 with owner rights)
+     //
+     
+     $gui = new gui();
+     $admin = new administration();
+     
+     //create new name for gui
+     $gui_id1 = $admin->getGuiIdByGuiName("gui");
+     $gui_id2 = $admin->getGuiIdByGuiName("gui1");
+     $gui_newName1 = $name . "_gui";
+     $gui_newName2 = $name . "_gui1";
+
+     //check if new gui names are already taken
+     while ($gui->guiExists($gui_newName1)) {
+     	$gui_newName1 .= "_1";
+     }
+     while ($gui->guiExists($gui_newName2)) {
+     	$gui_newName2 .= "_1";
+     }
+
+	 //create gui_(name) and gui1_(name)
+     $gui->copyGui($gui_id1[0], $gui_newName1,true);
+     $gui->copyGui($gui_id2[0], $gui_newName2,true);
+     $new_guiId1 = $admin->getGuiIdByGuiName($gui_newName1);
+     $new_guiId2 = $admin->getGuiIdByGuiName($gui_newName2);
+	 
+     //grant owner rights for new guis to this user only!
+     $admin->delAllUsersOfGui($new_guiId1[0]);
+     $admin->delAllUsersOfGui($new_guiId2[0]);
+     $admin->insertUserAsGuiOwner($new_guiId1[0], $selected_user);
+     $admin->insertUserAsGuiOwner($new_guiId2[0], $selected_user);
+
+	 //delete gui from groups
+	 // (gui and gui1 are associated with groups 20 and 21, new guis belong to mb_user only)
+	 $sql_del_from_group = "DELETE FROM gui_mb_group WHERE fkey_gui_id = '".$new_guiId1[0]."' OR fkey_gui_id = '".$new_guiId2[0]."' ";
+     $res_del_from_group = db_query($sql_del_from_group);	 
+
+     // CB (end)
+     //
+   }
+}
+
+if (!isset($name) || $selected_user == 'new'){
+  $name = "";
+  $password = "";
+  $description = "";
+  $email = "";
+  $phone = "";
+  $department = "";
+}
+
+
+/*HTML*****************************************************************************************************/
+
+echo "<form name='form1' action='" . $PHP_SELF . "' method='post'>";
+echo "<table border='0'>";
+
+if(isset($selected_user) && $selected_user != 0){
+   $sql = "SELECT * FROM mb_user WHERE mb_user_id = ".$selected_user." ORDER BY mb_user_name ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      $name = db_result($res,0,"mb_user_name");
+      $password = db_result($res,0,"mb_user_password");
+      $owner_id = db_result($res,0,"mb_user_owner");
+      $description = db_result($res,0,"mb_user_description");
+      $login_count = db_result($res,0,"mb_user_login_count");
+      $email = db_result($res,0,"mb_user_email");
+      $phone = db_result($res,0,"mb_user_phone");
+      $department = db_result($res,0,"mb_user_department");
+      $resolution = db_result($res,0,"mb_user_resolution");
+   }
+   $sql = "SELECT mb_user_name FROM mb_user WHERE mb_user_id = " . $owner_id;
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      $owner_name = db_result($res,0,"mb_user_name");
+   }
+}
+#name
+echo "<tr>";
+   echo "<td>Name*:</td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='name' value='".$name."'>";
+   echo "</td>";
+echo "</tr>";
+
+#password
+echo "<tr>";
+   echo "<td>Password*: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='password' value='";
+      if(isset($selected_user) && $selected_user != 'new'){
+         echo $myPW;
+      }
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+#password
+echo "<tr>";
+   echo "<td>Confirm password*: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='v_password' value='";
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+#description
+echo "<tr>";
+   echo "<td>Description: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='description' value='".$description."'>";
+   echo "</td>";
+echo "</tr>";
+
+#email
+echo "<tr>";
+  # echo "<td>Email: </td>";
+	    echo "<td>Email <A HREF='http://wms1.ccgis.de/ewiki/index.php?id=CreateUser' target='_blank'><b>(Why?): </b></A><BR></td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='email' value='".$email."'>";
+   echo "</td>";
+echo "</tr>";
+
+#phone
+echo "<tr>";
+   echo "<td>Phone: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='phone' value='".$phone."'>";
+   echo "</td>";
+echo "</tr>";
+
+#department
+echo "<tr>";
+   echo "<td>Department: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='department' value='".$department."'>";
+   echo "</td>";
+echo "</tr>";
+
+echo"</table>";
+if($selected_user == 'new' || !isset($selected_user)){
+echo "<input type='button' value='save'  onclick='validate(\"save\")'>";
+}
+?>
+<input type='hidden' name='action' value=''>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_deleteFilteredGUI.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_deleteFilteredGUI.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_deleteFilteredGUI.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,196 @@
+<?php
+# $Id: mod_deleteFilteredGUI.php,v 1.12 2006/03/09 10:56:01 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_deleteFilteredGUI.php,v 1.12 2006/03/09 10:56:01 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+require_once("../../conf/mapbender.conf");
+require_once("../php/mb_validateSession.php");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+import_request_variables("PG");
+db_select_db(DB,$con);
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>deletefilteredGui</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+function validate(){
+	var ind = document.form1.guiList.selectedIndex;
+	if(ind > -1){
+		var permission =  confirm("delete: " + document.form1.guiList.options[ind].text + " ?");
+		if(permission == true){
+			document.form1.del.value = 1;
+			document.form1.submit();
+		}
+	}
+}
+</script>
+</head>
+<body>
+
+<?php
+###delete
+if($del){
+$sql = "DELETE FROM gui WHERE gui_id = '".$guiList."'";
+$res = db_query($sql);
+}
+###
+if(count($ownguis)>0){
+	$sql = "SELECT * from gui WHERE gui.gui_id IN(";
+	for($i=0; $i<count($ownguis); $i++){
+		if($i>0){ $sql .= ",";}
+		$sql .= "'".$ownguis[$i]."'";
+	}
+	$sql .= ") order by gui_id";
+	$res = db_query($sql);
+	$cnt = 0;
+	echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+	echo "<select class='guiList' size='20' name='guiList' class='guiList' onchange='document.form1.guiList.value = this.value;submit()'>";
+	while($row = db_fetch_array($res)){
+		$guivalue = $row["gui_id"];
+		//mark previously selected GUI <==> text = " selected" 
+		if ($guivalue == $guiList) {
+			$text = " selected";
+		}
+		else {
+			$text = "";
+		}
+	   echo "<option value='".$guivalue."'" . $text . ">".$row["gui_name"]."</option>";
+	   $cnt++;
+	}
+	echo "</select><br>";
+	
+	// If WMS is selected, show more info
+	if($guiList)
+	{
+		echo "<p class = 'wmsList'>";
+		// Show description
+		$sql = "SELECT gui_description FROM gui WHERE gui_id = '".$guiList."'";
+		$res = db_query($sql);
+		
+		echo "<b>Description:</b><br><br>";
+		
+		$cnt = 0;
+		while($row = db_fetch_array($res))
+		{
+			$text = $row["gui_description"];
+			if ($text){
+				echo $text . "<br>";
+				$cnt++;
+			}
+		}
+		if ($cnt == 0) {
+			echo "<i>- none -</i><br>";
+		}
+		
+		
+		// Show users
+		$sql = "SELECT mb_user_name FROM mb_user, gui_mb_user WHERE fkey_mb_user_id = mb_user_id AND fkey_gui_id = '".$guiList."'";
+		$res = db_query($sql);
+		
+		echo "<br><br><b>Users using this GUI</b><br><br>";
+	
+		$cnt = 0;
+		while($row = db_fetch_array($res))
+		{
+			echo $row["mb_user_name"]."<br>";
+			$cnt++;
+		}
+		if ($cnt == 0) {
+			echo "<i>- none -</i><br>";
+		}
+	
+	
+		// Show groups
+		$sql = "SELECT mb_group_name FROM mb_group, gui_mb_group WHERE fkey_mb_group_id = mb_group_id AND fkey_gui_id = '".$guiList."'";
+		$res = db_query($sql);
+		
+		echo "<br><br><b>Groups using this GUI</b><br><br>";
+	
+		$cnt = 0;
+		while($row = db_fetch_array($res))
+		{
+			echo $row["mb_group_name"]."<br>";
+			$cnt++;
+		}
+		if ($cnt == 0) {
+			echo "<i>- none -</i><br>";
+		}
+	
+	
+		// Show list of WMS exclusive to this GUI
+		$sql = "SELECT wms_id, wms_title FROM wms, gui_wms WHERE fkey_wms_id = wms_id AND fkey_gui_id = '".$guiList."'";
+		$res = db_query($sql);
+		
+		echo "<br><br><b>List of WMS exclusive to this GUI</b><br><br>";
+	
+		$cnt = 0;
+		$count = 0;
+		while($row = db_fetch_array($res))
+		{
+			$wmstitle = $row["wms_title"];
+			$wmsid =  $row["wms_id"];
+			
+			// Check how many GUIs use current WMS
+			$sql2 = "SELECT COUNT(fkey_wms_id) FROM gui_wms WHERE fkey_wms_id = '".$wmsid."'";
+			$res2 = db_query($sql2);
+			
+			// Display if only selected GUI uses current WMS
+			if (db_result($res2,0,0) == 1){
+				//echo "<input type = checkbox name = wms" . $count . ">"; 
+				echo $wmstitle . "<br>";
+				$count++;
+			}
+			$cnt++;
+		}
+		if ($count == 0) {
+			echo "<i>- none -</i><br>";
+		}
+	
+	
+	
+		echo "</p>";
+	}
+	
+	
+	
+	echo "<input class='button_del' type='button' value='delete' onclick='validate()'>";
+
+	echo "<input type='hidden' name='del'>";
+	echo "</form>";
+}else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+?>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_deleteGUI.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_deleteGUI.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_deleteGUI.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,93 @@
+<?php
+# $Id: mod_deleteGUI.php,v 1.16 2006/03/09 12:13:50 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_deleteGUI.php,v 1.16 2006/03/09 12:13:50 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place 
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+require_once("../classes/class_administration.php");
+#$admin = new administration();
+#$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>deleteGui</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+function validate(){
+	var ind = document.form1.guiList.selectedIndex;
+	if(ind > -1){
+		var permission =  confirm("delete: " + document.form1.guiList.options[ind].text + " ?");
+		if(permission == true){
+			document.form1.del.value = 1;
+			document.form1.submit();
+		}
+	}
+}
+</script>
+</head>
+<body>
+
+<?php
+require_once("../php/mb_getGUIs.php");
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+###delete
+if($guiList){
+		 $sql = "DELETE FROM gui WHERE gui_id = '".$guiList."'";
+		 $res = db_query($sql);
+}
+###
+
+
+$sql_gui = "SELECT * FROM gui ";
+$sql_gui .= " ORDER BY gui_name";
+$res_gui = db_query($sql_gui);
+
+$cnt_gui = 0;
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>"; 
+echo "<select class='guiList' size='20' name='guiList' class='guiList'>";
+
+while($row = db_fetch_array($res_gui)){
+   echo "<option value='".$row["gui_id"]."'>".$row["gui_name"]."</option>";
+   $cnt_gui++;
+}
+echo "</select><br>";
+echo "<input class='button_del' type='button' value='delete' onclick='validate()'>";
+?>
+<input type='hidden' name='del'>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_deleteWMS.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_deleteWMS.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_deleteWMS.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,327 @@
+<?php
+# $Id: mod_deleteWMS.php,v 1.19 2006/03/09 10:46:00 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_deleteWMS.php,v 1.19 2006/03/09 10:46:00 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>deleteWMS</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+
+function validate()
+{
+   var ind = document.form1.wmsList.selectedIndex;
+   if(ind > -1) {
+     var permission =  confirm("delete: " + document.form1.wmsList.options[ind].text + " ?");
+     if(permission == true) {
+        document.form1.del.value = 1;
+        document.form1.submit();
+     }
+   }
+}
+
+function suggest_deletion(email_str) 
+{
+   var ind = document.form1.wmsList.selectedIndex;
+   if(ind > -1)
+	 {
+     var permission =  confirm("A mail will be sent to the owners of '" + document.form1.wmsList.options[ind].text + "', suggesting its deletion.");
+     if(permission == true) {
+        document.form2.suggest.value = 1;
+        document.form2.wms_name.value = document.form1.wmsList.options[ind].text;
+        document.form2.owners.value = email_str;
+        document.form2.submit();
+     }
+   }
+}
+-->
+</script>
+</head>
+<body>
+<?php
+require_once("../classes/class_administration.php");
+$admin = new administration();
+
+$error_msg='';
+
+//if mail form has been filled in and sent
+if ($_POST["mail"]) {
+	if (!$admin->isValidEmail($_POST["replyto"])) {
+		$error_msg .= "The reply-to address is not valid! Please correct it.";
+	}
+	else {
+		$toAddr = array();
+		$toName = array();	
+		$namesAndAddresses = explode(":::" , $_POST["owners"]);
+		for ($i=0; $i<count($namesAndAddresses)-1; $i++) {
+			$nameAndAddress = explode(";;;", $namesAndAddresses[$i]);
+			$toAddr[$i] = $nameAndAddress[0]; 	
+			$toName[$i] = $nameAndAddress[1]; 	
+		}
+
+		$error = '';
+		for ($i=0; $i<count($toAddr); $i++) {
+			if (!$admin->sendEmail($_POST["replyto"], $_POST["from"], $toAddr[$i], $toName[$i], "[Mapbender] A user has suggested a WMS for deletion", $_POST["comment"], $error)) {
+				if ($error) {
+					$error_msg .= $error . " ";
+				}
+			}
+		}
+		
+	   if (!$error_msg) {
+	      echo "<script language='javascript'>";
+	      echo "alert('Other owners have been informed!');";
+	      echo "</script>";
+	   }
+	}
+}
+
+
+// if deletion has been suggested, or there's an error in the form, display mail form (again)
+if ($_POST["suggest"] || $error_msg){
+
+	if ($error_msg) {
+      echo "<script language='javascript'>";
+      echo "alert('$error_msg');";
+      echo "</script>";
+	}
+
+	$wms = $_POST["wms_name"];
+
+	if (!$_POST["from"]) 
+		$fromName = $_SESSION["mb_user_name"];
+	else
+		$fromName = $_POST["from"];
+		
+	if (!$_POST["replyto"]) 
+		$email = $admin->getEmailByUserId($_SESSION["mb_user_id"]);
+	else
+		$email = $_POST["replyto"];
+		
+	if (!$_POST["comment"]) 
+		$text = "The WMS " . $wms . " has been suggested for deletion. If you agree, remove it from your GUIs. If not, you can contact the user who suggested the deletion and discuss it.";
+	else
+		$text = $_POST["comment"];
+		
+	echo "<form name='form3' action='" . $PHP_SELF . "?".SID."' method='post'>";
+	echo "<table><tr>";
+	echo "<td>Your name:</td>";
+	echo "<td><input type='text' name='from' size=50 value = '".$fromName."'></td>";
+	echo "</tr><tr>";
+	echo "<td>Reply-To:</td>";
+	echo "<td><input type='text' name='replyto' size=50 value = '" . $email . "'></td>";
+	echo "</tr><tr>";
+	echo "<td valign=top>Comment:</td>";
+	echo "<td><textarea name='comment' cols=38 rows=10>" . $text . "</textarea></td>";
+	echo "</tr><tr>";
+	echo "<td></td><td><input type='submit' name='mail' value='send email'></td>";
+	echo "</tr></table>";
+	echo "<input type='hidden' name='owners' value='" . $_POST["owners"] . "'>";
+	echo "</form>";
+
+}
+else {
+	
+	// delete WMS
+	if($del)
+	{
+	   $sql = "select * from gui_wms where fkey_wms_id = ".$wmsList;
+		 $res = db_query($sql);
+		 $cnt = 0;
+	 	 while($row = db_fetch_array($res))
+	  	 {
+	  	 		 $sql = "UPDATE gui_wms set gui_wms_position = (gui_wms_position -1) ";
+	  			 $sql .= "WHERE fkey_gui_id = '".$row["fkey_gui_id"]."'";
+	  			 $sql .= " AND gui_wms_position > " . $row["gui_wms_position"] ;
+	  			 $res = db_query($sql);			
+	    		 $cnt++;				
+	 	 }
+	   $sql = "DELETE FROM wms WHERE wms_id = '".$wmsList."'";
+	   $res = db_query($sql);
+	}
+	// display WMS List
+	
+	$wms_id_own = $admin->getWmsByOwner($_SESSION["mb_user_id"]);
+	
+	if (count($wms_id_own)>0){
+		$sql = "Select * from wms WHERE wms_id IN (";
+		for($i=0; $i<count($wms_id_own); $i++){
+		 if($i>0){ $sql .= ",";}
+		 $sql .= $wms_id_own[$i];
+		}
+		$sql .= ") ORDER BY wms_title";
+		$res = db_query($sql);
+		$cnt = 0;
+		
+		
+		echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+		echo "<select class='wmsList' size='20' name='wmsList' onchange='document.form1.wmsList.value = this.value;submit()'>";
+		while($row = db_fetch_array($res))
+		{
+			$wmsvalue = $row["wms_id"];
+			//mark previously selected WMS <==> text = " selected" 
+			if ($wmsvalue == $wmsList) {
+				$text = " selected";
+			}
+			else {
+				$text = "";
+			}
+		   echo "<option value='".$wmsvalue."'" . $text . ">".$row["wms_title"]."</option>";
+		   $cnt++;
+		}
+		echo "</select><br>";
+	
+	
+		//
+		//
+		// If WMS is selected, show more info
+		//
+		//
+		if($wmsList)
+		{
+			echo "<p class = 'guiList'>";
+			// Show GUIs using chosen WMS
+			$sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = '".$wmsList."'";
+			$res = db_query($sql);
+			
+			echo "<b>Used in the following GUIs:</b><br><br>";
+			
+			$cnt = 0;
+			while($row = db_fetch_array($res))
+			{
+				echo "- " . $row["fkey_gui_id"]."<br>";
+				$cnt++;
+			}
+			if ($cnt == 0) {
+				echo "<i>- none -</i><br>";
+			}
+			
+			// Show GetCapabilities of chosen WMS
+			$sql = "SELECT wms_getcapabilities FROM wms WHERE wms_id = '".$wmsList."'";
+			$res = db_query($sql);
+			
+			echo "<br><br><b>GetCapabilities</b><br><br>";
+		
+			$cnt = 0;
+			while($row = db_fetch_array($res))
+			{
+				echo $row["wms_getcapabilities"]."<br>";
+				$cnt++;
+			}
+			
+			// Show Abstract of Chosen WMS
+			$sql = "SELECT wms_abstract FROM wms WHERE wms_id = '".$wmsList."'";
+			$res = db_query($sql);
+			
+			echo "<br><br><b>Abstract</b><br><br>";
+		
+			$cnt = 0;
+			while($row = db_fetch_array($res))
+			{
+				echo $row["wms_abstract"]."<br>";
+				$cnt++;
+			}
+			echo "<br><br><b>Owner:</b><br><br>";
+			$owner = $admin->getOwnerByWms($wmsList);
+			if ($owner && count($owner)>0) {
+				for($i=0; $i<count($owner); $i++){
+					echo "- ".$owner[$i]."<br>";	
+				}
+			}
+			else echo "<i>- none -</i>";
+			
+				
+			echo "</p>";
+	
+			//previously, a WMS could only be deleted if it was owned by a single owner
+			//if(count($owner)==1 && $owner[0] == $_SESSION["mb_user_name"]){
+			
+			//now, any owner can delete, any non-owner can suggest deletions
+			//if a wms has no owner, anyone can delete
+	    		if($owner && in_array($_SESSION["mb_user_name"], $owner) && count($owner) == 1) {
+	    			echo "<input class='button_del' type='button' value='delete' onclick='validate()'>";
+	    		}
+	    		elseif ($owner && in_array($_SESSION["mb_user_name"], $owner) && count($owner) > 1) {
+	    			
+	    			// delete suggestion button only appears when mailing is enabled in mapbender.conf
+	    			if ($use_php_mailing) {
+	    			
+	    				// prepare email-addresses and usernames of all owners
+	    				$owner_ids = array();
+	    				$owner_mail_addresses = array();
+	    				$email_str = '';
+	    				for ($i=0; $i<count($owner); $i++) {
+	    					$tmp_array = $admin->getUserIdByUserName($owner[$i]);
+	    					$owner_ids[$i] = $tmp_array[0]; 
+	    				}
+	    				$j=0;
+	    				for ($i=0; $i<count($owner_ids); $i++) {
+	    					$adr_tmp = $admin->getEmailByUserId($owner_ids[$i]);
+	    					if (!in_array($adr_tmp, $owner_mail_addresses) && $adr_tmp) {
+	    						$owner_mail_addresses[$j] = $adr_tmp;
+	    						$email_str .= $owner_mail_addresses[$j] . ";;;" . $owner[$i] . ":::";
+	    						$j++;
+	    					} 
+	    				}
+	    				print_r($owner_ids);
+	    				print_r($owner_mail_addresses);
+	    				echo "<input class='button_del' type='button' value='suggest deletion' onclick='suggest_deletion(\"" . $email_str . "\")'>";
+	    			}
+	    			else {
+	    				echo "<script language='javascript'>";
+	    				echo "alert('You are not allowed to delete this WMS!');";
+	    				echo "</script>";
+	    			}
+				}
+	
+		}
+	}else{
+		echo "There are no wms available for this user.<br>";
+	}
+}
+?>
+<input type='hidden' name='del'>
+</form>
+<?php 
+echo "<form name='form2' action='" . $PHP_SELF . "?".SID."' method='post'>";
+?>
+<input type='hidden' name='suggest' value='0'>
+<input type='hidden' name='wms_name' value=''>
+<input type='hidden' name='owners' value=''>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_digitize.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_digitize.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_digitize.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,427 @@
+<?php
+# $Id: mod_digitize.php,v 1.6 2006/03/09 11:20:18 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_digitize.php,v 1.6 2006/03/09 11:20:18 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+?>
+	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+	
+	<html>
+	<head>
+	<meta http-equiv="cache-control" content="no-cache">
+	<meta http-equiv="pragma" content="no-cache">
+	<meta http-equiv="expires" content="0">
+	<?php
+	echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+	?>
+	<title>Digitize</title>
+	<?php 
+	   include '../include/dyn_css.php';
+	?>
+	<style type="text/css">
+		<!--
+		body{
+			font-family: Arial, Helvetica, sans-serif;
+			font-size : 12px;
+			color: #ffffff;
+			background-color: lightgray;
+			margin-top: 0px;
+			margin-left: 0px;
+		}
+		.button{
+			height: 18px;
+			width: 32px;
+		}
+		-->
+	</style>
+	<script language='JavaScript'>
+	<?php
+	
+	echo "var mod_digitize_target = '".$_REQUEST["target"]."';";
+	
+	?>
+	//public
+	 
+	var mod_digitize_color1 = "white";
+	var mod_digitize_color2 = "black";
+	var mod_digitize_font = "Arial, Helvetica, sans-serif";
+	var mod_digitize_fontsize = "9px";
+	var mod_digitize_basepoint = "#8a2be2";
+	var mod_digitize_linepoint = "#ff00ff";
+	var mod_digitize_bg = "";
+	
+	var mod_digitize_elName = "digitize_frame"
+	var mod_digitize_frameName = "";
+	
+	// constructor - object: 
+	var D = new Array();
+	function register_D(type){
+		var id = D.length;
+		if(id > 0){
+			var check = val_D(id);
+			if(check == false){
+				id -= 1;
+			}
+		}
+		D[id] = new const_D(id, type);    
+	}
+	
+	function const_D(id,type){
+		this.id = id;
+		this.type = type;
+		this.x = new Array();
+		this.y = new Array();
+		this.label = "";
+		
+		var ind = parent.getMapObjIndexByName(mod_digitize_target);
+		this.epsg = parent.mb_mapObj[ind].epsg;
+		
+		this.units = "";
+		this.dist = new Array();
+		this.totaldist = new Array();
+		this.complete = false;
+	}
+	
+	function val_D(id){
+		if(D[(id - 1)].x.length == 0){
+			return false;
+		}
+		else{
+			return true;
+		}
+	}
+	var isOn = true;
+	var mod_digitize_width;
+	var mod_digitize_height;
+	var mod_digitize_Dist = new Array();
+	var mod_digitize_TotalDist = new Array();
+	var mod_digitizeSubFunctions = new Array();
+	var mod_digitizeEvent = false;
+	
+	var bp_active  = false;
+	var bp_obj = false;
+	var bp_geom = false;
+	var bp_p = false;
+	var start_x = false;
+	var start_y = false;
+	var end_x = false;
+	var end_y = false;
+	
+	
+	
+	function mod_digitize_go(){
+		parent.mb_registerGML(mod_digitize_target,D);   
+		parent.document.getElementById(mod_digitize_elName).style.visibility = 'visible'; 
+		var el = parent.frames[mod_digitize_target].document;
+		el.onmousedown = mod_digitize_start;
+		//el.onmousemove = mod_digitize_run;
+	
+		var ind = parent.getMapObjIndexByName(mod_digitize_target);
+		mod_digitize_width = parent.mb_mapObj[ind].width;
+		mod_digitize_height = parent.mb_mapObj[ind].height;
+		//mod_digitize_epsg = parent.mb_mapObj[ind].epsg;
+	}
+	
+	function mod_digitize_disable(){
+		isOn = false;
+		parent.document.getElementById(mod_digitize_elName).style.visibility = 'hidden';
+		var el = parent.frames[mod_digitize_target].document;
+		el.onmousedown = null;
+		el.onmouseup = null;
+		el.onmousemove = null;
+		drawDashedLine();
+	}
+	
+	function mod_digitize_timeout(){
+	var el = parent.window.frames[mod_digitize_target].document; 
+	el.onmousedown = null;
+	el.ondblclick = null;
+	el.onmousemove = null;
+	}
+	
+	function mod_digitize_start(e){
+		isOn = true;
+		if(D[D.length -1].complete == true || (D.length == 0)){
+			alert("Geometrie muss ausgewählt sein!");
+			return true;
+		}
+		parent.mb_getMousePos(e,mod_digitize_target);
+		var realWorldPos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX,parent.clickY);
+		D[D.length-1].x[D[D.length-1].x.length] = Math.round(realWorldPos[0] * 100)/100;
+		D[D.length-1].y[D[D.length-1].y.length] = Math.round(realWorldPos[1] * 100)/100;
+		if(D[D.length-1].type == 'text'){
+			var l = prompt("Beschriftung: ","");
+			if(l != null){
+				D[D.length-1].label = l;
+				D[D.length-1].complete = true;
+			}
+			
+		}
+		drawDashedLine();
+		return true;
+	}
+	
+	function drawDashedLine(){
+		var smP = "";
+		smP += "<div class='t_img'>";
+		smP += "<img src='"+parent.mb_trans.src+"' width='"+mod_digitize_width+"' height='0'></div>";
+		smP += "<div class='t_img'>";
+		smP += "<img   src='"+parent.mb_trans.src+"' width='0' height='"+mod_digitize_height+"'></div>";
+		for(var j=0; j<D.length; j++){
+			for(var i=0; i<D[j].x.length; i++){
+				var pos = parent.makeRealWorld2mapPos(mod_digitize_target,D[j].x[i],D[j].y[i]);
+				if(D[j].type != 'text' || (D[j].type == 'point' && D[j].label =="")){
+					smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;'";
+					if(i==0 && D[j].type == 'polygon' && D[j].complete == false){
+						smP += " title='close polygon' ";
+					}
+					if(isOn){
+						smP += " onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].mobp(this,"+j+","+i+")' ;"
+						smP += " onmouseout='parent.window.frames[\""+mod_digitize_elName+"\"].mod_digitize_go()' ";
+					}
+					smP += "></div>";
+				}
+				//label:
+				if(i == 0 && D[j].label != ""){
+					smP += "<div class='label' style='top:"+(pos[1]-6)+"px;left:"+(pos[0])+"px'>"+D[j].label+"</div>";
+				}
+			}
+			if(D[j].x.length>1){
+				for(var k=1; k<D[j].x.length; k++){
+					var pos0 = parent.makeRealWorld2mapPos(mod_digitize_target,D[j].x[k], D[j].y[k]);
+					var pos1 = parent.makeRealWorld2mapPos(mod_digitize_target,D[j].x[k-1], D[j].y[k-1]);
+					smP += evaluateDashes(pos1[0],pos1[1],pos0[0],pos0[1],k,j,k);
+				}
+			}
+		}
+		parent.writeTag(mod_digitize_target,"digitize",smP);
+	}
+	
+	function evaluateDashes(x1,y1,x2,y2,count,geom,p){
+		var str_dashedLine = "";
+		var s = 10;
+		var d = Math.sqrt(Math.pow((y1-y2),2) + Math.pow((x1-x2),2)) ;
+		var n = Math.round(d/s);
+		var s_x =  (x2 - x1)/n;
+		var s_y =  (y2 - y1)/n;
+		for(var i=1; i<n; i++){
+			var x = Math.round(x1 + i * s_x)-2;
+			var y = Math.round(y1 + i * s_y)-2;
+			if(x >= 0 && x <= mod_digitize_width && y >= 0 && y <= mod_digitize_height){
+				str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:50;' ";
+				if(isOn){
+					str_dashedLine += "onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].lp2bp(this,"+geom+","+p+")'>";
+				}
+				str_dashedLine += "</div>";
+			}
+		}
+		return str_dashedLine;
+	}
+	
+	function mobp(Obj,geom,p){
+		if(!isOn){ return false; };
+		bp_obj = Obj;
+		bp_geom = geom;
+		bp_p = p;
+	
+		if(mod_digitizeEvent == "dragBasePoint"){
+			mod_digitize_timeout();
+			Obj.style.cursor = 'move';
+			Obj.onmousedown = parent.window.frames[mod_digitize_elName].bp_down;
+		}
+		if(mod_digitizeEvent == false && D[geom].type == 'polygon' && D[geom].complete == false){
+			Obj.onmousedown = parent.window.frames[mod_digitize_elName].close_Pol;
+		}
+		if(mod_digitizeEvent == "delBasePoint"){
+			mod_digitize_timeout();
+			Obj.style.cursor = 'crosshair';
+			Obj.onmousedown = parent.window.frames[mod_digitize_elName].delete_bp;
+		}
+	}
+	
+	function delete_bp(e){
+		for(var i= bp_p; i<D[bp_geom].x.length; i++){
+			D[bp_geom].x[i] = D[bp_geom].x[i+1];
+			D[bp_geom].y[i] = D[bp_geom].y[i+1];
+		}
+		D[bp_geom].x.length = D[bp_geom].x.length -1;
+		D[bp_geom].y.length = D[bp_geom].y.length -1;
+		drawDashedLine();
+	}
+	
+	function close_Pol(e){
+		if(!isOn){ return; };
+		D[bp_geom].complete = true;
+		D[bp_geom].x[D[bp_geom].x.length] = D[bp_geom].x[0];
+		D[bp_geom].y[D[bp_geom].y.length] = D[bp_geom].y[0];
+		close_D();
+		drawDashedLine();
+	}
+	
+	function lp2bp(obj,geom,p){
+		if(!isOn){ return false; };
+		if(mod_digitizeEvent == "setBasePoint"){
+			mod_digitize_timeout();
+			obj.style.cursor = 'crosshair';
+			obj.onclick = set_bp;
+			bp_obj = obj;
+			bp_geom = geom;
+			bp_p = p;
+		}
+	}
+	
+	function set_bp(e){
+		parent.mb_getMousePos(e);
+		var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX, parent.clickY);
+		for(var i=D[bp_geom].x.length; i>bp_p; i--){
+			D[bp_geom].x[i] = D[bp_geom].x[i-1];
+			D[bp_geom].y[i] = D[bp_geom].y[i-1];
+		}
+		D[bp_geom].x[bp_p] = pos[0];
+		D[bp_geom].y[bp_p] = pos[1];
+		drawDashedLine();
+	}
+	
+	function set_D(obj){
+		register_D(obj.value);
+	}
+	
+	function close_D(){
+		if(D.length > 0){
+			D[D.length -1].complete = true;
+		}
+		for(var i=0; i<D.length; i++){
+			if(D[i].complete == true && D[i].type == 'polygon' && D[i].x[0] != D[i].x[D[i].x.length-1]){
+				D[i].x[D[i].x.length] = D[i].x[0];
+				D[i].y[D[i].y.length] = D[i].y[0];
+				drawDashedLine();
+			}
+		
+		}
+		for(var i=0; i<document.dig.geomType.length; i++){
+			document.dig.geomType[i].checked = false;
+		}
+		parent.mb_obj2gml("mapframe1");
+	}
+	
+	function del_D(){
+		D = new Array();
+		drawDashedLine();
+	}
+	
+	function bp_down(e){
+	if(bp_active == false && mod_digitizeEvent == "dragBasePoint"){
+	bp_obj.onmouseup = bp_up;
+	bp_obj.onmousemove = bp_drag;
+	parent.mb_getMousePos(e);
+	start_x = parent.clickX;
+	start_y = parent.clickY;
+	end_x = parent.clickX;
+	end_y = parent.clickY;
+	bp_active = true;
+	return false;
+	}
+	}
+	
+	function bp_up(e){
+		//document.onmouseup = null;
+		//document.onmousemove = null;
+		bp_active = false;
+		parent.mb_getMousePos(e);
+		end_x = parent.clickX;
+		end_y = parent.clickY;
+		var pos =  parent.makeClickPos2RealWorldPos(mod_digitize_target,end_x, end_y);
+		
+		if ( (bp_p == D[bp_geom].x.length - 1 || bp_p == 0) && D[bp_geom].complete == true && D[bp_geom].type == 'polygon') {
+			D[bp_geom].x[0] = pos[0];
+			D[bp_geom].y[0] = pos[1];
+		}
+	
+		D[bp_geom].x[bp_p] = pos[0];
+		D[bp_geom].y[bp_p] = pos[1];
+		drawDashedLine();
+	}
+	
+	function bp_drag(e){
+	if(bp_active){
+	parent.mb_getMousePos(e);
+	end_x = parent.clickX;
+	end_y = parent.clickY;
+	bp_obj.style.backgroundColor = 'transparent';
+	bp_obj.style.width = 30;
+	bp_obj.style.height = 30;
+	bp_obj.style.left = start_x + (end_x - start_x) - (parseInt(bp_obj.style.width)/2);
+	bp_obj.style.top = start_y + (end_y - start_y) - (parseInt(bp_obj.style.height)/2);
+	}
+	}
+	
+	function setEvent(obj){
+		mod_digitizeEvent = obj.value;
+	}
+	
+	function delEvent(){
+		mod_digitizeEvent = false;
+		for(var i=0; i<document.dig.geomType.length; i++){
+			document.modify.mod[i].checked = false;
+		}
+		mod_digitize_go();
+	}
+	</script>
+	</head>
+	<body>
+	<form name='dig'>
+	<table cellpadding='0' cellspacing='0'>
+	<tr>
+		<td><input type='radio' name='geomType' value='text' onclick='set_D(this)'></td>
+		<td><img src="../img/button_digitize/14_text.png" width='18' height='18'></td>
+		<td><input class='button' type='button' value='ok' onclick='close_D()'></td>
+	</tr>
+	<tr>
+		<td><input type='radio' name='geomType' value='line' onclick='set_D(this)'></td>
+		<td><img src="../img/button_digitize/line.png" width='18' height='18'></td>
+		<td><input class='button' type='button' value='del' onclick='del_D()'></td>
+	</tr>
+	<tr>
+		<td><input type='radio' name='geomType' value='polygon' onclick='set_D(this)'></td>
+		<td><img src="../img/button_digitize/14_polyline.png" width='18' height='18'></td>
+		<td></td>
+	</tr>
+	</table>
+	</form>
+	
+	<form name='modify'>
+	<table cellpadding='0' cellspacing='0'>
+	<tr>
+		<td><input name='mod'  value='dragBasePoint' type='radio'  onclick='setEvent(this)'></td>
+		<td><img src='../img/button_digitize/move.png'></td>
+		<td><input class='button' type='button' value='del' onclick='delEvent()'></td>
+	</tr>
+	<tr>
+		<td><input name='mod' value='setBasePoint' type='radio'  onclick='setEvent(this)'></td>
+		<td><img src='../img/button_digitize/newNode.png'></td>
+		<td></td>
+	</tr>
+	<tr>
+		<td><input name='mod' value='delBasePoint' type='radio'  onclick='setEvent(this)'></td>
+		<td><img src='../img/button_digitize/14_layer_deletelayer.png'></td>
+		<td></td>
+	</tr>
+	</table>
+	
+	</form>
+	</body>
+	</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editElementVars.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editElementVars.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editElementVars.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,233 @@
+<?php
+# $Id: mod_editElementVars.php,v 1.12 2006/03/09 10:37:19 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editElementVars.php,v 1.12 2006/03/09 10:37:19 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+//include("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Element Vars</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+   <!--
+   body{
+      background-color: #ffffff;
+      font-family: Arial, Helvetica, sans-serif;
+      font-size : 12px;
+      color: #808080
+   }
+   .guiList1{
+   	position:absolute;
+   	top:30px;
+   	left:10px;
+   	width:200px
+   }
+   .buttonbar{
+   	position:absolute;
+   	top:40px;
+   	left:10px;
+   }
+   .guiList1_text{
+   	position:absolute;
+   	top:10px;
+   	left:10px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .guiList2{
+   	position:absolute;
+   	top:40px;
+   	left:400px;
+   	width:200px
+   }
+   .all{
+   	position:absolute;
+   	top:38px;
+   	left:610px;
+   }
+   .guiList2_header{
+   	position:absolute;
+   	top:10px;
+   	left:400px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .myElements{
+   	position:absolute;
+   	top:70px;
+   	left:400px;
+   }
+   .myTable{
+   	border: 1px solid;
+      font-size: 11px;
+   }
+   .myForm{
+   	position:absolute;
+   	top:70px;
+   	left:10px;
+   }
+   .textfield{
+      width:277px
+   }
+   .textfield_small{
+      width:150px
+   }
+   .on{
+      color: #0066cc;
+   }
+   -->
+</style>
+
+<?php
+
+# handle database updates etc.....
+
+   if(isset($mySave) && ($mySave == '1')){
+      $sql  = "DELETE FROM gui_element_vars WHERE fkey_gui_id ='".$fkey_gui_id."' AND fkey_e_id ='".$fkey_e_id."' AND var_name ='".$var_name."';";  
+      $res  = db_query($sql);
+      $sql  = "INSERT INTO gui_element_vars(fkey_gui_id,fkey_e_id,var_name,var_value,context,var_type) ";
+      $sql .= "VALUES ('".$fkey_gui_id."','".$fkey_e_id."','".$var_name."','".db_escape_string($var_value)."','".db_escape_string($context)."','".$var_type."');";
+      $res  = db_query($sql);
+      $mySave = 0;
+   }
+
+   if(isset($myDelete) && ($myDelete == '1')){
+      $sql  = "DELETE FROM gui_element_vars WHERE fkey_gui_id ='".$fkey_gui_id."' AND fkey_e_id ='".$fkey_e_id."' AND var_name ='".$var_name."';";  
+      $res  = db_query($sql);
+      $myDelete = 0;
+   }
+?>
+
+<script type="text/javascript">
+<!--
+function thisSave(){
+   if(document.form1.var_name.value != ""){
+      var permission =  confirm("save: " + document.form1.var_name.value + " ?");
+      if(permission == true){
+         document.form1.mySave.value = 1;     
+         document.form1.submit();
+      }
+   }
+}
+
+function thisDelete(){
+   if(document.form1.var_name.value != ""){
+      var permission =  confirm("delete: " + document.form1.var_name.value + " ?");
+      if(permission == true){
+         document.form1.myDelete.value = 1;
+         document.form1.submit();
+      }
+   }
+}
+// -->
+</script>
+</head>
+<body>
+
+<?php
+   echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='POST'>\n";
+
+   $fkey_gui_id = $_REQUEST["fkey_gui_id"];
+   $fkey_e_id   = $_REQUEST["fkey_e_id"];
+   if(isset($_REQUEST["myElement"])){
+      $myElement = $_REQUEST["myElement"];
+   }
+
+   echo "<div class= 'guiList1_text'>";
+   echo "Edit Element Vars: ".$fkey_gui_id." / ".$fkey_e_id;
+
+   echo "</div>\n";
+   echo "<div class='buttonbar'>\n";
+   echo "<input type='button' class='' name='' value='save'   onclick='thisSave()'> \n";
+   echo "<input type='button' class='' name='' value='delete' onclick='thisDelete()'> \n";
+   
+   $href = "self.location.href='mod_editElements.php?".SID."&guiList1=".$fkey_gui_id."&guiList2=".$fkey_gui_id."'";
+
+   echo "<input type='button' class='' name='' value='return' onclick=\"".$href."\"> \n";
+   echo "</div>\n";
+
+   $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$fkey_gui_id."' AND fkey_e_id = '".$fkey_e_id."';";
+   $res = db_query($sql);
+   $cnt = 0;
+	
+   echo "<div class='myElements'>\n<table>\n";
+	
+   while(db_fetch_row($res)){
+      echo "<tr>\n";
+      echo "<td class='myTable'>";
+      echo "<input type='radio' name='myElement' value='".db_result($res, $cnt, "var_name")."' onclick='submit()'>";
+      echo "</td>\n";
+      echo "<td class='myTable'>".db_result($res, $cnt, "var_name")."</td>\n";
+      echo "</tr>\n";
+      $cnt++;
+   }
+   echo "</table>\n</div>\n";
+   
+   echo "<table class='myForm'>\n";
+   $formOk = 0;
+   if(isset($myElement)){
+      $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$fkey_gui_id."' AND fkey_e_id = '".$fkey_e_id."' AND var_name = '".$myElement."';";
+      $res = db_query($sql);
+      if(db_fetch_row($res)){
+         echo "<tr><td>Name:</td><td><input type='text' class='textfield' name='var_name' value='".db_result($res,0,"var_name")."'></td></tr>\n";
+         echo "<tr><td>Value:</td><td><textarea cols='32' rows='5'  name='var_value' >".stripslashes(db_result($res,0,"var_value"))."</textarea></td></tr>\n";
+         echo "<tr><td>Context:</td><td><input type='text' class='textfield' name='context' value='".db_result($res,0,"context")."'></td></tr>\n";
+         echo "<tr><td>Type:</td><td><input type='text' class='textfield' name='var_type' value='".db_result($res,0,"var_type")."'></td></tr>\n";
+         $formOk = 1;
+      }
+   }
+	if($formOk == 0){
+		echo "<tr><td>Name:</td><td><input type='text' class='textfield' name='var_name' value=''></td></tr>\n";
+		echo "<tr><td>Value:</td><td><textarea cols='32' rows='5'  name='var_value' ></textarea></td></tr>\n";
+		echo "<tr><td>Context:</td><td><input type='text' class='textfield' name='context' value=''></td></tr>\n";
+		echo "<tr><td>Type:</td><td>";
+			echo "<select class='textfield' name='var_type'>";
+				echo "<option value='text/css'>text/css</option>";
+				echo "<option value='file/css'>file/css</option>";
+				echo "<option value='var'>JavaScript Variable</option>";
+				echo "<option value='php_var'>PHP Variable</option>";
+			echo "</select>";
+		echo "</td></tr>\n";
+   }
+   echo "</table>\n";
+
+   echo "<input type=\"hidden\" name=\"fkey_gui_id\" value=\"".$fkey_gui_id."\">\n";
+   echo "<input type=\"hidden\" name=\"fkey_e_id\"   value=\"".$fkey_e_id."\">\n";
+?>
+<input type="hidden" name="myDelete">
+<input type="hidden" name="mySave">
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editElements.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editElements.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editElements.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,592 @@
+<?php
+# $Id: mod_editElements.php,v 1.32 2006/03/09 12:11:31 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editElements.php,v 1.32 2006/03/09 12:11:31 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+include("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_administration.php");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Elements</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+   <!--
+   body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+   .guiList1{
+   	position:absolute;
+   	top:30px;
+   	left:10px;
+   	width:200px
+   }
+   .buttonbar{
+   	position:absolute;
+   	top:40px;
+   	left:10px;
+   }
+   .guiList1_text{
+   	position:absolute;
+   	top:10px;
+   	left:10px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .guiList2{
+   	position:absolute;
+   	top:40px;
+   	left:400px;
+   	width:200px
+   }
+   .all{
+   	position:absolute;
+   	top:38px;
+   	left:610px;
+   }
+   .guiList2_header{
+   	position:absolute;
+   	top:10px;
+   	left:400px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .myElements{
+   	position:absolute;
+   	top:70px;
+   	left:400px;
+   }
+   .myTable{
+   	border: 1px solid;
+      font-size: 11px;
+   }
+   .myForm{
+   	position:absolute;
+   	top:70px;
+   	left:10px;
+   }
+   .textfield{
+      width:277px
+   }
+   .textfield_small{
+      width:150px
+   }
+   .on{
+      color: #0066cc;
+   }
+   .templateTable{
+		background-color:lightgrey;
+   }
+   -->
+</style>
+<?php
+# handle database updates etc.....
+if(isset($mySave) && ($mySave == '1' || $mySave == '2')) {
+	# check module-permission ---------------------------------------------------------
+	# e_attributes
+	# e_js_file
+	# e_mb_mod
+	# e_src
+	$check = CHECK;
+	$alert = "Security alert: You do not have the permission to use the specified ";
+	$alert .= "module-path. Please contact your mapbender system administrator.";
+
+	$mod = new administration();
+	$aGuis = $mod->getGuisByPermission($_SESSION["mb_user_id"]);
+	$modPermAlert = false;
+
+	if($check == true){
+		if(isset($e_attributes) && preg_match("/((\w+|\/)+.php)/i", $e_attributes, $matches)){
+			$modPerm = $mod->checkModulePermission($aGuis, $matches[1], "e_attributes");
+			if($modPerm == false){
+				$modPermAlert = true;
+			}
+
+		}
+
+
+	if(isset($e_js_file) && preg_match("/((\w+|\/)+.php)/i", $e_js_file, $matches)){
+			$modPerm = $mod->checkModulePermission($aGuis, $matches[1], "e_js_file");
+			if($modPerm == false){
+				$modPermAlert = true;
+			}
+		}
+
+	if(isset($e_mb_mod) && preg_match("/((\w+|\/)+.php)/i", $e_mb_mod, $matches)){
+			$modPerm = $mod->checkModulePermission($aGuis, $matches[1], "e_mb_mod");
+			if($modPerm == false){
+				$modPermAlert = true;
+			}
+		}
+
+
+		if(isset($e_src) && preg_match("/((\w+|\/)+.php)/i", $e_src, $matches)){
+			$modPerm = $mod->checkModulePermission($aGuis, $matches[1], "e_src");
+
+			if($modPerm == false){
+				$modPermAlert = true;
+			}
+		}
+
+		if($modPermAlert == true){
+			unset($mySave);
+			echo "<script language='JavaScript'>";
+			echo "alert('".$alert."');";
+			echo "</script>";
+
+		}
+	}
+
+	# end permission-check -------------------------------------------------------------
+	$sql = array();
+if ($mySave == '1'){
+
+	$sql_vars = "SELECT * FROM gui_element_vars WHERE fkey_e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."'";
+	$res_vars = db_query($sql_vars);
+
+
+   	if(SYS_DBTYPE=='pgsql')
+   		{
+	   	#$sql[0] = "SET AUTOCOMMIT=1";
+	 	}
+	  else
+	 	{
+	 		#$sql[0] = "SET AUTOCOMMIT=0";
+		}
+	   $sql[1] = "BEGIN";
+	   $sql[2] = "DELETE FROM gui_element WHERE e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."'";
+
+
+	   if($e_left == ''){$e_left = "NULL";}
+	   if($e_top == ''){$e_top = "NULL";}
+	   if($e_width < 1){$e_width = "NULL";}
+	   if($e_height < 1){$e_height = "NULL";}
+	   if($e_z_index < 1){$e_z_index = "NULL";}
+	   $sql[3] = "INSERT INTO gui_element(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires) ";
+	   $sql[3] .= "VALUES ('".$guiList1."','".$e_id."','".$e_pos."','".$e_public."','".db_escape_string($e_comment)."','".$e_element."','".$e_src."','".db_escape_string($e_attributes)."',".$e_left.",".$e_top.",".$e_width.",".$e_height.",".$e_z_index.",'".$e_more_styles."','".db_escape_string($e_content)."','".$e_closetag."','".$e_js_file."','".$e_mb_mod."','".$e_target."','".$e_requires."')";
+
+		//copy element vars
+		$sql[4] = "INSERT INTO gui_element_vars SELECT '".$guiList1."', '".$e_id."', var_name, var_value, context, var_type FROM gui_element_vars WHERE fkey_e_id = '".$e_id."' AND fkey_gui_id = '".$_POST["originGuiOfSelectedElement"]."';";
+
+   }
+   # mySave == 2 <=> just save GUI description
+   elseif ($mySave == '2') {
+	   if(SYS_DBTYPE=='pgsql')
+   		{
+	   	#$sql[0] = "SET AUTOCOMMIT=1";
+	 	}
+	  else
+	 	{
+	 	#$sql[0] = "SET AUTOCOMMIT=0";
+		}
+	   $sql[1] = "BEGIN";
+	   $sql[3] = "UPDATE gui SET gui_description = '". $guiDesc."' WHERE gui_id ='".$guiId."'";
+   }
+   if(count($sql) > 0){
+	    foreach ($sql as $mysql){
+      $res = db_query($mysql);
+      if(!$res){echo db_error();break;}
+   if($res){
+		$res = db_query( "COMMIT");
+        if($SYS_DBTYPE=='mysql'){
+        	$res = db_query( "SET AUTOCOMMIT=1");
+        }
+   }
+   else{
+      $res = db_query( "ROLLBACK");
+   		if($SYS_DBTYPE=='mysql'){
+        	$res = db_query( "SET AUTOCOMMIT=1");
+        }
+   }
+   }
+
+   if(isset($sql_vars)){//sicherstellen das keine Element_Vars gelöscht wurden
+   	 while($row =  db_fetch_array($res_vars)){
+     			$securesql = "INSERT INTO gui_element_vars (fkey_gui_id,fkey_e_id,var_name,var_value,context,var_type) VALUES ('".$guiList1."','".$e_id."','".$row["var_name"]."','".$row["var_value"]."','".$row["context"]."','".$row["var_type"]."');";
+
+     			//echo $securesql."<BR>";
+     			$secureinsert = db_query($securesql);
+     		}
+   }
+
+   #echo $sql;
+      if(!$res){break;}
+   }
+}
+if(isset($myDelete) && $myDelete == '1'){
+   $sql = "DELETE FROM gui_element WHERE e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."'";
+   $res = db_query($sql);
+   $e_id = ""; $e_pos = ""; $e_public = ""; $e_comment = ""; $e_element = "";
+   $e_src = ""; $e_attributes = ""; $e_left = ""; $e_top = ""; $e_width = ""; $e_height = ""; $e_z_index = "";
+   $e_more_styles = ""; $e_content = ""; $e_closetag = ""; $e_js_file = ""; $e_mb_mod = ""; $e_target = ""; $e_requires = "";
+}
+if(isset($myShow) && $myShow == '1'){
+   $_SESSION["mb_user_myGui"] = $guiList1;
+   echo "<script language='javascript'>";
+   echo "window.open('../frames/login.php?".strip_tags (SID)."&mb_user_myGui=".$guiList1."','','');";
+   echo "</script>";
+}
+if(isset($all) && $all == '1'){
+   $sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$guiList2."'";
+   $res = db_query($sql);
+   $cnt = 0;
+   while($row = db_fetch_array($res)){
+      $sql_del = "DELETE FROM gui_element WHERE fkey_gui_id = '".$guiList1."' AND e_id = '".$row["e_id"]."'";
+      $res_del = db_query($sql_del);
+      if($row["e_left"] == ""){$myleft = 'NULL';} else{$myleft = $row["e_left"];}
+      if($row["e_top"] == ""){$mytop = 'NULL';} else{$mytop = $row["e_top"];}
+      if($row["e_width"] == ""){$mywidth = 'NULL';} else{$mywidth = $row["e_width"];}
+      if($row["e_height"] == ""){$myheight = 'NULL';} else{$myheight = $row["e_height"];}
+      if($row["e_z_index"] == ""){$my_z_index = 'NULL';} else{$my_z_index = $row["e_z_index"];}
+
+      $sql_ins = "INSERT INTO gui_element(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires) ";
+      $sql_ins .= "VALUES ('".$guiList1."','".$row["e_id"]."','".$row["e_pos"]."','".$row["e_public"]."','".db_escape_string($row["e_comment"])."','".$row["e_element"]."','".$row["e_src"]."','".db_escape_string($row["e_attributes"])."',".$myleft.",";
+      $sql_ins .= $mytop.",".$mywidth.",".$myheight.",".$my_z_index.",'".$row["e_more_styles"]."','".db_escape_string($row["e_content"])."','".$row["e_closetag"]."','".$row["e_js_file"]."','".$row["e_mb_mod"]."','".$row["e_target"]."','".$row["e_requires"]."')";
+
+
+      $res_ins = db_query($sql_ins);
+      if(!$res_ins){echo db_error($con); }
+      $cnt++;
+   }
+   $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$guiList2."'";
+      $res = db_query($sql);
+   	$cnt = 0;
+       while($row = db_fetch_array($res)){
+      $sql_ins2 = "INSERT INTO gui_element_vars(fkey_gui_id,fkey_e_id,var_name,var_value,context,var_type) ";
+      $sql_ins2 .= "VALUES ('".$guiList1."','".$row["fkey_e_id"]."','".$row["var_name"]."','".db_escape_string($row["var_value"])."','".db_escape_string($row["context"])."','".$row["var_type"]."')";
+      $res_ins2 = db_query($sql_ins2);
+      if(!$res_ins2){echo db_error($connect); }
+
+      $cnt++;
+      }
+
+
+}
+# end
+echo "<script language='javascript'>";
+echo "var guiIDs = new Array();";
+if(isset($guiList1)){
+   $sql = "SELECT e_id FROM gui_element WHERE  fkey_gui_id = '".$guiList1."'";
+   $res = db_query($sql);
+   $cnt = 0;
+   while($row = db_fetch_array($res)){
+      echo  "guiIDs[".$cnt."] = '".$row["e_id"]."'; ";
+      $cnt++;
+   }
+}
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function setOriginGui(){
+   document.form1.originGuiOfSelectedElement.value = document.form1.guiList2.value;
+}
+
+function setGui(val){
+   document.form1.guiList2.value = val;
+   document.form1.submit();
+}
+function clearRadio(){
+   for(var i=0; i< document.form1.elements.length; i++){
+      if(document.form1.elements[i].type == "radio"){
+         document.form1.elements[i].checked = false;
+      }
+   }
+}
+function thisSave(){
+   if(document.form1.e_id.value == ""){
+      alert("ID ? ");
+      document.form1.e_id.focus();
+      return;
+   }
+   var permission = false;
+   var isElement = false;
+   for(var i=0; i<guiIDs.length; i++){
+      clearRadio();
+      if(document.form1.e_id.value == guiIDs[i]){
+         permission = confirm("update: " + document.form1.e_id.value + " ?");
+         isElement = true;
+         break;
+      }
+   }
+   if(permission == true || isElement == false){
+      document.form1.mySave.value = 1;
+      document.form1.submit();
+   }
+}
+
+function thisDelete(){
+   clearRadio();
+   var permission =  confirm("delete: " + document.form1.e_id.value + " ?");
+   if(permission == true){
+      document.form1.myDelete.value = 1;
+      document.form1.submit();
+   }
+}
+function thisShow(){
+   document.form1.myShow.value = 1;
+   document.form1.submit();
+}
+function addAll(){
+   var permission =  confirm("add all elements ?");
+   if(permission == true){
+      clearRadio();
+      document.form1.all.value = 1;
+      document.form1.submit();
+   }
+}
+function thisExport(){
+
+   window.open("mod_exportElement.php?element=" + document.forms[0].e_id.value+ "&gui=" +document.forms[0].guiList1.value ,"","");
+}
+function editDesc(){
+	var newDesc = prompt("Enter new GUI description", document.form1.guiDesc.value);
+	if (newDesc != null) {
+		document.form1.guiDesc.value = newDesc;
+		document.form1.mySave.value = 2;
+		document.form1.submit();
+	}
+}
+
+// -->
+</script>
+</head>
+<body>
+
+<?php
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+$permguis = $admin->getGuisByPermission($_SESSION["mb_user_id"]);
+echo "<form name='form1' action='" . $_SERVER['PHP_SELF'] . "?".SID."' method='post'>\n";
+if(count($ownguis)>0){
+	$sql = "SELECT * from gui WHERE gui.gui_id IN(";
+	for($i=0; $i<count($ownguis); $i++){
+		if($i>0){ $sql .= ",";}
+		$sql .= "'".$ownguis[$i]."'";
+	}
+	$sql .= ") order by gui_id;";
+	$res = db_query($sql);
+	$count=0;
+	while($row = db_fetch_array($res)){
+		$gui_id_own[$count]=$row["gui_id"];
+		$gui_name_own[$count]=$row["gui_name"];
+		$gui_description_own[$count]=$row["gui_description"];
+		$count++;
+	}
+
+
+	$sql = "SELECT * from gui WHERE gui.gui_id IN(";
+	for($i=0; $i<count($permguis); $i++){
+		if($i>0){ $sql .= ",";}
+		$sql .= "'".$permguis[$i]."'";
+	}
+	$sql .= ") order by gui_id;";
+	$res = db_query($sql);
+	$count=0;
+	while($row = db_fetch_array($res)){
+		$gui_id_perm[$count]= $row["gui_id"];
+		$gui_name_perm[$count]=$row["gui_name"];
+		$gui_description_perm[$count]=$row["gui_description"];
+		$count++;
+	}
+
+	#Gui to edit
+	if(!isset($guiList1)){
+		echo "<div class= 'guiList1_text'>GUI:</div>\n";
+		echo "<select class='guiList1' size='20' name='guiList1' onchange='setGui(this.value)'>\n";
+		for ($i=0; $i<count($gui_id_own);$i++){
+			echo "<option value='".$gui_id_own[$i]."' ";
+			if($guiList1 && $guiList1 == $gui_id_own[$i]){
+				echo "selected";
+			}
+			echo ">".$gui_name_own[$i]."</option>\n";
+		}
+		echo "</select>\n";
+
+		for ($i=0; $i<count($gui_id_own);$i++){
+			echo "<input type='hidden'  name='guiDesc_" . $gui_name_own[$i] . "' value='" . $gui_description_own[$i] . "' >\n";
+		    echo "<input type='hidden'  name='guiId_" . $gui_name_own[$i] . "' value='" . $gui_id_own[$i] . "' >\n";
+		}
+		echo "<input type='hidden'  name='guiList2' value='' >\n";
+	}
+	else{
+	   echo "<div class= 'guiList1_text'>";
+	   echo 	"Edit Elements: ".$guiList1;
+
+	   // set guiDesc and guiId if guiList1 has just been selected
+	   if (!$guiDesc) {
+		  $Desc = "guiDesc_" . $guiList1;
+		  $guiDesc = $$Desc;
+	   }
+	   if (!$guiId) {
+		  $Id = "guiId_" . $guiList1;
+		  $guiId = $$Id;
+	   }
+
+	   echo "&nbsp;&nbsp;(" . $guiDesc;
+	   echo	" <input type='button' class='' name='' value='edit' onclick='editDesc()'> ) \n";
+	   echo "</div>\n";
+	   echo "<div class='buttonbar'>\n";
+	   echo "<input type='button' class='' name='' value='save' onclick='thisSave()'> \n";
+	   echo "<input type='button' class='' name='' value='delete' onclick='thisDelete()'> \n";
+	   echo "<input type='button' class='' name='' value='show' onclick='thisShow()'> \n";
+	   echo "<input type='button' class='' name='' value='sql' onclick='thisExport()'> \n";
+	   echo "</div>\n";
+	   echo "<input type='hidden'  name='guiList1' value='".$guiList1."' >\n";
+	   echo "<input type='hidden'  name='guiId' value='".$guiId."' >\n";
+	   echo "<input type='hidden'  name='guiDesc' value='".$guiDesc."' >\n";
+	}
+	#Depot
+	if(isset($guiList1)){
+		echo "<select name='guiList2' class='guiList2' onchange='clearRadio();submit()'>\n";
+		echo "<option>GUI...</option>\n";
+		for ($i=0; $i<count($gui_id_perm);$i++){
+			echo "<option value='".$gui_id_perm[$i]."' ";
+			if($guiList2 && $guiList2 == $gui_id_perm[$i]){
+				echo "selected";
+			}
+			echo ">".$gui_name_perm[$i]."</option>\n";
+		}
+		echo "</select>\n";
+		if($guiList1 != $guiList2){echo "<input class='all' type='button' value='add all elements' onclick='addAll()'>\n";}
+	}
+	#Elements
+	if(isset($guiList2)){
+		if($guiList1 == $guiList2){
+			echo "<div class='guiList2_header'>Edit Element: </div>\n";
+			$isTemplate = false;
+		}
+		else{
+			echo "<div class='guiList2_header'>Templates</div>\n";
+			$isTemplate = true;
+		}
+		$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$guiList2."' ORDER BY e_id";
+		$res = db_query($sql);
+		$cnt = 0;
+
+		echo "<div class='myElements'>\n<table ";
+		if($isTemplate){ echo "class='templateTable'";}
+		echo ">\n";
+
+		while($row = db_fetch_array($res)){
+			echo "<tr>\n";
+			echo "<td class='myTable'><input type='radio' name='myElement' value='".$row["e_id"]."' onclick='setOriginGui();submit()' ";
+			if($row["e_id"] == $myElement){echo "checked";}
+			echo "></td>\n";
+			echo "<td>";
+			if(is_file($row["e_src"]) && getimagesize($row["e_src"])){
+				echo "<img src='".$row["e_src"]."' width='24' height='24'>";
+			}
+			echo "</td>";
+			echo "<td class='myTable'>";
+			if($row["e_public"] == 1){echo "<div class='on'>on</div>";}
+			//echo "</td>\n<td class='myTable'>". $row["e_id"]. "</td><td class='myTable'>" .$row["e_comment"]."</td>";
+			echo "</td>\n";
+			echo "<td class='myTable'>";
+	 		echo "<a href=\"mod_editElementVars.php?".SID."&fkey_gui_id=".$guiList2."&fkey_e_id=".$row["e_id"]."\">";
+	 		echo $row["e_id"];
+			echo "</a>\n</td>\n";
+			echo "<td class='myTable'>".$row["e_comment"]."</td>";
+			echo "</tr>\n";
+			$cnt++;
+		}
+		echo "</table>\n</div>\n";
+	}
+	#Formular:
+	echo "<table class='myForm'>\n";
+		//echo "<tr><td>" . $_POST["originGuiOfSelectedElement"] . "</td></tr>";
+	if(isset($myElement)){
+
+	   $sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$guiList2."' AND e_id = '".$myElement."'";
+	   $res = db_query($sql);
+	   if($row = db_fetch_array($res)){
+	      echo "<tr><td>ID: </td><td><input type='text' class='textfield' name='e_id' value='".$row["e_id"]."'></td></tr>\n";
+	      echo "<tr><td>Position: </td><td><input type='text' class='textfield' name='e_pos' value='".$row["e_pos"]."'></td></tr>\n";
+	      echo "<tr><td>ON/OFF: </td><td><input type='text' class='textfield' name='e_public' value='".$row["e_public"]."'></td></tr>\n";
+	      echo "<tr><td>Comment: </td><td><textarea cols='32' rows='5'  name='e_comment' >".stripslashes($row["e_comment"])."</textarea></td></tr>\n";
+	      echo "<tr><td>HTML-TAG: </td><td><input type='text' class='textfield' name='e_element' value='".$row["e_element"]."'></td></tr>\n";
+	      echo "<tr><td>SRC: </td><td><input type='text' class='textfield' name='e_src' value='".$row["e_src"]."'></td></tr>\n";
+	      echo "<tr><td>Attributes: </td><td><textarea cols='32' rows='5'  name='e_attributes' >".stripslashes($row["e_attributes"])."</textarea></td></tr>\n";
+	      echo "<tr><td>Left: </td><td><input type='text' class='textfield' name='e_left' value='".$row["e_left"]."'></td></tr>\n";
+	      echo "<tr><td>Top: </td><td><input type='text' class='textfield' name='e_top' value='".$row["e_top"]."'></td></tr>\n";
+	      echo "<tr><td>Width: </td><td><input type='text' class='textfield' name='e_width' value='".$row["e_width"]."'></td></tr>\n";
+	      echo "<tr><td>Height: </td><td><input type='text' class='textfield' name='e_height' value='".$row["e_height"]."'></td></tr>\n";
+	      echo "<tr><td>Z-INDEX: </td><td><input type='text' class='textfield' name='e_z_index' value='".$row["e_z_index"]."'></td></tr>\n";
+	      echo "<tr><td>Styles: </td><td><input type='text' class='textfield' name='e_more_styles' value='".$row["e_more_styles"]."'></td></tr>\n";
+	      echo "<tr><td>Content: </td><td><textarea cols='32' rows='4'  name='e_content' >".stripslashes($row["e_content"])."</textarea></td></tr>\n";
+	      echo "<tr><td>Close-TAG: </td><td><input type='text' class='textfield' name='e_closetag' value='".$row["e_closetag"]."'></td></tr>\n";
+	      echo "<tr><td>JavaScript: </td><td><input type='text' class='textfield' name='e_js_file' value='".$row["e_js_file"]."'></td></tr>\n";
+	      echo "<tr><td>Modul: </td><td><input type='text' class='textfield' name='e_mb_mod' value='".$row["e_mb_mod"]."'></td></tr>\n";
+	      echo "<tr><td>Target: </td><td><input type='text' class='textfield' name='e_target' value='".$row["e_target"]."'></td></tr>\n";
+	      echo "<tr><td>Requires: </td><td><input type='text' class='textfield' name='e_requires' value='".$row["e_requires"]."'></td></tr>\n";
+	   }
+	   echo "</table>";
+	}
+	else if(isset($guiList1)){
+	      echo "<tr><td>ID: </td><td><input type='text' class='textfield' name='e_id' value='".$e_id."'></td></tr>\n";
+	      echo "<tr><td>Position: </td><td><input type='text' class='textfield' name='e_pos' value='".$e_pos."'></td></tr>\n";
+	      echo "<tr><td>ON/OFF: </td><td><input type='text' class='textfield' name='e_public' value='".$e_public."'></td></tr>\n";
+	      echo "<tr><td>Comment: </td><td><textarea cols='32' rows='5'  name='e_comment' >".stripslashes($e_comment)."</textarea></td></tr>\n";
+	      echo "<tr><td>HTML-TAG: </td><td><input type='text' class='textfield' name='e_element' value='".$e_element."'></td></tr>\n";
+	      echo "<tr><td>SRC: </td><td><input type='text' class='textfield' name='e_src' value='".$e_src."'></td></tr>\n";
+	      echo "<tr><td>Attributes: </td><td><textarea cols='32' rows='5'  name='e_attributes' >".stripslashes($e_attributes)."</textarea></td></tr>\n";
+	      echo "<tr><td>Left: </td><td><input type='text' class='textfield' name='e_left' value='".$e_left."'></td></tr>\n";
+	      echo "<tr><td>Top: </td><td><input type='text' class='textfield' name='e_top' value='".$e_top."'></td></tr>\n";
+	      echo "<tr><td>Width: </td><td><input type='text' class='textfield' name='e_width' value='".$e_width."'></td></tr>\n";
+	      echo "<tr><td>Height: </td><td><input type='text' class='textfield' name='e_height' value='".$e_height."'></td></tr>\n";
+	      echo "<tr><td>Z-INDEX: </td><td><input type='text' class='textfield' name='e_z_index' value='".$e_z_index."'></td></tr>\n";
+	      echo "<tr><td>Styles: </td><td><input type='text' class='textfield' name='e_more_styles' value='".$e_more_styles."'></td></tr>\n";
+	      echo "<tr><td>Content: </td><td><textarea cols='32' rows='4'  name='e_content' >".stripslashes($e_content)."</textarea></td></tr>\n";
+	      echo "<tr><td>Close-TAG: </td><td><input type='text' class='textfield' name='e_closetag' value='".$e_closetag."'></td></tr>\n";
+	      echo "<tr><td>JavaScript: </td><td><input type='text' class='textfield' name='e_js_file' value='".$e_js_file."'></td></tr>\n";
+	      echo "<tr><td>Module: </td><td><input type='text' class='textfield' name='e_mb_mod' value='".$e_mb_mod."'></td></tr>\n";
+	      echo "<tr><td>Target: </td><td><input type='text' class='textfield' name='e_target' value='".$e_target."'></td></tr>\n";
+	      echo "<tr><td>Requires: </td><td><input type='text' class='textfield' name='e_requires' value='".$e_requires."'></td></tr>\n";
+	}
+	echo "</table>\n";
+	echo "<input type='hidden' name='originGuiOfSelectedElement' value='" . $_POST["originGuiOfSelectedElement"] . "'>";
+
+	echo "<input type='hidden' name='myDelete'>";
+	echo "<input type='hidden' name='mySave'>";
+	echo "<input type='hidden' name='myShow'>";
+	echo "<input type='hidden' name='all'>";
+	echo "</form>";
+}else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editFilteredGroup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editFilteredGroup.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editFilteredGroup.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,198 @@
+<?php
+# $Id: mod_editFilteredGroup.php,v 1.12 2006/03/09 11:16:28 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editFilteredGroup.php,v 1.12 2006/03/09 11:16:28 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../php/mb_validateSession.php");
+import_request_variables("PG");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Filtered Group</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+
+function validate(val){
+   var ok = validateInput();
+   if(ok == 'true'){
+     var permission = false;
+     if(val == 'save'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'update'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'delete'){
+        permission = confirm("Delete Group?");
+     }
+     if(permission == true){
+        document.forms[0].action.value = val;
+        document.forms[0].submit();
+     }
+   }
+}
+function validateInput(){
+  var str_alert = "Input incorrect !";
+  if(document.forms[0].name.value == ''){
+      alert(str_alert);
+      document.forms[0].name.focus();
+      return 'false';
+  }
+  return 'true';
+}
+</script>
+
+</head>
+<body>
+<?php
+
+#delete
+if($action == 'delete'){
+   $sql = "DELETE FROM mb_group WHERE mb_group_id = " . $selected_group;
+   $res = db_query($sql);
+   $selected_group = 'new';
+}
+
+#save
+if($action == 'save'){
+   $sql = "SELECT mb_group_id FROM mb_group WHERE mb_group_name = '".$name."' ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('groupname must be unique!');</script>";
+   }
+   else{
+     $sql = "Insert INTO mb_group (mb_group_name, mb_group_owner, mb_group_description) VALUES ";
+     $sql.= "('".$name."', ".$owner_id.",'".$description."');";
+     $res = db_query($sql);
+     $selected_group = db_insert_id($res,"mb_group","mb_group_id");
+   }
+}
+
+#update
+if($action == 'update'){
+   $sql = "SELECT mb_group_id FROM mb_group WHERE mb_group_name = '".$name."' AND mb_group_id <> ".$selected_group;
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Groupname must be unique!');</script>";
+   }
+   else{
+     $sql = "UPDATE mb_group SET mb_group_name ='".$name."'";
+     $sql.=", mb_group_description = '".$description."'";
+     $sql.=" where mb_group_id = " . $selected_group;
+     $res = db_query($sql);
+   }
+}
+if (!isset($name) || $selected_group == 'new'){
+  $name = "";
+  $owner_id = $_SESSION["mb_user_id"];
+  $owner_name = $_SESSION["mb_user_name"];
+  $description = "";
+}
+$myGroup = true;
+
+/*HTML*****************************************************************************************************/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<table border='0'>";
+#User
+echo "<tr>";
+   echo "<td>";
+      echo "Group: ";
+   echo "</td>";
+echo "<td>";
+   echo "<select name='selected_group' onchange='submit()'>";
+   echo "<option value='new'>NEW...</option>";
+   $sql = "SELECT mb_group_name,mb_group_id FROM mb_group ";
+   if(isset($myGroup)){ $sql .= "WHERE mb_group_owner = ".$_SESSION["mb_user_id"];}
+   $sql .= " ORDER BY mb_group_name ";
+   $res = db_query($sql);
+   $count=0;
+   while($row = db_fetch_array($res)){
+	 	echo "<option value='".$row["mb_group_id"]."' ";
+		if($selected_group && $selected_group == $row["mb_group_id"]){
+         echo "selected";
+      }
+      echo ">".$row["mb_group_name"]."</option>";
+		$count++;
+   }
+   echo "</select>";
+   echo "</td>";
+echo "</tr>";
+
+
+if(isset($selected_group) && $selected_group != 0){
+   $sql = "SELECT * FROM mb_group WHERE mb_group_id = ".$selected_group." ORDER BY mb_group_name ";
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $name = $row["mb_group_name"];
+      $owner_id = $row["mb_group_owner"];
+      $description = $row["mb_group_description"];
+   }
+   $sql = "SELECT mb_user_name FROM mb_user WHERE mb_user_id = " . $owner_id;
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $owner_name = $row["mb_user_name"];
+   }
+}
+#name
+echo "<tr>";
+   echo "<td>Name:</td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='name' value='".$name."'>";
+   echo "</td>";
+echo "</tr>";
+
+#owner
+echo "<tr>";
+   echo "<td>Owner: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='owner_name' value='".$owner_name."' readonly>";
+      echo "<input type='hidden' size='30' name='owner_id' value='".$owner_id."' readonly>";
+   echo "</td>";
+echo "</tr>";
+
+#description
+echo "<tr>";
+   echo "<td>Description: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='description' value='".$description."'>";
+   echo "</td>";
+echo "</tr>";
+
+echo"</table>";
+if($selected_group == 'new' || !isset($selected_group)){
+   echo "<input type='button' value='save'  onclick='validate(\"save\")'>";
+}
+if($_SESSION["mb_user_id"] == $owner_id && $selected_group != 'new' && $selected_group != '' ){
+   echo "<input type='button' value='save'  onclick='validate(\"update\")'>";
+   echo "<input type='button' value='delete'  onclick='validate(\"delete\")'>";
+}
+?>
+<input type='hidden' name='action' value=''>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editFilteredUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editFilteredUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editFilteredUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,335 @@
+<?php
+# $Id: mod_editFilteredUser.php,v 1.16 2006/03/09 11:11:59 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editFilteredUser.php,v 1.16 2006/03/09 11:11:59 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../php/mb_validateSession.php");
+import_request_variables("PG");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+$myUser = true;
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Filtered User</title>
+<?php
+include '../include/dyn_css.php';
+$myPW = "**********";
+echo "<script language='JavaScript'>var myPW = '".$myPW."';</script>";
+?>
+<script language="JavaScript">
+
+function validate(val){
+   var ok = validateInput();
+   if(ok == 'true'){
+     var permission = false;
+     if(val == 'save'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'update'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'delete'){
+        permission = confirm("Delete User?");
+     }
+     if(permission == true){
+        if(document.forms[0].password.value == myPW){
+            document.forms[0].password.value = '';
+        }
+        document.forms[0].action.value = val;
+        document.forms[0].submit();
+     }
+   }
+}
+function validateInput(){
+  var str_alert = "Input incorrect !";
+  if(document.forms[0].name.value == ''){
+      alert(str_alert);
+      document.forms[0].name.focus();
+      return 'false';
+  }
+  if(document.forms[0].password.value == ''){
+      alert(str_alert);
+      document.forms[0].password.focus();
+      return 'false';
+  }
+  if((document.forms[0].password.value != myPW || document.forms[0].v_password.value != '' )&& document.forms[0].password.value != document.forms[0].v_password.value){
+      alert("Password verification failed. You have to enter the same password twice!");
+      document.forms[0].password.value = myPW;
+      document.forms[0].password.focus();
+      return 'false';
+  }
+  if(document.forms[0].resolution.value == ''){
+      document.forms[0].resolution.value = 72;
+      return 'true';
+  }
+  if(document.forms[0].login_count.value == ''){
+      document.forms[0].login_count.value = 0;
+      return 'true';
+  }
+  return 'true';
+}
+
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+#delete
+if($action == 'delete'){
+   $sql = "DELETE FROM mb_user WHERE mb_user_id = " . $selected_user;
+   $res = db_query($sql);
+   $selected_user = 'new';
+}
+
+#save
+if($action == 'save'){
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "Insert INTO mb_user (mb_user_name, mb_user_password,mb_user_owner, mb_user_description, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution) VALUES ";
+	$sql.= "('".$name."', ";
+	
+	if(SYS_DBTYPE == "mysql") {
+		$sql .= "password('".$password."')";
+	}
+	else {
+		if (MD5 == 'false'){
+			$sql .= "'".$password."'";
+		}else{
+			$sql .= "md5('".$password."')";
+		}
+	}
+	
+     $sql.= ",".$owner_id.",'".$description."', '".$email."', '".$phone."', '".$department."', ".$resolution.");";
+     $res = db_query($sql);
+     $selected_user = db_insert_id($res,"mb_user","mb_user_id");
+   }
+}
+
+#update
+if($action == 'update'){
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' AND mb_user_id <> ".$selected_user;
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "UPDATE mb_user SET mb_user_name ='".$name."'";
+     if($password != ""){
+        $sql.=", mb_user_password = ";
+
+	     if (SYS_DBTYPE=="mysql"){
+	     	$sql.= "password('".$password."')";
+	     }else{
+	     	if (MD5 == 'false'){
+				$sql .= "'".$password."'";
+	     	}else{
+	     		$sql.= "md5('".$password."')";
+	     	}
+	     }
+	}
+     $sql.=", mb_user_description = '".$description."'";
+     $sql.=", mb_user_login_count = '".$login_count."'";
+     $sql.=", mb_user_email = '".$email."'";
+     $sql.=", mb_user_phone = '".$phone."'";
+     $sql.=", mb_user_department = '".$department."'";
+     $sql.=", mb_user_resolution = ".$resolution;
+     $sql.=" where mb_user_id = " . $selected_user;
+     $res = db_query($sql);
+		if($password && $res){
+			echo "<script language='JavaScript'>alert('Password has been updated successfully!');</script>";
+		}
+   }
+}
+if (!isset($name) || $selected_user == 'new'){
+  $name = "";
+  $password = "";
+  $owner_id = $_SESSION["mb_user_id"];
+  $owner_name = $_SESSION["mb_user_name"];
+  $description = "";
+  $login_count = 0;
+  $email = "";
+  $phone = "";
+  $department = "";
+  $resolution = 72;
+}
+
+
+/*HTML*****************************************************************************************************/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<table border='0'>";
+#User
+echo "<tr>";
+   echo "<td>";
+      echo "User: ";
+   echo "</td>";
+echo "<td>";
+   echo "<select name='selected_user' onchange='submit()'>";
+   echo "<option value='new'>NEW...</option>";
+   $sql = "SELECT mb_user_name,mb_user_id FROM mb_user ";
+   if(isset($myUser)){ $sql .= "WHERE mb_user_owner = ".$_SESSION["mb_user_id"];}
+   $sql .= " ORDER BY mb_user_name ";
+   $res = db_query($sql);
+   $count=0;
+   while($row = db_fetch_array($res)){
+	 	echo "<option value='".$row["mb_user_id"]."' ";
+		if($selected_user && $selected_user == $row["mb_user_id"]){
+         echo "selected";
+      }
+      echo ">".$row["mb_user_name"]."</option>";
+		$count++;
+   }
+   echo "</select>";
+   echo "</td>";
+echo "</tr>";
+
+
+if(isset($selected_user) && $selected_user != 0){
+   $sql = "SELECT * FROM mb_user WHERE mb_user_id = ".$selected_user." ORDER BY mb_user_name ";
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $name = $row["mb_user_name"];
+      $password = $row["mb_user_password"];
+      $owner_id = $row["mb_user_owner"];
+      $description = $row["mb_user_description"];
+      $login_count = $row["mb_user_login_count"];
+      $email = $row["mb_user_email"];
+      $phone = $row["mb_user_phone"];
+      $department = $row["mb_user_department"];
+      $resolution = $row["mb_user_resolution"];
+   }
+   $sql = "SELECT mb_user_name FROM mb_user WHERE mb_user_id = " . $owner_id;
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $owner_name = $row["mb_user_name"];
+   }
+}
+#name
+echo "<tr>";
+   echo "<td>Name:</td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='name' value='".$name."'>";
+   echo "</td>";
+echo "</tr>";
+
+#password
+echo "<tr>";
+   echo "<td>Password: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='password' value='";
+      if(isset($selected_user) && $selected_user != 'new'){
+         echo $myPW;
+      }
+      echo "' >";
+   echo "</td>";
+echo "</tr>";
+
+#confirm password
+echo "<tr>";
+   echo "<td>Confirm password: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='v_password' value='";
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+
+#owner
+echo "<tr>";
+   echo "<td>Owner: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='owner_name' value='".$owner_name."' readonly>";
+      echo "<input type='hidden' size='30' name='owner_id' value='".$owner_id."' readonly>";
+   echo "</td>";
+echo "</tr>";
+
+#description
+echo "<tr>";
+   echo "<td>Description: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='description' value='".$description."'>";
+   echo "</td>";
+echo "</tr>";
+
+
+#login_count
+echo "<tr>";
+   echo "<td>Login_count: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='login_count' value='".$login_count."'>";
+   echo "</td>";
+echo "</tr>";
+
+#email
+echo "<tr>";
+   echo "<td>Email: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='email' value='".$email."'>";
+   echo "</td>";
+echo "</tr>";
+
+#phone
+echo "<tr>";
+   echo "<td>Phone: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='phone' value='".$phone."'>";
+   echo "</td>";
+echo "</tr>";
+
+#department
+echo "<tr>";
+   echo "<td>Department: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='department' value='".$department."'>";
+   echo "</td>";
+echo "</tr>";
+
+#resolution
+echo "<tr>";
+   echo "<td>Resolution: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='resolution' value='".$resolution."'>";
+   echo "</td>";
+echo "</tr>";
+echo"</table>";
+if($selected_user == 'new' || !isset($selected_user)){
+   echo "<input type='button' value='save'  onclick='validate(\"save\")'>";
+}
+if($_SESSION["mb_user_id"] == $owner_id && $selected_user != 'new' && $selected_user != '' ){
+   echo "<input type='button' value='save'  onclick='validate(\"update\")'>";
+   echo "<input type='button' value='delete'  onclick='validate(\"delete\")'>";
+}
+?>
+<input type='hidden' name='action' value=''>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editGroup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editGroup.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editGroup.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,201 @@
+<?php
+# $Id: mod_editGroup.php,v 1.12 2006/03/09 11:05:14 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editGroup.php,v 1.12 2006/03/09 11:05:14 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+require_once("../php/mb_validateSession.php");
+import_request_variables("PG");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<head>
+<title>Edit Group</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+
+function validate(val){
+   var ok = validateInput();
+   if(ok == 'true'){
+     var permission = false;
+     if(val == 'save'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'update'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'delete'){
+        permission = confirm("Delete Group?");
+     }
+     if(permission == true){
+        document.forms[0].action.value = val;
+        document.forms[0].submit();
+     }
+   }
+}
+function validateInput(){
+  var str_alert = "Input incorrect !";
+  if(document.forms[0].name.value == ''){
+      alert(str_alert);
+      document.forms[0].name.focus();
+      return 'false';
+  }
+  return 'true';
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+#delete
+if($action == 'delete'){
+   $sql = "DELETE FROM mb_group WHERE mb_group_id = " . $selected_group;
+   $res = db_query($sql);
+   $selected_group = 'new';
+}
+
+#save
+if($action == 'save'){
+   $sql = "SELECT mb_group_id FROM mb_group WHERE mb_group_name = '".$name."' ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('groupname must be unique!');</script>";
+   }
+   else{
+     $sql = "Insert INTO mb_group (mb_group_name, mb_group_owner, mb_group_description) VALUES ";
+     $sql.= "('".$name."', ".$owner_id.",'".$description."');";
+     $res = db_query($sql);
+     $selected_group = db_insert_id($res,"mb_group","mb_group_id");
+   }
+}
+
+#update
+if($action == 'update'){
+   $sql = "SELECT mb_group_id FROM mb_group WHERE mb_group_name = '".$name."' AND mb_group_id <> ".$selected_group;
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Groupname must be unique!');</script>";
+   }
+   else{
+     $sql = "UPDATE mb_group SET mb_group_name ='".$name."'";
+     $sql.=", mb_group_description = '".$description."'";
+     $sql.=" where mb_group_id = " . $selected_group;
+     $res = db_query($sql);
+   }
+}
+if (!isset($name) || $selected_group == 'new'){
+  $name = "";
+  $owner_id = $_SESSION["mb_user_id"];
+  $owner_name = $_SESSION["mb_user_name"];
+  $description = "";
+}
+
+/*HTML*****************************************************************************************************/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<table border='0'>";
+#User
+echo "<tr>";
+   echo "<td>";
+      echo "Group: ";
+   echo "</td>";
+echo "<td>";
+   echo "<select name='selected_group' onchange='submit()'>";
+   echo "<option value='new'>NEW...</option>";
+   $sql = "SELECT mb_group_name,mb_group_id FROM mb_group ";
+   if(isset($myGroup)){ $sql .= "WHERE mb_group_owner = ".$_SESSION["mb_user_id"];}
+   $sql .= " ORDER BY mb_group_name ";
+   $res = db_query($sql);
+   $count=0;
+   while($row = db_fetch_array($res)){
+	 	echo "<option value='".$row["mb_group_id"]."' ";
+		if($selected_group && $selected_group == $row["mb_group_id"]){
+         echo "selected";
+      }
+      echo ">".$row["mb_group_name"]."</option>";
+		$count++;
+   }
+   echo "</select>";
+   echo "</td>";
+echo "</tr>";
+
+
+if(isset($selected_group) && $selected_group != 0){
+   $sql = "SELECT * FROM mb_group WHERE mb_group_id = ".$selected_group." ORDER BY mb_group_name ";
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $name = $row["mb_group_name"];
+      $owner_id = $row["mb_group_owner"];
+      $description = $row["mb_group_description"];
+   }
+   $sql = "SELECT mb_user_name FROM mb_user WHERE mb_user_id = " . $owner_id;
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $owner_name = $row["mb_user_name"];
+   }
+}
+#name
+echo "<tr>";
+   echo "<td>Name:</td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='name' value='".$name."'>";
+   echo "</td>";
+echo "</tr>";
+
+#owner
+echo "<tr>";
+   echo "<td>Owner: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='owner_name' value='".$owner_name."' readonly>";
+      echo "<input type='hidden' size='30' name='owner_id' value='".$owner_id."' readonly>";
+   echo "</td>";
+echo "</tr>";
+
+#description
+echo "<tr>";
+   echo "<td>Description: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='description' value='".$description."'>";
+   echo "</td>";
+echo "</tr>";
+
+echo"</table>";
+if($selected_group == 'new' || !isset($selected_group)){
+   echo "<input type='button' value='save'  onclick='validate(\"save\")'>";
+}
+if($_SESSION["mb_user_id"] == $owner_id && $selected_group != 'new' && $selected_group != '' ){
+   echo "<input type='button' value='save'  onclick='validate(\"update\")'>";
+   echo "<input type='button' value='delete'  onclick='validate(\"delete\")'>";
+}
+?>
+<input type='hidden' name='action' value=''>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editGuiWms.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editGuiWms.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editGuiWms.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,585 @@
+<?php
+# $Id: mod_editGuiWms.php,v 1.21 2006/03/09 10:50:48 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editGuiWms.php,v 1.21 2006/03/09 10:50:48 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI WMS</title>
+<?php
+include_once '../include/dyn_css.php';
+?>
+
+<script language="JavaScript">
+function edit_gaz(gui,wms,layer){
+	window.open("../php/mod_wfsLayerObj_conf.php?gui="+gui+"&wms="+wms+"&layer="+layer);
+}
+function validate(wert){
+	if(wert == 'delete_wms'){
+		if(document.form1.wmsList.selectedIndex == -1){
+			document.form1.wmsList.style.background = '#ff0000';
+		}else{
+
+			var secure = confirm("Remove WMS in this GUI ?");
+			if(secure == true){
+				document.form1.del.value='true';
+				document.form1.submit();
+			}
+		}
+	}
+
+	if(wert == 'up_wms'){
+		if(document.form1.wmsList.selectedIndex == -1){
+			document.form1.wmsList.style.background = '#ff0000';
+		}else{
+			if (document.form1.wmsList.selectedIndex>0){
+				document.form1.up.value='true';
+				document.form1.submit();
+			}
+		}
+	}
+
+	if(wert == 'down_wms'){
+		if(document.form1.wmsList.selectedIndex == -1){
+			document.form1.wmsList.style.background = '#ff0000';
+		}else{
+			if (document.form1.wmsList.selectedIndex<document.form1.wmsList.length-1){
+				document.form1.down.value='true';
+				document.form1.submit();
+			}
+		}
+	}
+	
+}
+function checkBoxValue(){
+   for(var i=0; i<document.forms[0].elements.length; i++){
+      if(document.forms[0].elements[i].type == 'checkbox'){
+         if(document.forms[0].elements[i].checked == true){
+            document.forms[0].elements[i].value = '1';
+         }
+         else{
+            document.forms[0].elements[i].value = '0';
+            document.forms[0].elements[i].checked = true;
+         }
+      }
+      if(document.forms[0].elements[i].type == 'text' && ( document.forms[0].elements[i].name.indexOf("minscale") > -1 || document.forms[0].elements[i].name.indexOf("maxscale") > -1 )){
+         var nr = parseInt(document.forms[0].elements[i].value);
+         if(isNaN(nr) == true){document.forms[0].elements[i].value = 0;}
+         else{document.forms[0].elements[i].value = nr;}
+      }
+   }
+   document.forms[0].update_content.value=1;
+   document.forms[0].submit();
+}
+function getAllLayer(){
+   var arrayLayer = new Array();
+   var cntLayer = 0;
+   for(var i=0; i<document.forms[0].elements.length; i++){
+      if(document.forms[0].elements[i].name.indexOf("layer_id") > -1){
+         arrayLayer[cntLayer] = document.forms[0].elements[i].value;
+         cntLayer++;
+      }
+   }
+   return arrayLayer;
+}
+function setSubs(){
+   var arrayLayer = getAllLayer();
+   for(var i=0; i<arrayLayer.length; i++){
+      if(parseInt(eval("document.forms[0].L_" + arrayLayer[i] + "___layer_parent.value")) > 0){
+         eval("document.forms[0].L_" + arrayLayer[i] + "___gui_layer_status.checked = false");
+      }
+   }
+}
+function setLayer(def,status){
+   var arrayLayer = getAllLayer();
+   if(def == 'querylayer'){
+      for(var i=1; i<arrayLayer.length; i++){
+         if(eval("document.forms[0].L_" + arrayLayer[i] + "___gui_layer_querylayer.disabled == false")){
+            eval("document.forms[0].L_" + arrayLayer[i] + "___gui_layer_querylayer.checked = " + status);
+         }
+      }
+   }
+   if(def == 'visible'){
+      for(var i=1; i<arrayLayer.length; i++){
+         eval("document.forms[0].L_" + arrayLayer[i] + "___gui_layer_visible.checked = " + status);
+      }
+   }
+}
+</script>
+
+</head>
+<body>
+<?php
+
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+$mb_user_id=$_SESSION["mb_user_id"];
+
+#delete gui_wms from gui
+if($del && $del == 'true'){
+	$sql="SELECT DISTINCT gui_wms_position from gui_wms WHERE fkey_gui_id = '".$guiList."' and fkey_wms_id='".$wmsList."';";
+	$res = db_query($sql);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		$wms_position = $row["gui_wms_position"];
+		$cnt++;
+	}
+	#if($cnt > 1){die("Error: WMS (ID) not unique!");}
+	
+		$sql = "Delete from gui_wms where fkey_gui_id = '".$guiList."' and fkey_wms_id='".$wmsList."';";
+		$res = db_query($sql);
+		
+		$sql = "Delete from gui_layer where fkey_gui_id = '".$guiList."' and gui_layer_wms_id = ".$wmsList.";";
+		$res = db_query($sql);
+		
+		$del='false';
+	
+		$sql = "UPDATE gui_wms SET gui_wms_position = (gui_wms_position - 1) WHERE gui_wms_position > " . $wms_position;
+		$sql .= " AND fkey_gui_id = '".$guiList."'";
+		$res = db_query($sql);
+
+	unset($wmsList);
+}
+
+#update gui_wms_position
+if($up && $up == 'true'){
+	if ($wmsList!=""){
+		$sql = "SELECT gui_wms_position ";
+		$sql .= "FROM gui_wms WHERE fkey_gui_id = '".$guiList."' AND fkey_wms_id = ".$wmsList;
+		$res = db_query($sql);
+		if($row = db_fetch_array($res)){
+			$wms_position = $row["gui_wms_position"];
+		}
+	}
+	if($wms_position > 0){
+		$sql = "UPDATE gui_wms SET ";
+		$sql .= "gui_wms_position = ".($wms_position - 1);
+		$sql .= " WHERE fkey_gui_id = '".$guiList."' AND fkey_wms_id='".$wmsList."';";
+		$res = db_query($sql);
+		$sql = "UPDATE gui_wms SET ";
+		$sql .= "gui_wms_position = " . $wms_position;
+		$sql .= " WHERE gui_wms_position = ".($wms_position - 1)." AND fkey_gui_id = '".$guiList."' AND fkey_wms_id <> '".$wmsList."';";
+		//echo $sql;
+		$res = db_query($sql);
+	}
+}
+
+if($down && $down == 'true'){
+	$max = 0; 
+	if ($wmsList!=""){
+		$sql = "SELECT gui_wms_position ";
+		$sql .= "FROM gui_wms WHERE fkey_gui_id = '".$guiList."' AND fkey_wms_id='".$wmsList."';";
+		$res = db_query($sql);
+		if($row = db_fetch_array($res)){
+			$wms_position = $row["gui_wms_position"];
+		}
+		$sql = "SELECT MAX(gui_wms_position) as max FROM gui_wms WHERE fkey_gui_id = '".$guiList."' ";
+		$res = db_query($sql);
+		if($row = db_fetch_array($res)){
+			$max = $row["max"];
+		}
+	}
+	if($wms_position < $max){
+		$sql = "UPDATE gui_wms SET ";
+		$sql .= "gui_wms_position = ".($wms_position + 1);
+		$sql .= " WHERE fkey_gui_id = '".$guiList."' AND fkey_wms_id='".$wmsList."';";
+		$res = db_query($sql);
+		$sql = "UPDATE gui_wms SET ";
+		$sql .= "gui_wms_position = " . $wms_position;
+		$sql .= " WHERE gui_wms_position = ".($wms_position + 1)." AND fkey_gui_id = '".$guiList."' AND fkey_wms_id <> '".$wmsList."';";
+		$res = db_query($sql);
+	}
+}
+
+/*handle Updates*/
+if(isset($update_content) && $update_content == "1"){
+   if(isset($this_gui_wms_epsg)){
+      $sql = "UPDATE gui_wms set gui_wms_epsg = '".$this_gui_wms_epsg."', gui_wms_mapformat = '".$this_gui_wms_mapformat."', ";
+      $sql .= "gui_wms_featureinfoformat = '".$this_gui_wms_featureinfoformat."', gui_wms_exceptionformat = '".$this_gui_wms_exceptionformat."', ";
+      $sql .= "gui_wms_visible = '".$this_gui_wms_visible."' ";
+      $sql .= "WHERE fkey_gui_id = '".$this_gui."' AND fkey_wms_id = ".$this_wms;
+      $res = db_query($sql);
+   }
+   else{
+      $sql = "UPDATE gui_wms set gui_wms_mapformat = '".$this_gui_wms_mapformat."', ";
+      $sql .= "gui_wms_featureinfoformat = '".$this_gui_wms_featureinfoformat."', gui_wms_exceptionformat = '".$this_gui_wms_exceptionformat."', ";
+      $sql .= "gui_wms_visible = '".$this_gui_wms_visible."' ";
+      $sql .= "WHERE fkey_gui_id = '".$this_gui."' AND fkey_wms_id = ".$this_wms;
+      $res = db_query($sql);
+   }
+
+   /**/
+
+   $cnt = 0;
+   while(list($key,$val) = each($_REQUEST)){
+      if(preg_match("/___/", $key)){
+          $myKey = explode("___", $key);
+          if($myKey[1]!="layer_parent" && $myKey[1]!='layer_id' )
+          {
+          $sql = "UPDATE gui_layer SET ".$myKey[1]." = ".$val." WHERE fkey_gui_id = '".$this_gui."' AND fkey_layer_id = ".str_replace("L_","",$myKey[0]);
+          
+          if(!$res = db_query($sql))
+          {
+          	echo "FEHLER in ZEILE 249";
+          }
+        }
+          #echo $sql."<br>";
+      }
+   }
+}
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<table cellpadding='3' cellspacing='3' border='0'>";
+
+echo "<tr>";
+echo "<td>";
+echo "GUI";
+echo "</td>";
+echo "<td>";
+echo "WMS-TITLE";
+echo "</td>";
+echo "<td>";
+echo "</td>";
+echo "<tr>";
+
+echo "<td>";
+$sql = "SELECT * from gui_mb_user JOIN gui ON gui.gui_id=gui_mb_user.fkey_gui_id WHERE gui.gui_public=1 AND gui_mb_user.fkey_mb_user_id=".$mb_user_id." AND gui_mb_user.mb_user_type='owner' Order BY fkey_gui_id ;";
+
+$res = db_query($sql);
+$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++;
+}
+
+echo"<select size='8' name='guiList' style='width:200px' onchange='document.form1.wmsList.selectedIndex = -1;submit()'>";
+$selected_gui_id="";
+
+for ($i=0; $i<$count;$i++){
+   echo "<option value='".$gui_name[$i]."' ";
+   if($guiList && $guiList == $gui_name[$i]){
+      echo "selected";
+      $selected_gui_id=$gui_name[$i];
+   }
+   else{
+      if ($i==0){
+         echo "selected";
+         $selected_gui_id=$gui_name[$i];
+		}
+   }
+   echo ">".$gui_name[$i]."</option>";
+}
+
+echo "</select>";
+echo "</td>";
+echo "<td>";
+
+$sql="SELECT * from gui_wms JOIN gui ON gui_wms.fkey_gui_id = gui.gui_id JOIN wms ON gui_wms.fkey_wms_id = wms.wms_id AND gui_wms.fkey_gui_id=gui.gui_id WHERE gui.gui_id='".$selected_gui_id."' ORDER BY gui_wms_position";
+$res = db_query($sql);
+//echo $sql;
+$count_wms = 0;
+echo "<select size='8' name='wmsList' style='width:200px' onchange='submit()'>";
+
+while($row = db_fetch_array($res)){
+	echo "<option value='".$row["wms_id"]."' ";
+	if(isset($wmsList) && $wmsList == $row["wms_id"]){
+		echo "selected";
+	}
+	echo ">".$row["gui_wms_position"]." - ".$row["wms_title"]."</option>";
+	$count_wms++;
+}
+echo "</select>";
+echo "</td><td>";
+echo "<input class='myButton' type='button' name='up_wms' value=' up ' onClick='validate(\"up_wms\")'>";
+echo "<input type='hidden' name='up' value=''><br><br>";
+
+echo "<input class='myButton' type='button' name='down_wms' value='down'  onClick='validate(\"down_wms\")'>";
+echo "<input type='hidden' name='down' value=''><br><br>";
+
+echo "<input class='myButton' type='button' name='delete_wms' value='remove'  onClick='validate(\"delete_wms\")'>";
+echo "<input type='hidden' name='del' value=''>";
+
+echo "</td>";
+echo "</tr>";
+echo "</table>";
+
+
+if(isset($wmsList)){
+#gui_wms
+$sql_gw = "SELECT * FROM gui_wms WHERE fkey_gui_id = '".$guiList."' AND fkey_wms_id = ".$wmsList;
+$res_gw = db_query($sql_gw);
+$cnt_gw = 0;
+while($row = db_fetch_array($res_gw)){
+   $gui_wms_position[$cnt_gw] = $row["gui_wms_position"];
+   $gui_wms_mapformat[$cnt_gw] = $row["gui_wms_mapformat"];
+   $gui_wms_featureinfoformat[$cnt_gw] = $row["gui_wms_featureinfoformat"];
+   $gui_wms_exceptionformat[$cnt_gw] = $row["gui_wms_exceptionformat"];
+   $gui_wms_epsg[$cnt_gw] = $row["gui_wms_epsg"];
+   $gui_wms_visible[$cnt_gw] = $row["gui_wms_visible"];
+   $cnt_gw++;
+}
+#wms
+$sql_w = "SELECT * FROM wms WHERE wms_id = ".$wmsList;
+$res_w = db_query($sql_w);
+$cnt_w = 0;
+while($row = db_fetch_array($res_w)){
+   $wms_id[$cnt_w] = $row["wms_id"];
+   $wms_version[$cnt_w] = $row["wms_version"];
+   $wms_title[$cnt_w] = $row["wms_title"];
+   $wms_abstract[$cnt_w] = $row["wms_abstract"];
+   $wms_getcapabilities[$cnt_w] = $row["wms_getcapabilities"];
+   $cnt_w++;
+ }
+#wms_format
+$sql_wf = "SELECT * FROM  wms_format WHERE  fkey_wms_id = ".$wmsList;
+$res_wf = db_query($sql_wf);
+$cnt_wf = 0;
+while($row = db_fetch_array($res_wf)){
+   $data_type[$cnt_wf] = $row["data_type"];
+   $data_format[$cnt_wf] = $row["data_format"];
+   $cnt_wf++;
+ }
+#gui_layer
+$sql_gl = "SELECT * FROM gui_layer WHERE  gui_layer_wms_id = ".$wmsList ." AND fkey_gui_id = '".$guiList."' ORDER BY fkey_layer_id";
+$res_gl = db_query($sql_gl);
+$cnt_gl = 0;
+while($row = db_fetch_array($res_gl)){
+   $fkey_layer_id[$cnt_gl] = $row["fkey_layer_id"];
+   $gui_layer_status[$cnt_gl] = $row["gui_layer_status"];
+   $gui_layer_selectable[$cnt_gl] = $row["gui_layer_selectable"];
+   $gui_layer_visible[$cnt_gl] = $row["gui_layer_visible"];
+   $gui_layer_queryable[$cnt_gl] = $row["gui_layer_queryable"];
+   $gui_layer_querylayer[$cnt_gl] = $row["gui_layer_querylayer"];
+   $gui_layer_minscale[$cnt_gl] = $row["gui_layer_minscale"];
+   $gui_layer_maxscale[$cnt_gl] = $row["gui_layer_maxscale"];
+   $gui_layer_priority[$cnt_gl] = $row["gui_layer_priority"];
+	$gui_layer_wfs_featuretype[$cnt_gl] = $row["gui_layer_wfs_featuretype"];
+   $cnt_gl++;
+ }
+#layer
+$sql_l = "SELECT * FROM layer WHERE  fkey_wms_id = ".$wmsList." ORDER BY layer_id";;
+$res_l = db_query($sql_l);
+$cnt_l = 0;
+while($row = db_fetch_array($res_l)){
+   $layer_id[$cnt_l] = $row["layer_id"];
+   $layer_parent[$cnt_l] = $row["layer_parent"];
+   $layer_name[$cnt_l] = $row["layer_name"];
+   $layer_title[$cnt_l] = $row["layer_title"];
+   $layer_queryable[$cnt_l] = $row["layer_queryable"];
+   $layer_minscale[$cnt_l] = $row["layer_minscale"];
+   $layer_maxscale[$cnt_l] = $row["layer_maxscale"];
+   $cnt_l++;
+ }
+if($cnt_gl != $cnt_l){echo "error: different layer count";}
+#layer_epsg
+$sql_le = "SELECT * FROM layer_epsg WHERE  fkey_layer_id = ".$layer_id[0];
+$res_le = db_query($sql_le);
+$cnt_le = 0;
+while($row = db_fetch_array($res_le)){
+   $epsg[$cnt_le] = $row["epsg"];
+   $cnt_le++;
+ }
+
+echo "<div style='position:absolute;left:590px; top:180px;' ><input type='button' style='width:100px;height:100px;background-color:#0066cc' value='save' onclick='checkBoxValue()'></div>";
+echo "<table>";
+echo "<tr>";
+echo "<td colspan='2'>";
+echo "<a href='".$wms_getcapabilities[0];
+if( $wms_version[0] == "1.0.0"){ echo "&WMTVER=". $wms_version[0]."&REQUEST=capabilities";}
+else{echo "&VERSION=". $wms_version[0]."&REQUEST=GetCapabilities&SERVICE=WMS";}
+echo "' style='font-size:14px' target='_blank'>LINK: Capabilites</a>";
+echo "</td>";
+echo "<td align = right>WMS ID: " . $wms_id[0] . "</td>";
+echo "<tr>";
+#epsg
+if($gui_wms_position[0] == 0){
+  echo "<tr>";
+     echo "<td>EPSG: </td><td>";
+     echo "<select class='mySelect'  name='this_gui_wms_epsg'>";
+        for($i=0; $i<count($epsg); $i++){
+           echo "<option value='".$epsg[$i]."' ";
+           if($epsg[$i] == $gui_wms_epsg[0]){ echo "selected";}
+           echo ">".$epsg[$i]."</option>";
+        }
+     echo "</select>";
+     echo "</td>";
+  echo "</tr>";
+}
+#format
+echo "<tr>";
+   echo "<td>Mapformat: </td><td>";
+        echo "<select class='mySelect'  name='this_gui_wms_mapformat'>";
+        for($i=0; $i<count($data_format); $i++){
+           if($data_type[$i] == 'map'){
+              echo "<option value='".$data_format[$i]."' ";
+              if($data_format[$i] == $gui_wms_mapformat[0]){ echo "selected";}
+              echo ">".$data_format[$i]."</option>";
+           }
+        }
+     echo "</select>";
+   echo "</td>";
+
+echo "</tr>";
+
+echo "<tr>";
+   echo "<td>Infoformat: </td><td>";
+        echo "<select class='mySelect'  name='this_gui_wms_featureinfoformat'>";
+        echo "<option value='text/html'>text/html</option>";
+        for($i=0; $i<count($data_format); $i++){
+           if($data_type[$i] == 'featureinfo'){
+              echo "<option value='".$data_format[$i]."' ";
+              if($data_format[$i] == $gui_wms_featureinfoformat[0]){ echo "selected";}
+              echo ">".$data_format[$i]."</option>";
+           }
+        }
+     echo "</select>";
+   echo "</td>";
+echo "</tr>";
+
+echo "<tr>";
+   echo "<td>Exceptionformat: </td><td>";
+        echo "<select class='mySelect' name='this_gui_wms_exceptionformat'>";
+        for($i=0; $i<count($data_format); $i++){
+           if($data_type[$i] == 'exception'){
+              echo "<option value='".$data_format[$i]."' ";
+              if($data_format[$i] == $gui_wms_exceptionformat[0]){ echo "selected";}
+              echo ">".$data_format[$i]."</option>";
+           }
+        }
+     echo "</select>";
+   echo "</td>";
+echo "</tr><br>";
+
+# visibility
+echo "<tr>";
+	echo "<td>Visibility: </td><td>";
+	echo "<select class='mySelect' name='this_gui_wms_visible'>";
+	for($i=0; $i<3; $i++){
+		echo "<option value='".$i."' ";
+		if($i == $gui_wms_visible[0]){ echo "selected";}
+		echo ">";
+		if($i == '0'){
+			echo "hidden";
+		}
+		if($i == '1'){
+			echo "visible";
+		}
+		echo "</option>";           
+	}
+	echo "</select>";
+	echo "</td>";
+	
+echo "</tr>";
+
+echo "</table><br>";
+
+echo "<table border='1' cellpadding='2'>";
+echo "<tr><td>Nr.</td><td>ID</td><td>Parent</td><td>Name</td><td>Title</td><td>on/off</td><td>sel</td><td>sel_default</td><td>info</td><td>info_default</td><td>minScale 1:</td><td>maxScale 1:</td><td>Prio</td></tr>";
+echo "<tr><td></td><td></td><td></td><td></td><td></td><td>";
+echo "<input type='button' class='LButton' style='width:65px' value='Sublayer off' onclick='setSubs()'>";
+echo "</td><td></td><td>";
+echo "<nobr><input type='button' class='LButton' value='off' onclick='setLayer(\"visible\",false)'>&nbsp;<input type='button' class='LButton' value='on' onclick='setLayer(\"visible\",true)'></nobr>";
+echo"</td><td></td><td>";
+echo "<nobr><input type='button' class='LButton' value='off' onclick='setLayer(\"querylayer\",false)'>&nbsp;<input type='button' class='LButton' value='on' onclick='setLayer(\"querylayer\",true)'></nobr>";
+echo "</td><td></td><td></td><td></td></tr>";
+for($i=0; $i<count($layer_id); $i++){
+ echo "<tr align='center'>";
+  echo "<td><input type='text' size='1' name='L_".$layer_id[$i]."___layer_nr' disabled value='".$i."'></td>";
+  echo "<td style='background:lightgrey'><input type='text' size='2' name='L_".$layer_id[$i]."___layer_id' value='".$layer_id[$i]."' readonly></td>";
+  echo "<td><input type='text' size='1' name='L_".$layer_id[$i]."___layer_parent' value='".$layer_parent[$i]."' readonly></td>";
+  echo "<td style='background:lightgrey'><input type='text' size='7' value='".$layer_name[$i]."' readonly></td>";
+  echo "<td><input type='text' size='12' value='".$layer_title[$i]."' readonly></td>";
+
+  echo "<td style='background:lightgrey'><input name='L_".$layer_id[$i]."___gui_layer_status' type='checkbox' ";
+  if($gui_layer_status[$i] == 1){ echo "checked";}
+  echo "></td>";
+
+  echo "<td><input name='L_".$layer_id[$i]."___gui_layer_selectable' type='checkbox' ";
+  if($gui_layer_selectable[$i] == 1){ echo "checked";}
+  echo "></td>";
+
+  echo "<td style='background:lightgrey'><input name='L_".$layer_id[$i]."___gui_layer_visible' type='checkbox' ";
+  if($gui_layer_visible[$i] == 1){ echo "checked";}
+  echo "></td>";
+
+  echo "<td><input name='L_".$layer_id[$i]."___gui_layer_queryable' type='checkbox' ";
+  if($gui_layer_queryable[$i] == 1){ echo "checked";}
+  if($layer_queryable[$i] == 0){ echo "disabled";}
+  echo "></td>";
+
+  echo "<td style='background:lightgrey'><input name='L_".$layer_id[$i]."___gui_layer_querylayer' type='checkbox' ";
+  if($gui_layer_querylayer[$i] == 1){ echo "checked";}
+  if($layer_queryable[$i] == 0){ echo "disabled";}
+  echo "></td>";
+
+  echo "<td><input name='L_".$layer_id[$i]."___gui_layer_minscale' type='text' size='5' value='".$gui_layer_minscale[$i]."'></td>";
+  echo "<td style='background:lightgrey'><input name='L_".$layer_id[$i]."___gui_layer_maxscale' type='text' size='5' value='".$gui_layer_maxscale[$i]."'></td>";
+  /**/
+  echo "<td><select name='L_".$layer_id[$i]."___gui_layer_priority'>";
+  for($j=0; $j<count($gui_layer_priority); $j++){
+     echo "<option value='".$j."'";
+     if($j == $gui_layer_priority[$i]){echo "selected";}
+     echo ">".$j;
+     echo "</option>";
+  }
+  echo "</select></td>\n";
+  /* wfs configuration */
+	echo "<td>";
+	echo "<input name='gui_layer_gaz' type='button' onclick='edit_gaz(\"".$guiList."\",".$wmsList.",".$layer_id[$i].")' value='";
+	if($gui_layer_wfs_featuretype[$i] == ""){
+		echo "setWFS";
+	}
+	else{
+		echo "wfs: ".$gui_layer_wfs_featuretype[$i];	
+	}
+	echo "'>";	
+	
+	
+	
+	
+	echo "</td>";
+
+ echo "</tr>\n";
+ if($i == 0){ echo "<tr><td colspan='11'><hr></td></tr>";}
+}
+echo "</table>\n";
+echo "<input type='hidden' name='this_gui' value='".$guiList."'>\n";
+echo "<input type='hidden' name='this_wms' value='".$wmsList."'>\n";
+echo "<input type='hidden' name='this_layer_count' value='".$cnt_l."'>\n";
+echo "<input type='hidden' name='update_content' value=''>\n";
+echo "</form>\n";
+}
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editGuiWmsMeta.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editGuiWmsMeta.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editGuiWmsMeta.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,187 @@
+<?php
+# $Id: mod_editGuiWmsMeta.php,v 1.8 2006/03/09 10:32:40 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editGuiWmsMeta.php,v 1.8 2006/03/09 10:32:40 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+include("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit WMS Meta Data</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+   <!--
+   body{
+      background-color: #ffffff;
+      font-family: Arial, Helvetica, sans-serif;
+      font-size : 12px;
+      color: #808080
+   }
+   .guiList1{
+   	position:absolute;
+   	top:30px;
+   	left:10px;
+   	width:200px
+   }
+   .buttonbar{
+   	position:absolute;
+   	top:40px;
+   	left:10px;
+   }
+   .guiList1_text{
+   	position:absolute;
+   	top:10px;
+   	left:10px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .guiList2{
+   	position:absolute;
+   	top:40px;
+   	left:400px;
+   	width:200px
+   }
+   .all{
+   	position:absolute;
+   	top:38px;
+   	left:610px;
+   }
+   .guiList2_header{
+   	position:absolute;
+   	top:10px;
+   	left:400px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .myElements{
+   	position:absolute;
+   	top:70px;
+   	left:400px;
+   }
+   .myTable{
+   	border: 1px solid;
+      font-size: 11px;
+   }
+   .myForm{
+   	position:absolute;
+   	top:70px;
+   	left:10px;
+   }
+   .textfield{
+      width:277px
+   }
+   .textfield_small{
+      width:150px
+   }
+   .on{
+      color: #0066cc;
+   }
+   -->
+</style>
+
+<script type="text/javascript">
+<!--
+   function windowSize() {
+      window.resizeTo(800,500)
+      window.moveTo(130,200)
+   }
+
+   function windowQuit() {
+      window.close()
+   }
+// -->
+</script>
+
+   </head>
+   <body onload='windowSize()'>
+
+<?php
+   echo "      <form name='editMetaData' action='".$PHP_SELF."?".SID."' method='get'>\n";
+
+   $layer_id   = $_REQUEST["layer_id"];
+   
+   if ( isset($_REQUEST["function"] ) ) {
+      $function = $_REQUEST["function"];
+      
+      if ( $function = "update" ) {
+         $sql = "UPDATE layer SET layer_meta_datum = '".$_REQUEST["layer_meta_datum"]."'";
+         $sql.= ", layer_meta_lieferant       = '".$_REQUEST["layer_meta_lieferant"]."'";
+         $sql.= ", layer_meta_quelle          = '".$_REQUEST["layer_meta_quelle"]."'";
+         $sql.= ", layer_meta_ansprechpartner = '".$_REQUEST["layer_meta_ansprechpartner"]."'";
+         $sql.= ", layer_meta_lieferant_basis = '".$_REQUEST["layer_meta_lieferant_basis"]."'";
+         $sql.= ", layer_meta_copyright       = '".$_REQUEST["layer_meta_copyright"]."'";
+         $sql.= " WHERE layer_id = ".$layer_id.";";
+         $res = db_query($sql);
+      }
+   }
+   
+   $sql = "SELECT * FROM layer WHERE layer_id = '".$layer_id."';";
+   $res = db_query($sql);
+   
+   if ( db_fetch_row($res, 0) ) { 	
+   	  echo "         <h3>Editieren von Metadaten</h3>\n";  
+      echo "         <table class='myTable' border='1' cellpadding='2'>\n";
+      echo "            <tr>\n";
+      echo "               <td >Aktualisierungsdatum</td>\n";
+      echo "               <td><input name='layer_meta_datum' type='text' size='100' value='".db_result($res, 0, "layer_meta_datum")."'></td>\n";
+      echo "            </tr>\n";
+      echo "            <tr>\n";
+      echo "               <td>Datenlieferant</td>\n";
+      echo "               <td><input name='layer_meta_lieferant' type='text' size='100' value='".db_result($res, 0, "layer_meta_lieferant")."'></td>\n";
+      echo "            </tr>\n";
+      echo "            <tr>\n";
+      echo "               <td>Datenquelle</td>\n";
+      echo "               <td><input name='layer_meta_quelle' type='text' size='100' value='".db_result($res, 0, "layer_meta_quelle")."'></td>\n";
+      echo "            </tr>\n";
+      echo "            <tr>\n";
+      echo "               <td>Ansprechpartner</td>\n";
+      echo "               <td><input name='layer_meta_ansprechpartner' type='text' size='100' value='".db_result($res, 0, "layer_meta_ansprechpartner")."'></td>\n";
+      echo "            </tr>\n";
+      echo "            <tr>\n";
+      echo "               <td>Datenlieferant (Basisdaten)</td>\n";
+      echo "               <td><input name='layer_meta_lieferant_basis' type='text' size='100' value='".db_result($res, 0, "layer_meta_lieferant_basis")."'></td>\n";
+      echo "            </tr>\n";
+      echo "            <tr>\n";
+      echo "               <td>Copyright</td>\n";
+      echo "               <td><input name='layer_meta_copyright' type='text' size='100' value='".db_result($res, 0, "layer_meta_copyright")."'></td>\n";
+      echo "            </tr>\n";
+      echo "         </table>\n";
+   }
+   echo "         <p></p>\n";
+   echo "         <input type='submit' name='function' value='update'>\n";
+   echo "         <input type='button' onclick='windowQuit()' value='   exit   '>\n";
+   echo "         <input type='hidden' name='layer_id' value='".$layer_id."'>\n";
+?>
+      </form>
+   </body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editSelf.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editSelf.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editSelf.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,320 @@
+<?php
+# $Id: mod_editSelf.php,v 1.10 2006/03/09 11:29:42 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editSelf.php,v 1.10 2006/03/09 11:29:42 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+require_once("../php/mb_validateSession.php");
+import_request_variables("PG");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit User Settings</title>
+<style type="text/css">
+  	<!--
+  	body{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+  	a:link{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		text-decoration : none;
+  		color: #808080;
+  	}
+  	a:visited {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	a:active {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	-->
+</style>
+<?php
+$myPW = "**********";
+echo "<script language='JavaScript'>var myPW = '".$myPW."';</script>";
+?>
+<script language="JavaScript">
+
+function validate(val){
+   var ok = validateInput();
+   if(ok == 'true'){
+     var permission = false;
+     if(val == 'save'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'update'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'delete'){
+        permission = confirm("Delete User?");
+     }
+     if(permission == true){
+        if(document.forms[0].passw.value == myPW){
+            document.forms[0].passw.value = '';
+        }
+        document.forms[0].action.value = val;
+        document.forms[0].submit();
+     }
+   }
+}
+function validateInput(){
+  var str_alert = "Input incorrect !";
+  if(document.forms[0].name.value == ''){
+      alert(str_alert);
+      document.forms[0].name.focus();
+      return 'false';
+  }
+  if(document.forms[0].passw.value == ''){
+      alert(str_alert);
+      document.forms[0].passw.focus();
+      return 'false';
+  }
+  if((document.forms[0].passw.value != myPW || document.forms[0].v_password.value != '' )&& document.forms[0].passw.value != document.forms[0].v_password.value){
+      alert("Password verification failed. You have to enter the same password twice!");
+      document.forms[0].passw.value = myPW;
+      document.forms[0].passw.focus();
+      return 'false';
+  }
+  if(document.forms[0].resolution.value == ''){
+      document.forms[0].resolution.value = 72;
+      return 'true';
+  }
+  if(document.forms[0].login_count.value == ''){
+      document.forms[0].login_count.value = 0;
+      return 'true';
+  }
+  return 'true';
+}
+
+</script>
+
+</head>
+<body>
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+#delete
+if($action == 'delete'){
+   $sql = "DELETE FROM mb_user WHERE mb_user_id = " . $selected_user;
+   $res = db_query($sql);
+   session_destroy();
+   echo "You have deleted your account.<br><br>";
+   die();
+
+}
+
+#save
+if($action == 'save'){
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "Insert INTO mb_user (mb_user_name, mb_user_password,mb_user_owner, mb_user_description, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution) VALUES ";
+     $sql.= "('".$name."', password('".$password."'),".$owner_id.",'".$description."', '".$email."', '".$phone."', '".$department."', ".$resolution.");";
+     $res = db_query($sql);
+     $selected_user = db_insert_id();
+   }
+}
+
+#update
+if($action == 'update'){
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' AND mb_user_id <> ".$selected_user;
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "UPDATE mb_user SET mb_user_name ='".$name."'";
+     if($password != ""){
+        $sql.=", mb_user_password = password('".$password."')";
+     }
+     $sql.=", mb_user_description = '".$description."'";
+     $sql.=", mb_user_login_count = '".$login_count."'";
+     $sql.=", mb_user_email = '".$email."'";
+     $sql.=", mb_user_phone = '".$phone."'";
+     $sql.=", mb_user_department = '".$department."'";
+     $sql.=", mb_user_resolution = ".$resolution;
+     $sql.=" where mb_user_id = " . $selected_user;
+     $res = db_query($sql);
+		if($password && $res){
+			echo "<script language='JavaScript'>alert('Password has been updated successfully!');</script>";
+		}
+   }
+}
+if (!isset($name) || $selected_user == 'new'){
+  $name = "";
+  $password = "";
+  $owner_id = $_SESSION["mb_user_id"];
+  $owner_name = $_SESSION["mb_user_name"];
+  $description = "";
+  $login_count = 0;
+  $email = "";
+  $phone = "";
+  $department = "";
+  $resolution = 72;
+}
+
+$selected_user = $_SESSION["mb_user_id"];
+
+/*HTML*****************************************************************************************************/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<input type='hidden' name='selected_user' value='" . $_SESSION["mb_user_id"] . "'>";
+echo "<table border='0'>";
+
+if(isset($selected_user) && $selected_user != 0){
+   $sql = "SELECT * FROM mb_user WHERE mb_user_id = '".$_SESSION["mb_user_id"]."'";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      $name = db_result($res,0,"mb_user_name");
+      $password = db_result($res,0,"mb_user_password");
+      $owner_id = db_result($res,0,"mb_user_owner");
+      $description = db_result($res,0,"mb_user_description");
+      $login_count = db_result($res,0,"mb_user_login_count");
+      $email = db_result($res,0,"mb_user_email");
+      $phone = db_result($res,0,"mb_user_phone");
+      $department = db_result($res,0,"mb_user_department");
+      $resolution = db_result($res,0,"mb_user_resolution");
+	   $owner_name = $_SESSION["mb_user_id"];
+   	$edit = true;
+   }
+   else {
+   	$edit = false;
+	echo "You're not allowed to change the settings!";
+   }
+}
+
+if ($edit) {
+#name
+echo "<tr>";
+   echo "<td>Name:</td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='name' value='".$name."'>";
+   echo "</td>";
+echo "</tr>";
+
+#password
+echo "<tr>";
+   echo "<td>Password: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='passw' value='";
+      if(isset($selected_user) && $selected_user != 'new'){
+         echo $myPW;
+      }
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+#confirm password
+echo "<tr>";
+   echo "<td>Confirm password: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='v_password' value='";
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+#owner
+echo "<tr>";
+   echo "<td>Owner: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='owner_name' value='".$owner_name."' readonly>";
+      echo "<input type='hidden' size='30' name='owner_id' value='".$owner_id."' readonly>";
+   echo "</td>";
+echo "</tr>";
+
+#description
+echo "<tr>";
+   echo "<td>Description: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='description' value='".$description."'>";
+   echo "</td>";
+echo "</tr>";
+
+
+#login_count
+echo "<tr>";
+   echo "<td>Login_count: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='login_count' value='".$login_count."'>";
+   echo "</td>";
+echo "</tr>";
+
+#email
+echo "<tr>";
+   echo "<td>Email: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='email' value='".$email."'>";
+   echo "</td>";
+echo "</tr>";
+
+#phone
+echo "<tr>";
+   echo "<td>Phone: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='phone' value='".$phone."'>";
+   echo "</td>";
+echo "</tr>";
+
+#department
+echo "<tr>";
+   echo "<td>Department: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='department' value='".$department."'>";
+   echo "</td>";
+echo "</tr>";
+
+#resolution
+echo "<tr>";
+   echo "<td>Resolution: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='resolution' value='".$resolution."'>";
+   echo "</td>";
+echo "</tr>";
+echo"</table>";
+if($selected_user == 'new' || !isset($selected_user)){
+   echo "<input type='button' value='save'  onclick='validate(\"save\")'>";
+}
+if($_SESSION["mb_user_id"] == $owner_id && $selected_user != '' ){
+   echo "<input type='button' value='save'  onclick='validate(\"update\")'>";
+   echo "<input type='button' value='delete'  onclick='validate(\"delete\")'>";
+}
+}
+?>
+<input type='hidden' name='action' value=''>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_editUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_editUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_editUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,333 @@
+<?php
+# $Id: mod_editUser.php,v 1.16 2006/03/09 10:44:20 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_editUser.php,v 1.16 2006/03/09 10:44:20 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit User</title>
+<?php
+include '../include/dyn_css.php';
+$myPW = "**********";
+echo "<script language='JavaScript'>var myPW = '".$myPW."';</script>";
+?>
+<script language="JavaScript">
+
+function validate(val){
+   var ok = validateInput();
+   if(ok == 'true'){
+     var permission = false;
+     if(val == 'save'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'update'){
+        permission = confirm("Save changes?");
+     }
+     if(val == 'delete'){
+        permission = confirm("Delete User?");
+     }
+     if(permission == true){
+        if(document.forms[0].password.value == myPW){
+            document.forms[0].password.value = '';
+        }
+        document.forms[0].action.value = val;
+        document.forms[0].submit();
+     }
+   }
+}
+function validateInput(){
+  var str_alert = "Input incorrect !";
+  if(document.forms[0].name.value == ''){
+      alert(str_alert);
+      document.forms[0].name.focus();
+      return 'false';
+  }
+  if(document.forms[0].password.value == ''){
+      alert(str_alert);
+      document.forms[0].password.focus();
+      return 'false';
+  }
+  if((document.forms[0].password.value != myPW || document.forms[0].v_password.value != '' )&& document.forms[0].password.value != document.forms[0].v_password.value){
+      alert("Password verification failed. You have to enter the same password twice!");
+      document.forms[0].password.value = myPW;
+      document.forms[0].password.focus();
+      return 'false';
+  }
+  if(document.forms[0].resolution.value == ''){
+      document.forms[0].resolution.value = 72;
+      return 'true';
+  }
+  if(document.forms[0].login_count.value == ''){
+      document.forms[0].login_count.value = 0;
+      return 'true';
+  }
+  return 'true';
+}
+
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+#delete
+if($action == 'delete'){
+   $sql = "DELETE FROM mb_user WHERE mb_user_id = " . $selected_user;
+   $res = db_query($sql);
+   $selected_user = 'new';
+}
+
+#save
+if($action == 'save'){
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' ";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "Insert INTO mb_user (mb_user_name, mb_user_password,mb_user_owner, mb_user_description, mb_user_email, mb_user_phone, mb_user_department, mb_user_resolution) VALUES ";
+     $sql .= "('".$name."', ";
+     
+	if(SYS_DBTYPE == "mysql") {
+		$sql .= "password('".$password."')";
+	}
+	else {
+		if (MD5 == 'false'){
+			$sql .= "'".$password."'";
+		}else{
+			$sql .= "md5('".$password."')";
+		}
+	}
+	$sql.= ",".$owner_id.",'".$description."', '".$email."', '".$phone."', '".$department."', ".$resolution.");";
+     $res = db_query($sql);
+     $selected_user = db_insert_id($res,"mb_user","mb_user_id");
+   }
+}
+
+#update
+if($action == 'update'){
+   $sql = "SELECT mb_user_id FROM mb_user WHERE mb_user_name = '".$name."' AND mb_user_id <> ".$selected_user;
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<script language='JavaScript'>alert('Username must be unique!');</script>";
+   }
+   else{
+     $sql = "UPDATE mb_user SET mb_user_name ='".$name."'";
+     if($password != ""){
+        $sql.=", mb_user_password = ";
+
+	     if (SYS_DBTYPE=="mysql"){
+	     	$sql.= "password('".$password."')";
+	     }else{
+			if (MD5 == 'false'){
+				$sql .= "'".$password."'";
+			}else{
+				$sql .= "md5('".$password."')";
+			}
+	     }
+	}
+     $sql.=", mb_user_description = '".$description."'";
+     $sql.=", mb_user_login_count = '".$login_count."'";
+     $sql.=", mb_user_email = '".$email."'";
+     $sql.=", mb_user_phone = '".$phone."'";
+     $sql.=", mb_user_department = '".$department."'";
+     $sql.=", mb_user_resolution = ".$resolution;
+     $sql.=" where mb_user_id = " . $selected_user;
+     $res = db_query($sql);
+		if($password && $res){
+			echo "<script language='JavaScript'>alert('Password has been updated successfully!');</script>";
+		}
+   }
+}
+if (!isset($name) || $selected_user == 'new'){
+  $name = "";
+  $password = "";
+  $owner_id = $_SESSION["mb_user_id"];
+  $owner_name = $_SESSION["mb_user_name"];
+  $description = "";
+  $login_count = 0;
+  $email = "";
+  $phone = "";
+  $department = "";
+  $resolution = 72;
+}
+
+
+/*HTML*****************************************************************************************************/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<table border='0'>";
+#User
+echo "<tr>";
+   echo "<td>";
+      echo "User: ";
+   echo "</td>";
+echo "<td>";
+   echo "<select name='selected_user' onchange='submit()'>";
+   echo "<option value='new'>NEW...</option>";
+   $sql = "SELECT mb_user_name,mb_user_id FROM mb_user ";
+   if(isset($myUser)){ $sql .= "WHERE mb_user_owner = ".$_SESSION["mb_user_id"];}
+   $sql .= " ORDER BY mb_user_name ";
+   $res = db_query($sql);
+   $count=0;
+   while($row = db_fetch_array($res)){
+	 	echo "<option value='".$row["mb_user_id"]."' ";
+		if($selected_user && $selected_user == $row["mb_user_id"]){
+         echo "selected";
+      }
+      echo ">".$row["mb_user_name"]."</option>";
+		$count++;
+   }
+   echo "</select>";
+   echo "</td>";
+echo "</tr>";
+
+
+if(isset($selected_user) && $selected_user != 0){
+   $sql = "SELECT * FROM mb_user WHERE mb_user_id = ".$selected_user." ORDER BY mb_user_name ";
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $name = $row["mb_user_name"];
+      $password = $row["mb_user_password"];
+      $owner_id = $row["mb_user_owner"];
+      $description = $row["mb_user_description"];
+      $login_count = $row["mb_user_login_count"];
+      $email = $row["mb_user_email"];
+      $phone = $row["mb_user_phone"];
+      $department = $row["mb_user_department"];
+      $resolution = $row["mb_user_resolution"];
+   }
+   $sql = "SELECT mb_user_name FROM mb_user WHERE mb_user_id = " . $owner_id;
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      $owner_name = $row["mb_user_name"];
+   }
+}
+#name
+echo "<tr>";
+   echo "<td>Name:</td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='name' value='".$name."'>";
+   echo "</td>";
+echo "</tr>";
+
+#password
+echo "<tr>";
+   echo "<td>Password: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='password' value='";
+      if(isset($selected_user) && $selected_user != 'new'){
+         echo $myPW;
+      }
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+#confirm password
+echo "<tr>";
+   echo "<td>Confirm password: </td>";
+   echo "<td>";
+      echo "<input type='password' size='30' name='v_password' value='";
+      echo "'>";
+   echo "</td>";
+echo "</tr>";
+
+#owner
+echo "<tr>";
+   echo "<td>Owner: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='owner_name' value='".$owner_name."' readonly>";
+      echo "<input type='hidden' size='30' name='owner_id' value='".$owner_id."' readonly>";
+   echo "</td>";
+echo "</tr>";
+
+#description
+echo "<tr>";
+   echo "<td>Description: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='description' value='".$description."'>";
+   echo "</td>";
+echo "</tr>";
+
+
+#login_count
+echo "<tr>";
+   echo "<td>Login_count: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='login_count' value='".$login_count."'>";
+   echo "</td>";
+echo "</tr>";
+
+#email
+echo "<tr>";
+   echo "<td>Email: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='email' value='".$email."'>";
+   echo "</td>";
+echo "</tr>";
+
+#phone
+echo "<tr>";
+   echo "<td>Phone: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='phone' value='".$phone."'>";
+   echo "</td>";
+echo "</tr>";
+
+#department
+echo "<tr>";
+   echo "<td>Department: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='department' value='".$department."'>";
+   echo "</td>";
+echo "</tr>";
+
+#resolution
+echo "<tr>";
+   echo "<td>Resolution: </td>";
+   echo "<td>";
+      echo "<input type='text' size='30' name='resolution' value='".$resolution."'>";
+   echo "</td>";
+echo "</tr>";
+echo"</table>";
+if($selected_user == 'new' || !isset($selected_user)){
+   echo "<input type='button' value='save'  onclick='validate(\"save\")'>";
+}
+if($_SESSION["mb_user_id"] == $owner_id && $selected_user != 'new' && $selected_user != '' ){
+   echo "<input type='button' value='save'  onclick='validate(\"update\")'>";
+   echo "<input type='button' value='delete'  onclick='validate(\"delete\")'>";
+}
+?>
+<input type='hidden' name='action' value=''>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_edit_element_vars.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_edit_element_vars.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_edit_element_vars.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,327 @@
+<?php
+# $Id: mod_edit_element_vars.php,v 1.12 2006/03/09 10:51:13 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_edit_element_vars.php,v 1.12 2006/03/09 10:51:13 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+include("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Element Vars</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+   <!--
+   body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+   .guiList1{
+   	position:absolute;
+   	top:30px;
+   	left:10px;
+   	width:200px
+   }
+   .buttonbar{
+   	position:absolute;
+   	top:40px;
+   	left:10px;
+   }
+   .guiList1_text{
+   	position:absolute;
+   	top:10px;
+   	left:10px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .guiList2{
+   	position:absolute;
+   	top:40px;
+   	left:400px;
+   	width:200px
+   }
+   .all{
+   	position:absolute;
+   	top:38px;
+   	left:610px;
+   }
+   .guiList2_header{
+   	position:absolute;
+   	top:10px;
+   	left:400px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .myElements{
+   	position:absolute;
+   	top:70px;
+   	left:400px;
+   }
+   .myTable{
+   	border: 1px solid;
+      font-size: 11px;
+   }
+   .myForm{
+   	position:absolute;
+   	top:70px;
+   	left:10px;
+   }
+   .textfield{
+      width:277px
+   }
+   .on{
+      color: #0066cc;
+   }
+   -->
+</style>
+<?php
+# handle database updates etc.....
+if(isset($mySave) && $mySave == '1'){
+   if($SYS_DBTYPE=='pgsql'){
+   $sql[0] = "SET AUTOCOMMIT=1;";}
+   else{
+   $sql[0] = "SET AUTOCOMMIT=0;shit happens";
+   }
+   $sql[1] = "BEGIN;";
+   $sql[2] = "DELETE FROM gui_element_vars WHERE fkey_e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."' and ....";
+
+
+   if($e_left < 1){$e_left = "NULL";}
+   if($e_top < 1){$e_top = "NULL";}
+   if($e_width < 1){$e_width = "NULL";}
+   if($e_height < 1){$e_height = "NULL";}
+   if($e_z_index < 1){$e_z_index = "NULL";}
+   $sql[3] = "INSERT INTO gui_element_vars(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires) ";
+   $sql[3] .= "VALUES ('".$guiList1."','".$e_id."','".$e_pos."','".$e_public."','".db_escape_string($e_comment)."','".$e_element."','".$e_src."','".db_escape_string($e_attributes)."',".$e_left.",".$e_top.",".$e_width.",".$e_height.",".$e_z_index.",'".$e_more_styles."','".$e_content."','".$e_closetag."','".$e_js_file."','".$e_mb_mod."','".$e_target."','".$e_requires."')";
+   #echo $sql[3];
+   foreach ($sql as $mysql){
+      $res = db_query($mysql);
+      if(!$res){echo $mysql; break;}
+   }
+   if($res){
+		$res = db_query( "COMMIT");
+      $res = db_query( "SET AUTOCOMMIT=1");
+   }
+   else{
+      $res = db_query( "ROLLBACK");
+      $res = db_query( "SET AUTOCOMMIT=1");
+   }
+ }
+if(isset($myDelete) && $myDelete == '1'){
+   $sql = "DELETE FROM gui_element_vars WHERE fkey_e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."' AND var_name='".$var_name."'";
+   $res = db_query($sql);
+   $e_id = ""; $e_pos = ""; $e_public = ""; $e_comment = ""; $e_element = "";
+   $e_src = ""; $e_attributes = ""; $e_left = ""; $e_top = ""; $e_width = ""; $e_height = ""; $e_z_index = "";
+   $e_more_styles = ""; $e_content = ""; $e_closetag = ""; $e_js_file = ""; $e_mb_mod = ""; $e_target = ""; $e_requires = "";
+}
+if(isset($myShow) && $myShow == '1'){
+   $_SESSION["mb_user_myGui"] = $guiList1;
+   echo "<script language='javascript'>";
+   echo "window.open('../frames/login.php?".strip_tags (SID)."&mb_user_myGui=".$guiList1."','','');";
+   echo "</script>";
+}
+if(isset($all) && $all == '1'){
+   $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$guiList2."' AND fkey_e_id = '".$e_id."' and var_name='".$var_name."' ;";
+   $res = db_query($sql);
+   $cnt = 0;
+   while(db_fetch_row($res)){
+      $sql_del = "DELETE FROM gui_element_vars WHERE fkey_gui_id = '".$guiList1."' AND fkey_e_id = '".db_result($res,$cnt,"fkey_e_id")."'  and var_name='".$var_name."' ";
+      $res_del = db_query($sql_del);
+      if(db_result($res,$cnt,"e_left") == ""){$myleft = 'NULL';} else{$myleft = db_result($res,$cnt,"e_left");}
+      if(db_result($res,$cnt,"e_top") == ""){$mytop = 'NULL';} else{$mytop = db_result($res,$cnt,"e_top");}
+      if(db_result($res,$cnt,"e_width") == ""){$mywidth = 'NULL';} else{$mywidth = db_result($res,$cnt,"e_width");}
+      if(db_result($res,$cnt,"e_height") == ""){$myheight = 'NULL';} else{$myheight = db_result($res,$cnt,"e_height");}
+      if(db_result($res,$cnt,"e_z_index") == ""){$my_z_index = 'NULL';} else{$my_z_index = db_result($res,$cnt,"e_z_index");}
+
+      $sql_ins = "INSERT INTO gui_element_vars(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires) ";
+      $sql_ins .= "VALUES ('".$guiList1."','".db_result($res,$cnt,"e_id")."','".db_result($res,$cnt,"e_pos")."','".db_result($res,$cnt,"e_public")."','".db_escape_string(db_result($res,$cnt,"e_comment"))."','".db_result($res,$cnt,"e_element")."','".db_result($res,$cnt,"e_src")."','".db_escape_string(db_result($res,$cnt,"e_attributes"))."',".$myleft.",";
+      $sql_ins .= $mytop.",".$mywidth.",".$myheight.",".$my_z_index.",'".db_result($res,$cnt,"e_more_styles")."','".db_escape_string(db_result($res,$cnt,"e_content"))."','".db_result($res,$cnt,"e_closetag")."','".db_result($res,$cnt,"e_js_file")."','".db_result($res,$cnt,"e_mb_mod")."','".db_result($res,$cnt,"e_target")."','".db_result($res,$cnt,"e_requires")."')";
+
+      $res_ins = db_query($sql_ins);
+      if(!$res_ins){echo db_error($connect); }
+      $cnt++;
+   }
+}
+# end
+echo "<script language='javascript'>";
+echo "var varIDs = new Array();";
+if(isset($guiList1)){
+   $sql = "SELECT var_name FROM gui_element_vars WHERE  fkey_gui_id = '".$guiList1."' AND fkey_e_id = '".$e_id."'";
+   $res = db_query($sql);
+   $cnt = 0;
+   while(db_fetch_row($res)){
+      echo  "varIDs[".$cnt."] = '".db_result($res,$cnt,"var_name")."'; ";
+      $cnt++;
+   }
+}
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function setGui(val){
+   document.form1.guiList1.value = val;
+   document.form1.submit();
+}
+function clearRadio(){
+   for(var i=0; i< document.form1.elements.length; i++){
+      if(document.form1.elements[i].type == "radio"){
+         document.form1.elements[i].checked = false;
+      }
+   }
+}
+function thisSave(){
+   if(document.form1.e_id.value == ""){
+      alert("ID ? ");
+      document.form1.e_id.focus();
+      return;
+   }
+   var permission = false;
+   var isElement = false;
+   for(var i=0; i<varIDs.length; i++){
+      clearRadio();
+      if(document.form1.var_name.value == varIDs[i]){
+         permission = confirm("update: " + document.form1.var_name.value + " ?");
+         isElement = true;
+         break;
+      }
+   }
+   if(permission == true || isElement == false){
+      document.form1.mySave.value = 1;
+      document.form1.submit();
+   }
+}
+function thisDelete(){
+   clearRadio();
+   var permission =  confirm("delete: " + document.form1.e_id.value + " ?");
+   if(permission == true){
+      document.form1.myDelete.value = 1;
+      document.form1.submit();
+   }
+}
+function thisShow(){
+   document.form1.myShow.value = 1;
+   document.form1.submit();
+}
+function addAll(){
+   var permission =  confirm("add all elements ?");
+   if(permission == true){
+      clearRadio();
+      document.form1.all.value = 1;
+      document.form1.submit();
+   }
+}
+function thisExport(){
+
+   window.open("mod_exportElement.php?element=" + document.forms[0].e_id.value+ "&gui=" +document.forms[0].guiList1.value ,"","");
+}
+// -->
+</script>
+</head>
+<body>
+
+<?php
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='get'>";
+
+#Gui to edit
+if(!isset($guiList1)){
+  echo "<div class= 'guiList1_text'>GUI:</div>";
+  echo "<select class='guiList1' size='20' name='guiList1' onchange='setGui(this.value)'>";
+  for ($i=0; $i<$count;$i++){
+     echo "<option value='".$gui_id[$i]."' ";
+     if($guiList1 && $guiList1 == $gui_id[$i]){
+        echo "selected";
+     }
+     echo ">".$gui_name[$i]."</option>";
+  }
+  echo "</select>";
+ // echo "<input type='hidden'  name='guiList2' value='' >";
+}
+else{
+   echo "<div class= 'guiList1_text'>Edit Elements: ".$guiList1."</div>";
+   echo "<div class='buttonbar'>";
+   echo "<input type='button' class='' name='' value='save' onclick='thisSave()'> ";
+   echo "<input type='button' class='' name='' value='delete' onclick='thisDelete()'> ";
+   echo "<input type='button' class='' name='' value='show' onclick='thisShow()'> ";
+   echo "<input type='button' class='' name='' value='sql' onclick='thisExport()'> ";
+   echo "</div>";
+   echo "<input type='hidden'  name='guiList1' value='".$guiList1."' >";
+   echo "<input type='hidden'  name='e_id' value='".$e_id."' >";
+}
+#Elements
+if(isset($guiList1)){
+   echo "<div class='guiList2_header'>Templates</div>";
+
+   $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$guiList1."' AND fkey_e_id='".$e_id."'";
+   $res = db_query($sql);
+   $cnt = 0;
+   echo "<div class='myElements'><table>";
+   while($row = db_fetch_array($res)){
+      echo "<tr>";
+      echo "<td class='myTable'><input type='radio' name='var_name' value='".$row["var_name"]."' onclick='submit()' ";
+      if($row["var_name"] == $var_name){echo "checked";}
+      echo "></td><td class='myTable'>";
+      //if(db_result($res,$cnt,"e_public") == 1){echo "<div class='on'>on</div>";}
+      echo "</td><td class='myTable'>". $row["var_name"]. "</td><td class='myTable'>" .$row["context"]."</td>";
+      echo "</tr>";
+      $cnt++;
+   }
+   echo "</table></div>";
+}
+#Formular:
+echo "<table class='myForm'>";
+if(isset($guiList1) && isset($var_name)){
+   $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$guiList1."' AND fkey_e_id = '".$e_id."' AND var_name='".$var_name."'";
+   //echo $sql;
+   $res = db_query($sql);
+   if($row = db_fetch_array($res)){
+      echo "<tr><td>ID: </td><td><input type='text' class='textfield' readonly name='e_id' value='".$e_id."'></td></tr>";
+      echo "<tr><td>Var Type: </td><td><input type='text' class='textfield' name='type' value='".$row["type"]."'></td></tr>";
+      echo "<tr><td>Var Name: </td><td><input type='text' class='textfield' name='var_name_edit' value='".$row["var_name"]."'></td></tr>";
+      echo "<tr><td>Content: </td><td><textarea cols='32' rows='4'  name='e_content' >".stripslashes($row["var_value"])."</textarea></td></tr>";
+
+   }
+   echo "</table>";
+}
+
+?>
+<input type='hidden' name='myDelete'>
+<input type='hidden' name='mySave'>
+<input type='hidden' name='myShow'>
+<input type='hidden' name='all'>
+
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_edit_metadata.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_edit_metadata.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_edit_metadata.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,497 @@
+<?php
+# $Id: mod_edit_metadata.php,v 1.10 2006/03/09 11:22:13 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_edit_metadata.php,v 1.10 2006/03/09 11:22:13 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+include("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Metadata</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+   <!--
+   body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+   .guiList1{
+   	position:absolute;
+   	top:30px;
+   	left:10px;
+   	width:200px
+   }
+   .buttonbar{
+   	position:absolute;
+   	top:40px;
+   	left:10px;
+   }
+   .guiList1_text{
+   	position:absolute;
+   	top:10px;
+   	left:10px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .guiList2{
+   	position:absolute;
+   	top:40px;
+   	left:400px;
+   	width:200px
+   }
+   .all{
+   	position:absolute;
+   	top:38px;
+   	left:610px;
+   }
+   .guiList2_header{
+   	position:absolute;
+   	top:10px;
+   	left:400px;
+      font-size:16px;
+      color: #0066cc;
+   }
+   .myElements{
+   	position:absolute;
+   	top:70px;
+   	left:400px;
+   }
+   .myTable{
+   	border: 1px solid;
+      font-size: 11px;
+   }
+   .myForm{
+   	position:absolute;
+   	top:70px;
+   	left:10px;
+   }
+   .textfield{
+      width:277px
+   }
+   .textfield_small{
+      width:150px
+   }
+   .on{
+      color: #0066cc;
+   }
+   -->
+</style>
+<?php
+# handle database updates etc.....
+if(isset($mySave) && ($mySave == '1' || $mySave == '2')) {
+   if ($mySave == '1'){
+   	$sql_vars = "SELECT * FROM gui_element_vars WHERE fkey_e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."'";
+   	 $res_vars = db_query($sql_vars);
+   	 //$rows = db_fetch_array($res_vars);
+   	if($SYS_DBTYPE=='pgsql')
+   		{
+	   	$sql[0] = "SET AUTOCOMMIT=1";
+	 	}
+	  else
+	 	{
+	 	$sql[0] = "SET AUTOCOMMIT=0";
+		}
+	   $sql[1] = "BEGIN";
+	   $sql[2] = "DELETE FROM gui_element WHERE e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."'";
+
+
+	   if($e_left < 1){$e_left = "NULL";}
+	   if($e_top < 1){$e_top = "NULL";}
+	   if($e_width < 1){$e_width = "NULL";}
+	   if($e_height < 1){$e_height = "NULL";}
+	   if($e_z_index < 1){$e_z_index = "NULL";}
+	   $sql[3] = "INSERT INTO gui_element(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires) ";
+	   $sql[3] .= "VALUES ('".$guiList1."','".$e_id."','".$e_pos."','".$e_public."','".db_escape_string($e_comment)."','".$e_element."','".$e_src."','".db_escape_string($e_attributes)."',".$e_left.",".$e_top.",".$e_width.",".$e_height.",".$e_z_index.",'".$e_more_styles."','".db_escape_string($e_content)."','".$e_closetag."','".$e_js_file."','".$e_mb_mod."','".$e_target."','".$e_requires."')";
+
+   }
+   # mySave == 2 <=> just save GUI description
+   elseif ($mySave == '2') {
+	   if($SYS_DBTYPE=='pgsql')
+   		{
+	   	$sql[0] = "SET AUTOCOMMIT=1";
+	 	}
+	  else
+	 	{
+	 	$sql[0] = "SET AUTOCOMMIT=0";
+		}
+	   $sql[1] = "BEGIN";
+	   $sql[3] = "UPDATE gui SET gui_description = '". $guiDesc."' WHERE gui_id ='".$guiId."'";
+   }
+   foreach ($sql as $mysql){
+      $res = db_query($mysql);
+      if(!$res){break;}
+   }
+   if($res){
+		$res = db_query( "COMMIT");
+      $res = db_query( "SET AUTOCOMMIT=1");
+   }
+   else{
+      $res = db_query( "ROLLBACK");
+      $res = db_query( "SET AUTOCOMMIT=1");
+   }
+   if(isset($sql_vars)){//sicherstellen das keine Element_Vars gelöscht wurden
+   	 while($row =  db_fetch_array($res_vars)){
+     			$securesql = "INSERT INTO gui_element_vars (fkey_gui_id,fkey_e_id,var_name,var_value,context,type) VALUES ('".$guiList1."','".$e_id."','".$row["var_name"]."','".$row["var_value"]."','".$row["context"]."','".$row["type"]."');";
+     			//echo $securesql."<BR>";
+     			$secureinsert = db_query($securesql);
+     		}
+   }
+      if(!$res){break;}
+
+}
+if(isset($myDelete) && $myDelete == '1'){
+   $sql = "DELETE FROM gui_element WHERE e_id = '".$e_id."' AND fkey_gui_id = '".$guiList1."'";
+   $res = db_query($sql);
+   $e_id = ""; $e_pos = ""; $e_public = ""; $e_comment = ""; $e_element = "";
+   $e_src = ""; $e_attributes = ""; $e_left = ""; $e_top = ""; $e_width = ""; $e_height = ""; $e_z_index = "";
+   $e_more_styles = ""; $e_content = ""; $e_closetag = ""; $e_js_file = ""; $e_mb_mod = ""; $e_target = ""; $e_requires = "";
+}
+if(isset($myShow) && $myShow == '1'){
+   $_SESSION["mb_user_myGui"] = $guiList1;
+   echo "<script language='javascript'>";
+   echo "window.open('../frames/login.php?".strip_tags (SID)."&mb_user_myGui=".$guiList1."','','');";
+   echo "</script>";
+}
+if(isset($all) && $all == '1'){
+   $sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$guiList2."'";
+   $res = db_query($sql);
+   $cnt = 0;
+   while(db_fetch_row($res)){
+      $sql_del = "DELETE FROM gui_element WHERE fkey_gui_id = '".$guiList1."' AND e_id = '".db_result($res,$cnt,"e_id")."'";
+      $res_del = db_query($sql_del);
+      if(db_result($res,$cnt,"e_left") == ""){$myleft = 'NULL';} else{$myleft = db_result($res,$cnt,"e_left");}
+      if(db_result($res,$cnt,"e_top") == ""){$mytop = 'NULL';} else{$mytop = db_result($res,$cnt,"e_top");}
+      if(db_result($res,$cnt,"e_width") == ""){$mywidth = 'NULL';} else{$mywidth = db_result($res,$cnt,"e_width");}
+      if(db_result($res,$cnt,"e_height") == ""){$myheight = 'NULL';} else{$myheight = db_result($res,$cnt,"e_height");}
+      if(db_result($res,$cnt,"e_z_index") == ""){$my_z_index = 'NULL';} else{$my_z_index = db_result($res,$cnt,"e_z_index");}
+
+      $sql_ins = "INSERT INTO gui_element(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,e_closetag,e_js_file,e_mb_mod,e_target,e_requires) ";
+      $sql_ins .= "VALUES ('".$guiList1."','".db_result($res,$cnt,"e_id")."','".db_result($res,$cnt,"e_pos")."','".db_result($res,$cnt,"e_public")."','".db_escape_string(db_result($res,$cnt,"e_comment"))."','".db_result($res,$cnt,"e_element")."','".db_result($res,$cnt,"e_src")."','".db_escape_string(db_result($res,$cnt,"e_attributes"))."',".$myleft.",";
+      $sql_ins .= $mytop.",".$mywidth.",".$myheight.",".$my_z_index.",'".db_result($res,$cnt,"e_more_styles")."','".db_escape_string(db_result($res,$cnt,"e_content"))."','".db_result($res,$cnt,"e_closetag")."','".db_result($res,$cnt,"e_js_file")."','".db_result($res,$cnt,"e_mb_mod")."','".db_result($res,$cnt,"e_target")."','".db_result($res,$cnt,"e_requires")."')";
+
+      $res_ins = db_query($sql_ins);
+      if(!$res_ins){echo db_error($con); }
+      $cnt++;
+   }
+   $sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$guiList2."'";
+      $res = db_query($sql);
+   	$cnt = 0;
+       while(db_fetch_row($res)){
+      $sql_ins2 = "INSERT INTO gui_element_vars(fkey_gui_id,fkey_e_id,var_name,var_value,context,type) ";
+      $sql_ins2 .= "VALUES ('".$guiList1."','".db_result($res,$cnt,"fkey_e_id")."','".db_result($res,$cnt,"var_name")."','".db_escape_string(db_result($res,$cnt,"var_value"))."','".db_escape_string(db_result($res,$cnt,"context"))."','".db_result($res,$cnt,"type")."')";
+      $res_ins2 = db_query($sql_ins2);
+      if(!$res_ins2){echo db_error($connect); }
+
+      $cnt++;
+      }
+
+
+}
+# end
+echo "<script language='javascript'>";
+echo "var guiIDs = new Array();";
+if(isset($guiList1)){
+   $sql = "SELECT e_id FROM gui_element WHERE  fkey_gui_id = '".$guiList1."'";
+   $res = db_query($sql);
+   $cnt = 0;
+   while(db_fetch_row($res)){
+      echo  "guiIDs[".$cnt."] = '".db_result($res,$cnt,"e_id")."'; ";
+      $cnt++;
+   }
+}
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function setGui(val){
+   document.form1.guiList2.value = val;
+   document.form1.submit();
+}
+function clearRadio(){
+   for(var i=0; i< document.form1.elements.length; i++){
+      if(document.form1.elements[i].type == "radio"){
+         document.form1.elements[i].checked = false;
+      }
+   }
+}
+function thisSave(){
+   if(document.form1.e_id.value == ""){
+      alert("ID ? ");
+      document.form1.e_id.focus();
+      return;
+   }
+   var permission = false;
+   var isElement = false;
+   for(var i=0; i<guiIDs.length; i++){
+      clearRadio();
+      if(document.form1.e_id.value == guiIDs[i]){
+         permission = confirm("update: " + document.form1.e_id.value + " ?");
+         isElement = true;
+         break;
+      }
+   }
+   if(permission == true || isElement == false){
+      document.form1.mySave.value = 1;
+      document.form1.submit();
+   }
+}
+
+function thisDelete(){
+   clearRadio();
+   var permission =  confirm("delete: " + document.form1.e_id.value + " ?");
+   if(permission == true){
+      document.form1.myDelete.value = 1;
+      document.form1.submit();
+   }
+}
+function thisShow(){
+   document.form1.myShow.value = 1;
+   document.form1.submit();
+}
+function addAll(){
+   var permission =  confirm("add all elements ?");
+   if(permission == true){
+      clearRadio();
+      document.form1.all.value = 1;
+      document.form1.submit();
+   }
+}
+function thisExport(){
+
+   window.open("mod_exportElement.php?element=" + document.forms[0].e_id.value+ "&gui=" +document.forms[0].guiList1.value ,"","");
+}
+function editDesc(){
+	var newDesc = prompt("Enter new GUI description", document.form1.guiDesc.value);
+	if (newDesc != null) {
+		document.form1.guiDesc.value = newDesc;
+		document.form1.mySave.value = 2;
+		document.form1.submit();
+	}
+}
+
+// -->
+</script>
+</head>
+<body>
+
+<?php
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+$permguis = $admin->getGuisByPermission($_SESSION["mb_user_id"]);
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>\n";
+
+$sql = "SELECT * from gui WHERE gui.gui_id IN(";
+for($i=0; $i<count($ownguis); $i++){
+	if($i>0){ $sql .= ",";}
+	$sql .= "'".$ownguis[$i]."'";
+}
+$sql .= ")";
+//echo $sql;
+$res = db_query($sql);
+$count=0;
+while(db_fetch_row($res)){
+	$gui_id_own[$count]=db_result($res,$count,"gui_id");
+	$gui_name_own[$count]=db_result($res,$count,"gui_name");
+	$gui_description_own[$count]=db_result($res,$count,"gui_description");
+	$count++;
+}
+
+
+$sql = "SELECT * from gui WHERE gui.gui_id IN(";
+for($i=0; $i<count($permguis); $i++){
+	if($i>0){ $sql .= ",";}
+	$sql .= "'".$permguis[$i]."'";
+}
+$sql .= ")";
+$res = db_query($sql);
+$count=0;
+while($row = db_fetch_array($res)){
+	$gui_id_perm[$count]= $row["gui_id"];
+	$gui_name_perm[$count]=$row["gui_name"];
+	$gui_description_perm[$count]=$row["gui_description"];
+	$count++;
+}
+
+#Gui to edit
+if(!isset($guiList1)){
+	echo "<div class= 'guiList1_text'>GUI:</div>\n";
+	echo "<select class='guiList1' size='20' name='guiList1' onchange='setGui(this.value)'>\n";
+	for ($i=0; $i<count($gui_id_own);$i++){
+		echo "<option value='".$gui_id_own[$i]."' ";
+		if($guiList1 && $guiList1 == $gui_id_own[$i]){
+			echo "selected";
+		}
+		echo ">".$gui_name_own[$i]."</option>\n";
+	}
+	echo "</select>\n";
+
+	for ($i=0; $i<count($gui_id_own);$i++){
+		echo "<input type='hidden'  name='guiDesc_" . $gui_name_own[$i] . "' value='" . $gui_description_own[$i] . "' >\n";
+	    echo "<input type='hidden'  name='guiId_" . $gui_name_own[$i] . "' value='" . $gui_id_own[$i] . "' >\n";
+	}
+	echo "<input type='hidden'  name='guiList2' value='' >\n";
+}
+else{
+   echo "<div class= 'guiList1_text'>";
+   echo 	"Edit Elements: ".$guiList1;
+
+   // set guiDesc and guiId if guiList1 has just been selected
+   if (!$guiDesc) {
+	  $Desc = "guiDesc_" . $guiList1;
+	  $guiDesc = $$Desc;
+   }
+   if (!$guiId) {
+	  $Id = "guiId_" . $guiList1;
+	  $guiId = $$Id;
+   }
+
+   echo 	"&nbsp;&nbsp;(" . $guiDesc;
+   echo		" <input type='button' class='' name='' value='edit' onclick='editDesc()'> ) \n";
+   echo "</div>\n";
+   echo "<div class='buttonbar'>\n";
+   echo "<input type='button' class='' name='' value='save' onclick='thisSave()'> \n";
+   echo "<input type='button' class='' name='' value='delete' onclick='thisDelete()'> \n";
+   echo "<input type='button' class='' name='' value='show' onclick='thisShow()'> \n";
+   echo "<input type='button' class='' name='' value='sql' onclick='thisExport()'> \n";
+   echo "</div>\n";
+   echo "<input type='hidden'  name='guiList1' value='".$guiList1."' >\n";
+   echo "<input type='hidden'  name='guiId' value='".$guiId."' >\n";
+   echo "<input type='hidden'  name='guiDesc' value='".$guiDesc."' >\n";
+}
+#Depot
+if(isset($guiList1)){
+	echo "<select name='guiList2' class='guiList2' onchange='clearRadio();submit()'>\n";
+	echo "<option>GUI...</option>\n";
+	for ($i=0; $i<count($gui_id_perm);$i++){
+		echo "<option value='".$gui_id_perm[$i]."' ";
+		if($guiList2 && $guiList2 == $gui_id_perm[$i]){
+			echo "selected";
+		}
+		echo ">".$gui_name_perm[$i]."</option>\n";
+	}
+	echo "</select>\n";
+	if($guiList1 != $guiList2){echo "<input class='all' type='button' value='add all elements' onclick='addAll()'>\n";}
+}
+#Elements
+if(isset($guiList2)){
+	if($guiList1 == $guiList2){
+		echo "<div class='guiList2_header'>Edit Element: </div>\n";
+	}
+	else{
+		echo "<div class='guiList2_header'>Templates</div>\n";
+	}
+	$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$guiList2."' ORDER BY e_id";
+	$res = db_query($sql);
+	$cnt = 0;
+
+	echo "<div class='myElements'>\n<table>\n";
+
+	while(db_fetch_row($res)){
+		echo "<tr>\n";
+		echo "<td class='myTable'><input type='radio' name='myElement' value='".db_result($res,$cnt,"e_id")."' onclick='submit()' ";
+		if(db_result($res,$cnt,"e_id") == $myElement){echo "checked";}
+		echo "></td>\n";
+		echo "<td class='myTable'>";
+		if(db_result($res,$cnt,"e_public") == 1){echo "<div class='on'>on</div>";}
+		echo "</td>\n";
+		echo "<td class='myTable'>";
+ 		echo "<a href=\"mod_EditElementVars.php?fkey_gui_id=".$guiList2."&fkey_e_id=".db_result($res,$cnt,"e_id")."\">";
+ 		echo db_result($res,$cnt,"e_id");
+		echo "</a>\n</td>\n";
+		echo "<td class='myTable'>".db_result($res,$cnt,"e_comment")."</td>";
+		echo "</tr>\n";
+		$cnt++;
+	}
+	echo "</table>\n</div>\n";
+}
+#Formular:
+echo "<table class='myForm'>\n";
+if(isset($myElement)){
+   $sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$guiList2."' AND e_id = '".$myElement."'";
+   $res = db_query($sql);
+   if(db_fetch_row($res)){
+      echo "<tr><td>ID: </td><td><input type='text' class='textfield' name='e_id' value='".db_result($res,0,"e_id")."'></td></tr>\n";
+      echo "<tr><td>Position: </td><td><input type='text' class='textfield' name='e_pos' value='".db_result($res,0,"e_pos")."'></td></tr>\n";
+      echo "<tr><td>ON/OFF: </td><td><input type='text' class='textfield' name='e_public' value='".db_result($res,0,"e_public")."'></td></tr>\n";
+      echo "<tr><td>Comment: </td><td><textarea cols='32' rows='5'  name='e_comment' >".stripslashes(db_result($res,0,"e_comment"))."</textarea></td></tr>\n";
+      echo "<tr><td>HTML-TAG: </td><td><input type='text' class='textfield' name='e_element' value='".db_result($res,0,"e_element")."'></td></tr>\n";
+      echo "<tr><td>SRC: </td><td><input type='text' class='textfield' name='e_src' value='".db_result($res,0,"e_src")."'></td></tr>\n";
+      echo "<tr><td>Attributes: </td><td><textarea cols='32' rows='5'  name='e_attributes' >".stripslashes(db_result($res,0,"e_attributes"))."</textarea></td></tr>\n";
+      echo "<tr><td>Left: </td><td><input type='text' class='textfield' name='e_left' value='".db_result($res,0,"e_left")."'></td></tr>\n";
+      echo "<tr><td>Top: </td><td><input type='text' class='textfield' name='e_top' value='".db_result($res,0,"e_top")."'></td></tr>\n";
+      echo "<tr><td>Width: </td><td><input type='text' class='textfield' name='e_width' value='".db_result($res,0,"e_width")."'></td></tr>\n";
+      echo "<tr><td>Height: </td><td><input type='text' class='textfield' name='e_height' value='".db_result($res,0,"e_height")."'></td></tr>\n";
+      echo "<tr><td>Z-INDEX: </td><td><input type='text' class='textfield' name='e_z_index' value='".db_result($res,0,"e_z_index")."'></td></tr>\n";
+      echo "<tr><td>Styles: </td><td><input type='text' class='textfield' name='e_more_styles' value='".db_result($res,0,"e_more_styles")."'></td></tr>\n";
+      echo "<tr><td>Content: </td><td><textarea cols='32' rows='4'  name='e_content' >".stripslashes(db_result($res,0,"e_content"))."</textarea></td></tr>\n";
+      echo "<tr><td>Close-TAG: </td><td><input type='text' class='textfield' name='e_closetag' value='".db_result($res,0,"e_closetag")."'></td></tr>\n";
+      echo "<tr><td>JavaScript: </td><td><input type='text' class='textfield' name='e_js_file' value='".db_result($res,0,"e_js_file")."'></td></tr>\n";
+      echo "<tr><td>Modul: </td><td><input type='text' class='textfield' name='e_mb_mod' value='".db_result($res,0,"e_mb_mod")."'></td></tr>\n";
+      echo "<tr><td>Target: </td><td><input type='text' class='textfield' name='e_target' value='".db_result($res,0,"e_target")."'></td></tr>\n";
+      echo "<tr><td>Requires: </td><td><input type='text' class='textfield' name='e_requires' value='".db_result($res,0,"e_requires")."'></td></tr>\n";
+   }
+   echo "</table>";
+}
+else if(isset($guiList1)){
+      echo "<tr><td>ID: </td><td><input type='text' class='textfield' name='e_id' value='".$e_id."'></td></tr>\n";
+      echo "<tr><td>Position: </td><td><input type='text' class='textfield' name='e_pos' value='".$e_pos."'></td></tr>\n";
+      echo "<tr><td>Public: </td><td><input type='text' class='textfield' name='e_public' value='".$e_public."'></td></tr>\n";
+      echo "<tr><td>Comment: </td><td><textarea cols='32' rows='5'  name='e_comment' >".stripslashes($e_comment)."</textarea></td></tr>\n";
+      echo "<tr><td>HTML-TAG: </td><td><input type='text' class='textfield' name='e_element' value='".$e_element."'></td></tr>\n";
+      echo "<tr><td>SRC: </td><td><input type='text' class='textfield' name='e_src' value='".$e_src."'></td></tr>\n";
+      echo "<tr><td>Attributes: </td><td><textarea cols='32' rows='5'  name='e_attributes' >".stripslashes($e_attributes)."</textarea></td></tr>\n";
+      echo "<tr><td>Left: </td><td><input type='text' class='textfield' name='e_left' value='".$e_left."'></td></tr>\n";
+      echo "<tr><td>Top: </td><td><input type='text' class='textfield' name='e_top' value='".$e_top."'></td></tr>\n";
+      echo "<tr><td>Width: </td><td><input type='text' class='textfield' name='e_width' value='".$e_width."'></td></tr>\n";
+      echo "<tr><td>Height: </td><td><input type='text' class='textfield' name='e_height' value='".$e_height."'></td></tr>\n";
+      echo "<tr><td>Z-INDEX: </td><td><input type='text' class='textfield' name='e_z_index' value='".$e_z_index."'></td></tr>\n";
+      echo "<tr><td>Styles: </td><td><input type='text' class='textfield' name='e_more_styles' value='".$e_more_styles."'></td></tr>\n";
+      echo "<tr><td>Content: </td><td><textarea cols='32' rows='4'  name='e_content' >".stripslashes($e_content)."</textarea></td></tr>\n";
+      echo "<tr><td>Close-TAG: </td><td><input type='text' class='textfield' name='e_closetag' value='".$e_closetag."'></td></tr>\n";
+      echo "<tr><td>JavaScript: </td><td><input type='text' class='textfield' name='e_js_file' value='".$e_js_file."'></td></tr>\n";
+      echo "<tr><td>Modul: </td><td><input type='text' class='textfield' name='e_mb_mod' value='".$e_mb_mod."'></td></tr>\n";
+      echo "<tr><td>Target: </td><td><input type='text' class='textfield' name='e_target' value='".$e_target."'></td></tr>\n";
+      echo "<tr><td>Requires: </td><td><input type='text' class='textfield' name='e_requires' value='".$e_requires."'></td></tr>\n";
+}
+echo "</table>\n";
+?>
+<input type='hidden' name='myDelete'>
+<input type='hidden' name='mySave'>
+<input type='hidden' name='myShow'>
+<input type='hidden' name='all'>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_evalArea.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_evalArea.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_evalArea.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,142 @@
+<?php
+# $Id: mod_evalArea.php,v 1.13 2006/03/20 11:47:37 astrid_emde Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_evalArea.php,v 1.13 2006/03/20 11:47:37 astrid_emde Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import_request_variables("PG");
+include '../include/dyn_css.php';
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_administration.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Resultset</title>
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+?>
+<style type="text/css">
+	<!--
+
+	body{
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : bold;
+	}
+	.h{
+		font-style : oblique;
+	}
+	-->
+</style>
+</head>
+<body>
+<?php
+import_request_variables("PG");
+$x = $_REQUEST["x"];
+$y = $_REQUEST["y"];
+$epsg = $_REQUEST["srs"];
+$length = $_REQUEST["length"];
+$posX = explode (",", $x);
+$posY = explode (",", $y);
+
+
+if(SYS_DBTYPE=='pgsql'){
+	if(count($posX) > 3){
+	  $sql = "SELECT area2d(GeometryFromText('MULTIPOLYGON(((";
+	  for($i=0; $i<count($posX); $i++){
+	  	if($i>0){$sql .= ",";}
+	  	$sql .= $posX[$i] . " " . $posY[$i];
+	  }
+	  $sql .= ")))',".rawurldecode($epsg).")) as myArea";
+	  $res = db_query($sql);
+	  if($row = db_fetch_array($res)){
+	     echo "Fl&auml;che: ".round($row[0]*100)/100 . " m<sup>2</sup>";
+	  }
+	}
+	else{
+	   echo "Fl&auml;che: 0 m<sup>2</sup>";
+	}
+}else{
+	#echo "Flächenberechnung für MySQL liegt derzeit nicht vor<br></sup>";
+	#$con = db_connect($GEOS_DBSERVER,$GEOS_PORT,$GEOS_OWNER,$GEOS_PW);
+	#db_select_db($GEOS_DBSERVER,$con);
+	$con_string = "host=$GEOS_DBSERVER port=$GEOS_PORT dbname=$GEOS_DB user=$GEOS_OWNER password=$GEOS_PW";
+	
+	$con = pg_connect($con_string) or die ("Error while connecting database");
+	
+	
+	if(count($posX) > 3){
+	  $sql = "SELECT area2d(GeometryFromText('MULTIPOLYGON(((";
+	  $i==0;
+	  for($i=0; $i<count($posX); $i++){
+	  	if($i>0){$sql .= ",";}
+	  	$sql .= $posX[$i] . " " . $posY[$i];
+	  }
+	  $sql .= ")))',".rawurldecode($epsg).")) as myArea";
+	  $res = pg_query($con,$sql);
+	  
+	  $cnt = 0;
+	  while(pg_fetch_row($res)){
+	  	 $area = pg_fetch_result($res,$cnt,0);
+	     echo "Fl&auml;che: ".round($area*100)/100 . " m<sup>2</sup>";
+	     $cnt++;
+	  }
+	}
+	else{
+	   echo "Fl&auml;che: 0 m<sup>2</sup>";
+	}
+}
+
+echo "<br>";
+echo "Umfang: ". $length . " m";
+#Centroid(geometry)
+/*
+$sql = "SELECT Centroid(GeometryFromText('MULTIPOLYGON(((";
+for($i=0; $i<count($posX); $i++){
+	if($i>0){$sql .= ",";}
+	$sql .= $posX[$i] . " " . $posY[$i];
+}
+$sql .= ")))',".rawurldecode($epsg).")) as myCentroid";
+$res = db_query($con,$sql);
+if(db_fetch_row($res)){
+   echo "Zentrum: ".db_result($res,0,"myCentroid");
+}
+*/
+
+#box3d(geometry)
+/*
+$sql = "SELECT box3d(GeometryFromText('MULTIPOLYGON(((";
+for($i=0; $i<count($posX); $i++){
+	if($i>0){$sql .= ",";}
+	$sql .= $posX[$i] . " " . $posY[$i];
+}
+$sql .= ")))',".rawurldecode($epsg).")) as myBox";
+$res = db_query($sql);
+if(db_fetch_row($res)){
+   echo "Aussen: ".db_result($res,0,"myBox");
+}
+*/
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_exportElement.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_exportElement.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_exportElement.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,122 @@
+<?php
+# $Id: mod_exportElement.php,v 1.14 2006/03/09 10:55:27 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_exportElement.php,v 1.14 2006/03/09 10:55:27 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>exportElement</title>
+<?php
+   include '../include/dyn_css.php';
+?>
+</head>
+<body>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$insert = "";
+$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = '".$_REQUEST["gui"]."' AND e_id='".$_REQUEST["element"]."'";
+$res = db_query($sql);
+if($row = db_fetch_array($res)) {
+   $insert .=  "INSERT INTO gui_element(";
+      $insert .=  "fkey_gui_id, ";
+      $insert .=  "e_id, ";
+      $insert .=  "e_pos, ";
+      $insert .=  "e_public, ";
+      $insert .=  "e_comment, ";
+      $insert .=  "e_element, ";
+      $insert .=  "e_src, ";
+      $insert .=  "e_attributes, ";
+      $insert .=  "e_left, ";
+      $insert .=  "e_top, ";
+      $insert .=  "e_width, ";
+      $insert .=  "e_height, ";
+      $insert .=  "e_z_index, ";
+      $insert .=  "e_more_styles, ";
+      $insert .=  "e_content, ";
+      $insert .=  "e_closetag, ";
+      $insert .=  "e_js_file, ";
+      $insert .=  "e_mb_mod, ";
+      $insert .=  "e_target, ";
+      $insert .=  "e_requires";
+   $insert .=  ") VALUES(";
+      $insert .=  "'".$row["fkey_gui_id"]."', ";
+      $insert .=  "'".$row["e_id"]."', ";
+      $insert .=  "'".$row["e_pos"]. "', ";
+      $insert .=  "'".$row["e_public"]. "', ";
+      $insert .=  "'".db_escape_string($row["e_comment"])."', ";
+      $insert .=  "'".$row["e_element"]."', ";
+      $insert .=  "'".$row["e_src"]."', ";
+      $insert .=  "'".db_escape_string($row["e_attributes"])."', ";
+      $insert .=  "'".$row["e_left"]. "', ";
+      $insert .=  "'".$row["e_top"]. "', ";
+      $insert .=  "'".$row["e_width"]. "', ";
+      $insert .=  "'".$row["e_height"]. "', ";
+      $insert .=  "'".$row["e_z_index"]. "', ";
+      $insert .=  "'".$row["e_more_styles"]."', ";
+      $insert .=  "'".db_escape_string($row["e_content"])."', ";
+      $insert .=  "'".$row["e_closetag"]."', ";
+      $insert .=  "'".$row["e_js_file"]."', ";
+      $insert .=  "'".$row["e_mb_mod"]."', ";
+      $insert .=  "'".$row["e_target"]."', ";
+      $insert .=  "'".$row["e_requires"]."'";
+   $insert .=  ");\n";
+   $insert = str_replace(",,", ",NULL ,", $insert);
+}
+
+	# export element vars
+	$sql = "SELECT * FROM gui_element_vars WHERE fkey_gui_id = '".$_REQUEST["gui"]."' AND fkey_e_id='".$_REQUEST["element"]."'";
+	$res = db_query($sql);
+	$cnt_res = 0;
+	while ($row = db_fetch_array($res)){
+   	$insert .=  "INSERT INTO gui_element_vars(";
+      $insert .=  "fkey_gui_id, ";
+      $insert .=  "fkey_e_id, ";
+      $insert .=  "var_name, ";
+      $insert .=  "var_value, ";
+      $insert .=  "context, ";
+      $insert .=  "var_type";
+   	$insert .=  ") VALUES(";
+      $insert .=  "'".$row["fkey_gui_id"]."', ";
+      $insert .=  "'".$row["fkey_e_id"]."', ";
+      $insert .=  "'".$row["var_name"]. "', ";
+      $insert .=  "'".db_escape_string($row["var_value"]). "', ";
+      $insert .=  "'".db_escape_string($row["context"])."' ,";
+      $insert .=  "'".db_escape_string($row["var_type"])."'";
+   	$insert .=  ");\n";
+   	$insert = str_replace(",,", ",NULL ,", $insert);
+   	$cnt_res++;
+	}
+   #------------------
+
+   echo "<textarea rows=30 cols=100>";
+    echo str_replace(", ,", ",NULL ,", $insert);
+   echo "</textarea>";
+
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_exportGUI.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_exportGUI.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_exportGUI.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,183 @@
+<?php
+# $Id: mod_exportGUI.php,v 1.15 2006/03/09 12:12:15 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_exportGUI.php,v 1.15 2006/03/09 12:12:15 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Export GUI</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+<!--
+function validate(){
+   var ind = document.form1.guiList.selectedIndex;
+   if(ind > -1){
+	   //alert (ind);
+     var permission =  confirm("export: " + document.form1.guiList.options[ind].text + " ?");
+     if(permission == true){
+        document.form1.del.value = 1;
+        document.form1.submit();
+     }
+   }
+}
+// -->
+</script>
+</head>
+<body>
+
+<?php
+
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$permguis = $admin->getGuisByPermission($_SESSION["mb_user_id"]);
+
+ ###export
+
+if($guiList){
+	$insert = "";
+	//gui
+	$sql_gui = "SELECT * FROM gui WHERE gui_name = '".$guiList."'";
+	$res_gui = db_query($sql_gui);
+	//echo $sql_gui."<BR>";
+	
+	echo "";
+	$i = 0;
+	while ($row = db_fetch_row($res_gui)){
+		$insert =  "INSERT INTO gui (gui_id, gui_name, gui_description, gui_public) VALUES ";
+		$insert.= "('".db_result($res_gui, 0, 0)."','".db_result($res_gui, 0, 1)."','".db_result($res_gui, 0, 2)."',".db_result($res_gui, 0, 3).");\n";
+	}
+
+	//gui_element
+	$sql_gel = "SELECT * from gui_element WHERE fkey_gui_id = '".$guiList."'";
+	$res_gel = db_query($sql_gel);
+	$cnt_gel = 0;
+
+	while ($row = db_fetch_array($res_gel)){
+		$insert.="INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, e_comment, e_element,";
+		$insert.="e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles,";
+		$insert.=" e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires) VALUES (";
+		
+		$insert.="'".$row["fkey_gui_id"]."',";
+		$insert.="'".$row["e_id"]."',";
+		$insert.="".$row["e_pos"].",";
+		$insert.="".$row["e_public"].",";
+		$insert.="'".db_escape_string($row["e_comment"])."',";
+		$insert.="'".$row["e_element"]."',";
+		$insert.="'".$row["e_src"]."',";
+		$insert.="'".db_escape_string($row["e_attributes"])."',";
+		$insert.="".$row["e_left"].",";
+		$insert.="".$row["e_top"].",";
+		$insert.="".$row["e_width"].",";
+		$insert.="".$row["e_height"].",";
+		$insert.="".$row["e_z_index"].",";		
+		$insert.="'".$row["e_more_styles"]."',";
+		$insert.="'".db_escape_string($row["e_content"])."',";
+		$insert.="'".$row["e_closetag"]."',";
+		$insert.="'".$row["e_js_file"]."',";		
+		$insert.="'".$row["e_mb_mod"]."',";
+		$insert.="'".$row["e_target"]."',";
+		$insert.="'".$row["e_requires"]."');\n";
+	}
+	
+	
+	$sql_gelvars = "SELECT * from gui_element_vars WHERE fkey_gui_id = '".$guiList."'";
+	$res_gelvars = db_query($sql_gelvars);
+	$cnt_gelvars = 0;
+
+	while ($row = db_fetch_row($res_gelvars)){
+		
+		$insert.="INSERT INTO gui_element_vars(";
+		$i=0;
+		while($i < db_numfields($res_gelvars)){
+			if($i > 0){
+				$insert.=", ";
+			}
+			$insert.=db_fieldname($res_gelvars, $i);
+			$i++;
+		}
+		$insert.=") VALUES (";
+		$i = 0;
+		while($i < db_numfields($res_gelvars)){
+			if($i > 0){
+				$insert.=", ";
+			}
+			$temp = db_escape_string($row[$i]);
+			$temp = str_replace(">","&gt;",$temp);
+			$temp = str_replace("<","&lt;",$temp);
+			$insert.="'" . $temp . "'";
+			$i++;
+		}
+		$insert.=");\n";
+
+		$cnt_gelvars++;
+
+	}
+	
+	$insert = str_replace(",,",",NULL,",$insert);
+	$insert = str_replace(", ,", ",NULL,",$insert);
+	
+	echo "<textarea rows=40 cols=80>";
+	echo $insert; 
+	echo "</textarea>";
+}
+
+###
+if(!$guiList){
+	$sql = "SELECT * FROM gui WHERE gui_id IN (";
+	for($i=0; $i<count($permguis); $i++){
+		if($i>0){ $sql .= ",";}
+		$sql .= "'".$permguis[$i]."'";
+	}
+	$sql .= ") ORDER BY gui_name";
+		
+
+	$res = db_query($sql);
+	$cnt = 0;
+	echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+	echo "<select class='guiList' size='20' name='guiList' class='guiList' onchange='document.forms[0].submit()'>";
+	while($row = db_fetch_array($res)){
+		print_r($row);
+		echo "<option value='".$row["gui_id"]."'>".$row["gui_name"]."</option>";
+		$cnt++;
+	}
+	echo "</select><br>";
+}
+
+?>
+<input type='hidden' name='del'>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_export_image.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_export_image.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_export_image.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,38 @@
+<?php
+# $Id: mod_export_image.php,v 1.2 2005/09/13 14:48:59 c_baudson Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_export_image.php,v 1.2 2005/09/13 14:48:59 c_baudson Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+session_start();
+import_request_variables("PG");
+$_SESSION["mb_print_url"] = $map_url;
+$_SESSION["mb_print_resolution"] = $quality;
+header("Content-type: application/png"); // mark the following content as PNG file
+$date = date("d.m.y");
+header("Content-Disposition: attachment; filename=export".$date.".png");
+header("Pragma: no-cache");
+header("Expires: 0");
+include("../../conf/print.conf");
+$header_height = intval($_REQUEST["header_height"]) * $deformation;
+$map_width = intval($_REQUEST["map_width"]) * $deformation;
+$map_height = intval($_REQUEST["map_height"]) * $deformation;
+$date = date("d.m.y");
+#map
+//include "../classes/class_weldMaps2PNG.php";
+include "../extensions/exp_weldMaps.php";
+//$i = new weldMaps($map_urls, $_SESSION["mb_print_resolution"]);
+//print $i;
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGroup_Gui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGroup_Gui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGroup_Gui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,208 @@
+<?php
+# $Id: mod_filteredGroup_Gui.php,v 1.15 2006/03/09 10:56:23 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredGroup_Gui.php,v 1.15 2006/03/09 10:56:23 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add Permission for Filtered Group to GUI</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+			document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			if($selected_group == NULL || $selected_group == '' || $selected_group < 0)
+				{$selected_group == "NULL";}
+			$sql_insert = "SELECT * from gui_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_mb_group_id, fkey_gui_id) VALUES('$selected_group', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get owner group **********************************************************************************************/
+#$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all gui from selected_group******************************************************************************/
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_group_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_group.fkey_mb_group_id FROM gui_mb_group ";
+$sql_group_mb_gui .= "INNER JOIN gui ON gui_mb_group.fkey_gui_id = gui.gui_id ";
+$sql_group_mb_gui .= "WHERE gui_mb_group.fkey_mb_group_id=";
+if(!$selected_group){
+	if($group_id[0] > 0)
+		$sql_group_mb_gui .= $group_id[0];
+	else
+		$sql_group_mb_gui .= "NULL";
+}
+if($selected_group){
+	if($selected_group >= 0)
+		$sql_group_mb_gui .= $selected_group;
+	else
+		$sql_group_mb_gui .= "NULL";
+}
+
+$sql_group_mb_gui .= " ORDER BY gui.gui_name";
+
+$res_group_mb_gui = db_query($sql_group_mb_gui);
+while($row = db_fetch_array($res_group_mb_gui)){
+	$gui_id_group[$cnt_gui_group] = $row["gui_id"];
+	$gui_name_group[$cnt_gui_group] =  $row["gui_name"];
+	$cnt_gui_group++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all group in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert group_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_group; $i++){
+	echo "<option value='" . $gui_id_group[$i]  . "'>" . $gui_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGroup_User.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGroup_User.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGroup_User.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,207 @@
+<?php
+# $Id: mod_filteredGroup_User.php,v 1.14 2006/03/09 11:20:43 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredGroup_User.php,v 1.14 2006/03/09 11:20:43 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add User to Filtered Group</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+			document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_group_id, fkey_mb_user_id) VALUES('$selected_group', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get owner groups  ********************************************************************************************/
+#$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+/*get allocated group  *******************************************************************************************
+$sql_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id ";
+$sql_group .= "FROM mb_group INNER JOIN mb_user_mb_group ON mb_group.mb_group_id = mb_user_mb_group.fkey_mb_group_id ";
+$sql_group .= "WHERE mb_user_mb_group.fkey_mb_user_id='".$logged_user_id."'";
+*/
+
+
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all user **********************************************************************************************/
+#$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get only owner user from selected group******************************************************************************/
+if(count($group_id)>0){
+	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+	$sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
+	$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= '";
+	
+	
+	if(!$selected_group){$sql_mb_user_mb_group .= $group_id[0];}
+	if($selected_group){$sql_mb_user_mb_group .= $selected_group;}
+	#$sql_mb_user_mb_group .= "' AND  mb_user.mb_user_owner = '".$logged_user_id."'";
+	$sql_mb_user_mb_group .= "' ORDER BY mb_user.mb_user_name";
+	$res_mb_user_mb_group = db_query($sql_mb_user_mb_group);
+	while($row = db_fetch_array($res_mb_user_mb_group)){
+		$user_id_group[$cnt_group_user] = $row["mb_user_id"];
+		$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+		$cnt_group_user++;
+	}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert projects in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all profiles in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+}else{
+	echo "There is no group owned by this user."	;
+}
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGroup_filteredGui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGroup_filteredGui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGroup_filteredGui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,220 @@
+<?php
+# $Id: mod_filteredGroup_filteredGui.php,v 1.15 2006/03/09 10:42:29 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredGroup_filteredGui.php,v 1.15 2006/03/09 10:42:29 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add Permission for Filtered GUI to Filtered Group</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+			document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_mb_group_id, fkey_gui_id) VALUES('$selected_group', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get allocated gui  ********************************************************************************************/
+#$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+
+#$sql_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id ";
+#$sql_gui .= "FROM gui INNER JOIN gui_mb_user ON gui.gui_id = gui_mb_user.fkey_gui_id ";
+#$sql_gui .= "WHERE gui_mb_user.fkey_mb_user_id='".$logged_user_id."'";
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_gui .= ",";}
+	$sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get owner group **********************************************************************************************/
+#$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get allocated gui from selected_group******************************************************************************/
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_group_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_group.fkey_mb_group_id FROM gui_mb_group ";
+$sql_group_mb_gui .= " JOIN gui ON gui_mb_group.fkey_gui_id = gui.gui_id ";
+$sql_group_mb_gui .= "WHERE gui_mb_group.fkey_mb_group_id=";
+if(!$selected_group){
+	if($group_id[0] > 0)
+		$sql_group_mb_gui .= "'".$group_id[0]."'";
+	else
+		$sql_group_mb_gui .= "NULL";
+}
+if($selected_group){$sql_group_mb_gui .= $selected_group;}
+
+$sql_group_mb_gui .= " AND gui.gui_id IN (";
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_group_mb_gui .= ",";}
+		$sql_group_mb_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_group_mb_gui .= ") ORDER BY gui.gui_name";
+
+$res_group_mb_gui = db_query($sql_group_mb_gui);
+while($row = db_fetch_array($res_group_mb_gui)){
+	$gui_id_group[$cnt_gui_group] = $row["gui_id"];
+	$gui_name_group[$cnt_gui_group] =  $row["gui_name"];
+	$cnt_gui_group++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all group in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert group_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_group; $i++){
+	echo "<option value='" . $gui_id_group[$i]  . "'>" . $gui_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,206 @@
+<?php
+# $Id: mod_filteredGroup_filteredUser.php,v 1.15 2006/03/09 11:14:22 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredGroup_filteredUser.php,v 1.15 2006/03/09 11:14:22 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add Filtered User to Filtered Group</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+		document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_group_id, fkey_mb_user_id) VALUES('$selected_group', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get owner groups  ********************************************************************************************/
+#$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+/*get allocated group  *******************************************************************************************
+$sql_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id ";
+$sql_group .= "FROM mb_group INNER JOIN mb_user_mb_group ON mb_group.mb_group_id = mb_user_mb_group.fkey_mb_group_id ";
+$sql_group .= "WHERE mb_user_mb_group.fkey_mb_user_id='".$logged_user_id."'";
+*/
+
+
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get owner user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+#$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get only owner user from selected group******************************************************************************/
+if (count($group_id)>0){
+	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+	$sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
+	$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= '";
+	
+	
+	if(!$selected_group){$sql_mb_user_mb_group .= $group_id[0];}
+	if($selected_group){$sql_mb_user_mb_group .= $selected_group;}
+	$sql_mb_user_mb_group .= "' AND  mb_user.mb_user_owner = '".$logged_user_id."'";
+	$sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
+	$res_mb_user_mb_group = db_query($sql_mb_user_mb_group);
+	while($row = db_fetch_array($res_mb_user_mb_group)){
+		$user_id_group[$cnt_group_user] = $row["mb_user_id"];
+		$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+		$cnt_group_user++;
+	}
+	
+	
+	/*INSERT HTML*/
+	echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+	
+	/*insert projects in selectbox*************************************************************************************/
+	echo "<div class='text1'>GROUP: </div>";
+	echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+	for($i=0; $i<$cnt_group; $i++){
+		echo "<option value='" . $group_id[$i] . "' ";
+		if($selected_group && $selected_group == $group_id[$i]){
+			echo "selected";
+		}
+		echo ">" . $group_name[$i]  . "</option>";
+	}
+	echo "</select>";
+	
+	/*insert all profiles in selectbox**************************************************************************/
+	echo "<div class='text2'>USER:</div>";
+	echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+	for($i=0; $i<$cnt_user; $i++){
+		echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	}
+	echo "</select>";
+	
+	/*Button****************************************************************************************************/
+	
+	echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+	echo "<input type='hidden' name='insert'>";
+	
+	echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+	echo "<input type='hidden' name='remove'>";
+	
+	/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+	echo "<div class='text3'>SELECTED USER:</div>";
+	echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+	for($i=0; $i<$cnt_group_user; $i++){
+		echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+	}
+	echo "</select>";
+	
+	echo "</form>";
+}else{
+	echo "There is no group available for this user.";
+}
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGui_User.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGui_User.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGui_User.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,205 @@
+<?php
+# $Id: mod_filteredGui_User.php,v 1.14 2006/03/09 10:43:57 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredGui_User.php,v 1.14 2006/03/09 10:43:57 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+		document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$gui_id_array = array();
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+#echo $_SESSION["mb_user_name"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_gui_id = '".$selected_gui."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_gui_id, fkey_mb_user_id) VALUES('$selected_gui', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_gui_id = '$selected_gui'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get allocated gui  ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+ if($i>0){ $sql_gui .= ",";}
+ $sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get all user from selected gui******************************************************************************/
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_mb_user .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_mb_user .= $selected_gui;}
+#$sql_gui_mb_user .= "' AND  gui_mb_user.fkey_mb_user_id <> '".$logged_user_id."'";
+$sql_gui_mb_user .= "' ORDER BY mb_user.mb_user_name";
+$res_gui_mb_user = db_query($sql_gui_mb_user);
+while($row = db_fetch_array($res_gui_mb_user)){
+	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
+	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$cnt_gui_user++;
+}
+
+
+/*INSERT HTML*/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert projects in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' size='10' onchange='submit()'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";                 }
+echo "</select>";
+
+/*insert all profiles in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGui_filteredGroup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGui_filteredGroup.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGui_filteredGroup.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,204 @@
+<?php
+# $Id: mod_filteredGui_filteredGroup.php,v 1.14 2006/03/09 10:54:39 uli_rothstein Exp $
+# $Head$
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add Permission for Filtered Group to GUI</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+		document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_group where fkey_gui_id = '".$selected_gui."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_gui_id, fkey_mb_group_id) VALUES('$selected_gui', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_gui_id = '$selected_gui'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get allocated gui  ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_gui .= ",";}
+	$sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get owner groups **********************************************************************************************/
+
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] =  $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get owner groups from selected gui******************************************************************************/
+$sql_gui_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, gui_mb_group.fkey_gui_id FROM gui_mb_group ";
+$sql_gui_group .= "INNER JOIN mb_group ON gui_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_gui_group .= "WHERE gui_mb_group.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_group .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_group .= $selected_gui;}
+$sql_gui_group .= "' AND mb_group.mb_group_owner = '".$logged_user_id."'";
+$sql_gui_group .= " ORDER BY mb_group.mb_group_name";
+$res_gui_group = db_query($sql_gui_group);
+while($row = db_fetch_array($res_gui_group)){
+	$group_id_gui[$cnt_gui_group] = $row["mb_group_id"];
+	$group_name_gui[$cnt_gui_group] =  $row["mb_group_name"];
+	$cnt_gui_group++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert guis in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all groups in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div><br>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert gui_group_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_group; $i++){
+	echo "<option value='" . $group_id_gui[$i]  . "'>" . $group_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGui_filteredUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGui_filteredUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGui_filteredUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,204 @@
+<?php
+# $Id: mod_filteredGui_filteredUser.php,v 1.15 2006/03/09 11:11:35 uli_rothstein Exp $
+# $Head$
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+		document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.background = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$gui_id_array=array();
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+#echo $_SESSION["mb_user_name"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_gui_id = '".$selected_gui."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_gui_id, fkey_mb_user_id) VALUES('$selected_gui', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_gui_id = '$selected_gui'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get allocated gui  ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_gui .= ",";}
+	$sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get only owner user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get only owner user from selected gui******************************************************************************/
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_mb_user .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_mb_user .= $selected_gui;}
+$sql_gui_mb_user .= "' AND  mb_user.mb_user_owner = '".$logged_user_id."'";
+$sql_gui_mb_user .= " ORDER BY mb_user.mb_user_name";
+$res_gui_mb_user = db_query($sql_gui_mb_user);
+while($row = db_fetch_array($res_gui_mb_user)){
+	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
+	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$cnt_gui_user++;
+}
+
+
+/*INSERT HTML*/
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+/*insert guis in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all user in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert gui_user_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredGui_group.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredGui_group.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredGui_group.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,201 @@
+<?php
+# $Id: mod_filteredGui_group.php,v 1.14 2006/03/09 11:28:25 uli_rothstein Exp $
+# $Head$
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+		document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+        if(wert == "remove"){
+                if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+                  document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+                  return;
+                }
+                document.form1.remove.value = 'true';
+                document.form1.submit();
+        }
+        if(wert == "insert"){
+                if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+                  document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+                  return;
+                }
+                document.form1.insert.value = 'true';
+                document.form1.submit();
+        }
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+        if(count($selected_group)>0){
+          for($i=0; $i<count($selected_group); $i++){
+                        $exists = false;
+                        $sql_insert = "SELECT * from gui_mb_group where fkey_gui_id = '".$selected_gui."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+                        $res_insert = db_query($sql_insert);
+                        while(db_fetch_row($res_insert)){$exists = true;}
+                        if($exists == false){
+                            $sql_insert = "INSERT INTO gui_mb_group(fkey_gui_id, fkey_mb_group_id) VALUES('$selected_gui', '".$selected_group[$i]."');";
+                            $res_insert = db_query($sql_insert);
+                        }
+          }
+        }
+}
+if($remove){
+        if(count($remove_group)>0){
+                for($i=0; $i<count($remove_group); $i++){
+                    $sql_remove = "DELETE FROM gui_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_gui_id = '$selected_gui'";
+                    db_query($sql_remove);
+                }
+        }
+}
+
+
+/*get allocated gui  ********************************************************************************************/
+#$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+ if($i>0){ $sql_gui .= ",";}
+ $sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+                 while($row = db_fetch_array($res_gui)){
+                    $gui_id_array[$cnt_gui] = $row["gui_id"];
+                    $gui_name[$cnt_gui] = $row["gui_name"];
+                    $cnt_gui++;
+                 }
+
+/*get all groups **********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+                 while($row = db_fetch_array($res_group)){
+                   $group_id[$cnt_group] = $row["mb_group_id"];
+                   $group_name[$cnt_group] =  $row["mb_group_name"];
+                   $cnt_group++;
+                 }
+
+/*get all groups from selected gui******************************************************************************/
+$sql_gui_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, gui_mb_group.fkey_gui_id FROM gui_mb_group ";
+$sql_gui_group .= "INNER JOIN mb_group ON gui_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_gui_group .= "WHERE gui_mb_group.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_group .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_group .= $selected_gui;}
+$sql_gui_group .= "' ORDER BY mb_group.mb_group_name";
+$res_gui_group = db_query($sql_gui_group);
+                 while($row = db_fetch_array($res_gui_group)){
+                    $group_id_gui[$cnt_gui_group] = $row["mb_group_id"];
+                    $group_name_gui[$cnt_gui_group] =  $row["mb_group_name"];
+                    $cnt_gui_group++;
+                 }
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert guis in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onChange='submit()' size='10'>";
+                 for($i=0; $i<$cnt_gui; $i++){
+                                  echo "<option value='" . $gui_id_array[$i] . "' ";
+                                 if($selected_gui && $selected_gui == $gui_id_array[$i]){
+                                   echo "selected";
+                                 }
+                                 echo ">" . $gui_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*insert all groups in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div><br>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+                 for($i=0; $i<$cnt_group; $i++){
+                                  echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert gui_group_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+                 for($i=0; $i<$cnt_gui_group; $i++){
+                                  echo "<option value='" . $group_id_gui[$i]  . "'>" . $group_name_gui[$i]  . "</option>";
+                 }
+echo "</select>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredUser_Group.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredUser_Group.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredUser_Group.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,202 @@
+<?php
+#$Id: mod_filteredUser_Group.php,v 1.15 2006/03/09 11:25:13 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredUser_Group.php,v 1.15 2006/03/09 11:25:13 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+			document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = '".$selected_user."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_user_id, fkey_mb_group_id) VALUES('$selected_user', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get all groups  ********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+#$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+
+/*get allocated groups  ********************************************************************************************/
+#$sql_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id ";
+#$sql_group .= "FROM mb_group INNER JOIN mb_user_mb_group ON mb_group.mb_group_id = mb_user_mb_group.fkey_mb_group_id ";
+#$sql_group .= "WHERE mb_user_mb_group.fkey_mb_user_id='".$logged_user_id."'";
+
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get owner user **********************************************************************************************/
+#$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get owner group from selected_user******************************************************************************/
+
+if(count($user_id)>0){
+	$sql_user_mb_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id FROM mb_user_mb_group ";
+	$sql_user_mb_group .= "INNER JOIN mb_group ON mb_user_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+	$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id='";
+	
+	if(!$selected_user){$sql_user_mb_group .= $user_id[0];}
+	if($selected_user){$sql_user_mb_group .= $selected_user;}
+	
+	#$sql_user_mb_group .= "' AND mb_group.mb_group_owner = '".$logged_user_id."'";
+	$sql_user_mb_group .= "' ORDER BY mb_group.mb_group_name";
+	$res_user_mb_group = db_query($sql_user_mb_group);
+	while($row = db_fetch_array($res_user_mb_group)){
+		$group_id_user[$cnt_group_user] = $row["mb_group_id"];
+		$group_name_user[$cnt_group_user] =  $row["mb_group_name"];
+		$cnt_group_user++;
+	}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all group in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $group_id_user[$i]  . "'>" . $group_name_user[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+}else{
+	echo "There are no other users owned by this user."	;
+}
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredUser_Gui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredUser_Gui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredUser_Gui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,204 @@
+<?php
+#$Id: mod_filteredUser_Gui.php,v 1.16 2006/03/09 11:24:53 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_filteredUser_Gui.php,v 1.16 2006/03/09 11:24:53 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+			document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$cnt_gui_user = 0;
+$cnt_gui_logged_user = 0;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_mb_user_id = '".$selected_user."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+    			$sql_insert = "INSERT INTO gui_mb_user(fkey_mb_user_id, fkey_gui_id) VALUES('$selected_user', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+
+/*get owner user **********************************************************************************************/
+#$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+
+
+
+/*get all gui from selected_user******************************************************************************/
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_user_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id FROM gui_mb_user ";
+$sql_user_mb_gui .= "INNER JOIN gui ON gui_mb_user.fkey_gui_id = gui.gui_id ";
+$sql_user_mb_gui .= "WHERE gui_mb_user.fkey_mb_user_id=";
+if(!$selected_user){$sql_user_mb_gui .= $user_id[0];}
+if($selected_user){$sql_user_mb_gui .= $selected_user;}
+$sql_user_mb_gui .= " ORDER BY gui.gui_name";
+
+$res_user_mb_gui = db_query($sql_user_mb_gui);
+while($row = db_fetch_array($res_user_mb_gui)){
+	$gui_id_user[$cnt_gui_user] = $row["gui_id"];
+	$gui_name_user[$cnt_gui_user] =  $row["gui_name"];
+	$cnt_gui_user++;
+}
+
+
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+#echo "<table bgcolor='lightgrey' border='1' frame='box'>";
+
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i] . "</option>";
+}
+echo "</select>";
+/*insert allocated gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+/*Button****************************************************************************************************/
+echo "<div class='button1' ><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $gui_id_user[$i]  . "'>" . $gui_name_user[$i]  . "</option>";
+}
+echo "</select>";
+echo "</form>";
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,197 @@
+<?php
+# $id$
+# $Head$
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+		document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = '".$selected_user."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_user_id, fkey_mb_group_id) VALUES('$selected_user', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get owner groups  ********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner=".$logged_user_id." ORDER BY mb_group_name";
+
+/*get allocated groups  ********************************************************************************************/
+
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get owner user **********************************************************************************************/
+
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get owner group from selected_user******************************************************************************/
+if (count($user_id)>0 AND count($group_id)>0){
+$sql_user_mb_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id FROM mb_user_mb_group ";
+$sql_user_mb_group .= "INNER JOIN mb_group ON mb_user_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id=";
+
+if(!$selected_user){$sql_user_mb_group .= $user_id[0];}
+if($selected_user){$sql_user_mb_group .= $selected_user;}
+$sql_user_mb_group .= " AND mb_group.mb_group_owner = ".$logged_user_id."";
+$sql_user_mb_group .= " ORDER BY mb_group.mb_group_name";
+$res_user_mb_group = db_query($sql_user_mb_group);
+
+while($row = db_fetch_array($res_user_mb_group)){
+	$group_id_user[$cnt_group_user] = $row["mb_group_id"];
+	$group_name_user[$cnt_group_user] =  $row["mb_group_name"];
+	$cnt_group_user++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+echo ">" . $user_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*insert all group in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $group_id_user[$i]  . "'>" . $group_name_user[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+}else{
+	echo "There is no group or user available for this user.";
+}
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_filteredUser_filteredGui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_filteredUser_filteredGui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_filteredUser_filteredGui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,242 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Administration</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+		document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.background = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.background = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$cnt_gui_user = 0;
+$cnt_gui_logged_user = 0;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_mb_user_id = '".$selected_user."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_mb_user_id, fkey_gui_id) VALUES('$selected_user', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+
+/*get owner user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+
+
+/*get allocated gui  ********************************************************************************************/
+#$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_gui .= ",";}
+	$sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+
+
+/*get allocated gui from logged_user******************************************************************************/
+
+$sql_logged_user_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id FROM gui_mb_user ";
+$sql_logged_user_mb_gui .= "INNER JOIN gui ON gui_mb_user.fkey_gui_id = gui.gui_id ";
+$sql_logged_user_mb_gui .= "WHERE gui_mb_user.fkey_mb_user_id='".$logged_user_id."'";
+$sql_logged_user_mb_gui .= " ORDER BY gui.gui_name";
+
+
+$res_logged_user_mb_all_gui = db_query($sql_logged_user_mb_gui);
+while($row = db_fetch_array($res_logged_user_mb_all_gui)){
+	$gui_id_logged_user[$cnt_gui_logged_user] = $row["gui_id"];
+	$gui_name_logged_user[$cnt_gui_logged_user] =  $row["gui_name"];
+	$cnt_gui_logged_user++;
+}
+
+/*get allocated gui from selected_user******************************************************************************/
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+if(count($user_id)>0){
+	$sql_user_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id FROM gui_mb_user ";
+	$sql_user_mb_gui .= "INNER JOIN gui ON gui_mb_user.fkey_gui_id = gui.gui_id ";
+	$sql_user_mb_gui .= "WHERE gui_mb_user.fkey_mb_user_id=";
+	if(!$selected_user){$sql_user_mb_gui .= $user_id[0];}
+	if($selected_user){$sql_user_mb_gui .= $selected_user;}
+	$sql_user_mb_gui .= " AND gui.gui_id IN(";
+	for($i=0; $i<count($arrayGuis); $i++){
+	 if($i>0){ $sql_user_mb_gui .= ",";}
+	 $sql_user_mb_gui .= "'".$arrayGuis[$i]."'";
+	}
+	$sql_user_mb_gui .= ") ORDER BY gui.gui_name";
+	
+	$res_user_mb_gui = db_query($sql_user_mb_gui);
+	while($row = db_fetch_array($res_user_mb_gui)){
+		$gui_id_user[$cnt_gui_user] = $row["gui_id"];
+		$gui_name_user[$cnt_gui_user] =  $row["gui_name"];
+		$cnt_gui_user++;
+	}
+
+
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+#echo "<table bgcolor='lightgrey' border='1' frame='box'>";
+
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+   echo "<option value='" . $user_id[$i] . "' ";
+   if($selected_user && $selected_user == $user_id[$i]){
+      echo "selected";
+   }
+   echo ">" . $user_name[$i] . "</option>";
+}
+echo "</select>";
+/*insert allocated gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+   echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+/*Button****************************************************************************************************/
+echo "<div class='button1' ><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+   echo "<option value='" . $gui_id_user[$i]  . "'>" . $gui_name_user[$i]  . "</option>";
+}
+echo "</select>";
+echo "</form>";
+
+}else{
+	echo "This user doesn't own other guis.";
+}
+
+?>
+
+
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+
+
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_forgottenPassword.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_forgottenPassword.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_forgottenPassword.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,168 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../php/mb_validateSession.php");
+require_once("../classes/class_administration.php");
+require_once("../../conf/mapbender.conf");
+import_request_variables("PG");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Generate New Password</title>
+<style type="text/css">
+<!--
+
+body{
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+.desc{
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 9px;
+}
+.myButton{
+   font-family: Arial, Helvetica, sans-serif;
+   width : 150px;
+}
+-->
+</style>
+</head>
+<body>
+<?php
+//the database-params
+require_once("../../conf/mapbender.conf");
+//$con = db_connect($DBSERVER,$OWNER,$PW);
+//db_select_db(DB,$con);
+
+
+if (!USE_PHP_MAILING) {
+	echo "<script language='javascript'>";
+	echo "alert('PHP mailing is currently disabled. Please adjust the settings in mapbender.conf.');";
+	echo "window.close();";
+	echo "</script>";
+}
+else {
+	$logged_user_name=$_SESSION["mb_user_name"];
+	$logged_user_id=$_SESSION["mb_user_id"];
+	
+	$admin = new administration();
+	$upd = false;
+	
+	if ($_POST["sendnew"]) {
+		if ($_POST["username"]) {
+			$id = $admin->getUserIdByUserName($_POST["username"]);
+			$user_id = $id[0];
+	
+			if ($user_id) {
+				$upd=true;
+			}
+			else {
+				echo "Your username could not be found. Please try again!<br><br>";
+			}
+		}
+		else {
+			echo "Please fill in your username.<br><br>";
+		}
+	}
+	
+	
+	/*handle INSERT and DELETE************************************************************************************/
+	if($upd){
+	 
+	    $sql_password = $admin->getRandomPassword();
+		$mailToAddr = $admin->getEmailByUserId($user_id);
+		$mailToName = $admin->getUsernameByUserId($user_id);
+		
+		if (!$mailToAddr) {
+		      echo "<script language='javascript'>";
+		      echo "alert('You didn\'t enter an email address when registering with Mapbender. Unfortunately there is no way to send you a new password.');";
+		      echo "window.back();";
+		      echo "</script>";
+		}
+		elseif ($user_id) {
+		   if ($admin->sendEmail("", "", $mailToAddr, $mailToName, "Your new Mapbender password", "login:    " . $mailToName . "\npassword: " . $sql_password, $error_msg)) {
+		      //set new password in db
+				if(SYS_DBTYPE == "mysql") {
+							$passwd_tmp = "password('".$sql_password."')";	
+				}
+				else {
+					if(MD5 == 'true'){
+						$passwd_tmp = "md5('".$sql_password."')";
+					}else{
+						$passwd_tmp = $sql_password;
+					}
+				}
+		      	$sql_update = "UPDATE mb_user SET mb_user_password=";
+				$sql_update .= $passwd_tmp ;
+		      	$sql_update .= " WHERE mb_user_id='".$user_id."'";
+		      #echo $sql_update;
+
+		      
+		      db_query($sql_update);
+		      
+		      //reset login count
+		      $admin->resetLoginCount($user_id);
+		      
+		      echo "<script language='javascript'>";
+		      echo "alert('A new password will be sent to your e-mail-address!');";
+		      echo "window.close();";
+		      echo "</script>";
+		   }
+		   else {
+		      echo "<script language='javascript'>";
+		      echo "alert('An error occured while sending the new password to your e-mail-address! " . $error_msg . " Please try again later.');";
+		      echo "window.back();";
+		      echo "</script>";
+		   }
+	   }
+	   $upd = false;
+	}
+	else {
+	
+	
+	/*HTML*****************************************************************************************************/
+	
+	echo "<fieldset><legend>Forgot your Passwort ?</legend>";
+	#echo "<fieldset><legend>Passwort vergessen ?</legend>";
+	#echo "<form name='form1' action='" . $PHP_SELF . "' method='post'>";
+	echo "<form name='form1' method='post'>";
+	echo "<table cellpadding='5' cellspacing='0' border='0'><tr>";
+	echo "<td>";
+	echo "Username:";
+	echo "</td>";
+	echo "<td>";
+	echo "<input type='text' name='username' value=''>";
+	echo "</td>";
+	echo"</tr>";
+	echo"<tr><td>";
+	echo "<input type='hidden' name='upd' value=''>";
+	echo "<center><br><input type='submit' name='sendnew' value='Order a new Password'></center>";
+	#echo "<center><br><input type='submit' name='sendnew' value='Neues Passwort anfordern'></center>";
+	echo"<td></tr></table>";
+	echo "</form>";
+	echo"</fieldset><br />";
+	/*********************************************************************/
+	}
+}
+?>
+
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_gazLayerObj_conf.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gazLayerObj_conf.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gazLayerObj_conf.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,139 @@
+<?php
+require("../classes/class_wfs_conf.php");
+require("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>gazetteer</title>
+<script language="JavaScript" type="text/javascript">
+  function selectWFS(){
+  	if(document.forms[0].featuretype){
+  		if(document.forms[0].featuretype.length){
+  			for(var i=0; i<document.forms[0].featuretype.length;i++){  			
+  				document.forms[0].featuretype[i].checked = false;
+  			}
+  		}
+  		else{
+  			document.forms[0].featuretype.checked = false;
+  		}  		
+  	}
+  	document.forms[0].submit();
+  }
+  function validate(){
+   	for(var i=0; i<document.forms[0].length; i++){
+  		if(document.forms[0].elements[i].type == 'checkbox'){
+   			if(document.forms[0].elements[i].checked){
+  				document.forms[0].elements[i].value = 1;
+  			}
+  			else{
+  				document.forms[0].elements[i].value = 0;
+  			}
+  			document.forms[0].elements[i].checked = true;
+  		}
+  	}
+  	return true;
+  }
+</script>
+    
+</head>
+<body>
+Gazetteer Configuration<br>
+<form method='POST' onsubmit='return validate()'>
+
+<?php
+echo "<input type='hidden' name='gui' value='".$_REQUEST["gui"]."'>";	
+echo "<input type='hidden' name='wms' value='".$_REQUEST["wms"]."'>";
+echo "<input type='hidden' name='layer' value='".$_REQUEST["layer"]."'>";
+
+
+$aWFS = new wfs_conf();
+$aWFS->getallwfs();	
+
+/* save gazetteer properties */
+
+if(isset($_REQUEST["save"])){
+	$con = db_connect($DBSERVER,$OWNER,$PW);
+	db_select_db(DB,$con);
+	
+	$sql = "UPDATE gui_layer SET gui_layer_wfs_featuretype = '".$_REQUEST["myWFS"]."' ";
+	$sql .= "WHERE fkey_gui_id='".$_REQUEST["gui"]."' AND fkey_layer_id=".$_REQUEST["layer"];
+	$res = db_query($sql);
+	echo "layer is connected with: ".$_REQUEST["myWFS"];
+	die();
+}
+
+/* end save gazetteer properties */
+
+/* select wfs */
+
+if(isset($_REQUEST["wfs"]) && $_REQUEST["wfs"] == ""){
+	unset($_REQUEST["wfs"]);
+	unset($_REQUEST["featuretype"]);
+}
+
+echo "<select name='wfs' onchange='selectWFS()'>";
+echo "<option value=''>...</option>";
+for($i=0; $i<count($aWFS->wfs_id);$i++){
+	echo "<option value='".$aWFS->wfs_id[$i]."' ";
+	if(isset($_REQUEST["wfs"]) && $aWFS->wfs_id[$i] == $_REQUEST["wfs"]){
+		echo "selected";
+	}
+	echo ">".$aWFS->wfs_title[$i]."</option>";
+}
+echo "</select>";
+echo "";
+
+/* end select wfs */
+
+
+/* select featuretype */
+
+if(isset($_REQUEST["wfs"])){
+	
+	for($i=0; $i<count($aWFS->wfs_id);$i++){
+		if($aWFS->wfs_id[$i] == $_REQUEST["wfs"]){
+			echo "<table>";
+			echo "<tr><td>ID:</td><td>".$aWFS->wfs_id[$i]."</td></tr>";
+			echo "<tr><td>Name:</td><td>".$aWFS->wfs_name[$i]."</td></tr>";
+			echo "<tr><td>Title:</td><td>".$aWFS->wfs_title[$i]."</td></tr>";
+			echo "<tr><td>Abstract:</td><td>".$aWFS->wfs_abstract[$i]."</td></tr>";
+			echo "<tr><td>Capabilities:</td><td>".$aWFS->wfs_getcapabilities[$i]."</td></tr>";
+			echo "<tr><td>FeaturTypes:</td><td>".$aWFS->wfs_describefeaturetype[$i]."</td></tr>";
+			echo "<tr><td>Feature:</td><td>".$aWFS->wfs_getfeature[$i]."</td></tr>";
+			echo "</table>";
+			$str_request = $aWFS->wfs_getfeature[$i]."&REQUEST=getFeature&VERSION=".$aWFS->wfs_version[$i]."&SERVICE=WFS";
+		}
+	}
+	
+	$aWFS->getfeatures($_REQUEST["wfs"]);
+	echo "<table>";
+	for($i=0; $i<count($aWFS->features->featuretype_id); $i++){
+		echo "<tr>";
+		echo "<td><input type='radio' name='featuretype' value='".$aWFS->features->featuretype_id[$i]."' onclick='submit()' ";
+		if(isset($_REQUEST["featuretype"]) && $_REQUEST["featuretype"] == $aWFS->features->featuretype_id[$i]){
+			echo "checked ";
+			$str_request = $str_request . "&Typename=".$aWFS->features->featuretype_name[$i];
+		}
+		echo "/></td>";
+		echo "<td>".$aWFS->features->featuretype_name[$i]."</td>";
+		echo "</tr>";	
+	}
+	echo "</table>";
+}
+
+/* end select featuretype */
+
+/* configure elements */
+if(isset($_REQUEST["featuretype"])){
+echo "<input type='hidden' name='myWFS' value='".$str_request."'>";
+echo "<input type='submit' name='save' value='save'>";	
+}
+
+
+/* end configure elements */
+?>
+</form>
+</body>

Added: trunk/mapbender/http/php/mod_gazLayerObj_edit.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gazLayerObj_edit.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gazLayerObj_edit.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,139 @@
+<?php
+require("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Gazetteer</title>
+<script language="JavaScript" type="text/javascript">
+  function validate(){
+   	for(var i=0; i<document.forms[0].length; i++){
+  		if(document.forms[0].elements[i].type == 'checkbox'){
+   			if(document.forms[0].elements[i].checked){
+  				document.forms[0].elements[i].value = 1;
+  			}
+  			else{
+  				document.forms[0].elements[i].value = 0;
+  			}
+  			document.forms[0].elements[i].checked = true;
+  		}
+  	}
+  	return true;
+  }
+</script>
+    
+</head>
+<body>
+Gazetteer Configuration<br>
+<form method='POST' onsubmit='return validate()'>
+
+<?php
+/* save gazetteer properties */
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+if(isset($_REQUEST["save"])){
+	
+	$sql = "UPDATE gazetteer SET ";
+	$sql .= "gazetteer_abstract = '".$_REQUEST["gazetteer_abstract"]."',";
+	$sql .= "g_label = '".$_REQUEST["g_label"]."',";
+	$sql .= "g_label_id = '".$_REQUEST["g_label_id"]."',";
+	$sql .= "g_button = '".$_REQUEST["g_button"]."',";
+	$sql .= "g_button_id = '".$_REQUEST["g_button_id"]."',";
+	$sql .= "g_style = '".$_REQUEST["g_style"]."',";
+	$sql .= "g_buffer = '".$_REQUEST["g_buffer"]."'";	
+	$sql .= " WHERE gazetteer_id = ".$_REQUEST["fkey_gazetteer_id"].";";
+	
+	$res = db_query($sql);		
+
+	for($i=0; $i<count($_REQUEST["f_id"]); $i++){
+		$sql = "UPDATE gazetteer_element SET ";		
+		$sql .= "f_search = '".$_REQUEST["f_search"][$i]."',";
+		$sql .= "f_pos = '".$_REQUEST["f_pos"][$i]."',";
+		$sql .= "f_style_id = '".$_REQUEST["f_style_id"][$i]."',";
+		$sql .= "f_label = '".$_REQUEST["f_label"][$i]."',";
+		$sql .= "f_label_id = '".$_REQUEST["f_label_id"][$i]."',";
+		$sql .= "f_show = '".$_REQUEST["f_show"][$i]."',";
+		$sql .= "f_respos = '".$_REQUEST["f_respos"][$i]."'";
+		$sql .= " WHERE fkey_gazetteer_id = ".$_REQUEST["fkey_gazetteer_id"]." AND f_id = ".$_REQUEST["f_id"][$i].";";
+		
+		$res = db_query($sql);
+	}		
+}
+
+/* end save gazetteer properties */
+
+/* select wfs */
+
+
+
+/* end select wfs */
+
+
+
+/* configure elements */
+if(isset($_REQUEST["fkey_gazetteer_id"])){
+	$sql = "SELECT * FROM gazetteer WHERE gazetteer_id = ".$_REQUEST["fkey_gazetteer_id"];
+	$res = db_query($sql);
+	if($row = db_fetch_array($res)){	
+		echo "<table>";
+		echo "<tr><td>ID:</td><td>".$row["gazetteer_id"]."</td></tr>" ;
+		echo "<tr><td>Abstract:</td><td><input type='text' name='gazetteer_abstract' value='".$row["gazetteer_abstract"]."'></td></tr>" ;
+		echo "<tr><td>Label:</td><td><input type='text' name='g_label' value='".$row["g_label"]."'></td></tr>" ;
+		echo "<tr><td>Label_id:</td><td><input type='text' name='g_label_id' value='".$row["g_label_id"]."'></td></tr>" ;
+		echo "<tr><td>Button:</td><td><input type='text' name='g_button' value='".$row["g_button"]."'></td></tr>" ;
+		echo "<tr><td>Button_id:</td><td><input type='text' name='g_button_id' value='".$row["g_button_id"]."'></td></tr>" ;
+		echo "<tr><td>Style:</td><td><textarea cols=30 rows=5 name='g_style'>".$row["g_style"]."</textarea></td></tr>" ;
+		echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='".$row["g_buffer"]."'></td></tr>" ;
+		echo "</table>";
+	}
+	
+	/* set element options */
+	$sql = "SELECT * FROM gazetteer_element ";
+	$sql .= "JOIN wfs_element ON gazetteer_element.f_id = wfs_element.element_id ";
+	$sql .= "WHERE fkey_gazetteer_id = ".$_REQUEST["fkey_gazetteer_id"];
+	$res = db_query($sql);
+	
+	echo "<table border='1'>";
+	echo "<tr>";
+		echo "<td>ID</td>";
+		echo "<td>name</td>";
+		echo "<td>type</td>";
+		echo "<td>search</td>";
+		echo "<td>pos</td>";
+		echo "<td>style_id</td>";
+		echo "<td>label</td>";		
+		echo "<td>label_id</td>";
+		echo "<td>show</td>";
+		echo "<td>position</td>";
+	echo "</tr>";
+	$cnt = 0;	
+	while($row = db_fetch_array($res)){
+		echo "<tr>";
+		echo "<td><input type='text' size='4' name='f_id[]' value='".$row["gazetteer_element.f_id"]."' readonly></td>";
+		echo "<td>".$row["wfs_element.element_name"]."</td>";
+		echo "<td>".$row["wfs_element.element_type"]."</td>";
+		echo "<td><input name='f_search[]' type='checkbox'";
+		if($row["gazetteer_element.f_search"] == 1){ echo " checked"; }
+		echo "></td>";
+		echo "<td><input name='f_pos[]' type='text' size='2' value='".$row["gazetteer_element.f_pos"]."'></td>";
+		echo "<td><input name='f_style_id[]' type='text' size='2' value='".$row["gazetteer_element.f_style_id"]."'></td>";
+		echo "<td><input name='f_label[]' type='text' size='10' value='".$row["gazetteer_element.f_label"]."'></td>";		
+		echo "<td><input name='f_label_id[]' type='text' size='2' value='".$row["gazetteer_element.f_label_id"]."'></td>";
+		echo "<td><input name='f_show[]' type='checkbox'";
+		if($row["gazetteer_element.f_show"] == 1){ echo " checked"; }
+		echo "></td>";
+		echo "<td><input name='f_respos[]' type='text' size='4' value='".$row["gazetteer_element.f_respos"]."'></td>";
+		echo "</tr>";
+		$cnt++;	
+	}
+	echo "</table>";
+	echo "<input type='submit' name='save' value='save'>";
+}
+
+
+/* end configure elements */
+?>
+</form>
+</body>

Added: trunk/mapbender/http/php/mod_gazetteer_conf.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gazetteer_conf.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gazetteer_conf.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,213 @@
+<?php
+require("../classes/class_wfs_conf.php");
+require("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>gazetteer</title>
+<script language="JavaScript" type="text/javascript">
+  function selectWFS(){
+  	if(document.forms[0].featuretype){
+  		if(document.forms[0].featuretype.length){
+  			for(var i=0; i<document.forms[0].featuretype.length;i++){  			
+  				document.forms[0].featuretype[i].checked = false;
+  			}
+  		}
+  		else{
+  			document.forms[0].featuretype.checked = false;
+  		}  		
+  	}
+  	document.forms[0].submit();
+  }
+  function validate(){
+   	for(var i=0; i<document.forms[0].length; i++){
+  		if(document.forms[0].elements[i].type == 'checkbox'){
+   			if(document.forms[0].elements[i].checked){
+  				document.forms[0].elements[i].value = 1;
+  			}
+  			else{
+  				document.forms[0].elements[i].value = 0;
+  			}
+  			document.forms[0].elements[i].checked = true;
+  		}
+  	}
+  	return true;
+  }
+</script>
+    
+</head>
+<body>
+Gazetteer Configuration<br>
+<form method='POST' onsubmit='return validate()'>
+<a href="mod_gazetteer_edit.php">edit</a><br>
+<?php
+$aWFS = new wfs_conf();
+$aWFS->getallwfs();	
+
+/* save gazetteer properties */
+
+if(isset($_REQUEST["save"])){
+	global $DBSERVER,$DB,$OWNER,$PW;
+	$con = db_connect($DBSERVER,$OWNER,$PW);
+	db_select_db($DB,$con);
+	
+	$sql = "INSERT INTO gazetteer (gazetteer_abstract,fkey_wfs_id,fkey_featuretype_id,g_label,g_label_id,g_button,g_button_id,g_style,g_buffer,g_res_style,g_use_wzgraphics) VALUES(";
+	$sql .= "'".$_REQUEST["gazetteer_abstract"]."',";
+	$sql .= "'".$_REQUEST["wfs"]."',";
+	$sql .= "'".$_REQUEST["featuretype"]."',";
+	$sql .= "'".$_REQUEST["g_label"]."',";
+	$sql .= "'".$_REQUEST["g_label_id"]."',";
+	$sql .= "'".$_REQUEST["g_button"]."',";
+	$sql .= "'".$_REQUEST["g_button_id"]."',";
+	$sql .= "'".$_REQUEST["g_style"]."',";	
+	$sql .= "'".$_REQUEST["g_buffer"]."',";	
+	$sql .= "'".$_REQUEST["g_res_style"]."',";
+	$sql .= $_REQUEST["g_use_wzgraphics"];
+	$sql .= "); ";
+	
+	$res = db_query($sql);		
+	$wfsID = db_insert_id($con);
+	for($i=0; $i<count($_REQUEST["f_id"]); $i++){
+		$sql = "INSERT INTO gazetteer_element (fkey_gazetteer_id,f_id,f_search,f_pos,f_style_id,f_toupper,f_label,f_label_id,f_show,f_respos) VALUES(";
+		$sql .= "'".$wfsID."',";
+		$sql .= "'".$_REQUEST["f_id"][$i]."',";
+		$sql .= "'".$_REQUEST["f_search"][$i]."',";
+		$sql .= "'".$_REQUEST["f_pos"][$i]."',";
+		$sql .= "'".$_REQUEST["f_style_id"][$i]."',";
+		$sql .= "'".$_REQUEST["f_toupper"][$i]."',";		
+		$sql .= "'".$_REQUEST["f_label"][$i]."',";
+		$sql .= "'".$_REQUEST["f_label_id"][$i]."',";
+		$sql .= "'".$_REQUEST["f_show"][$i]."',";
+		$sql .= "'".$_REQUEST["f_respos"][$i]."'";
+		$sql .= "); ";
+		$res = db_query($sql);
+	}		
+}
+
+/* end save gazetteer properties */
+
+/* select wfs */
+
+if(isset($_REQUEST["wfs"]) && $_REQUEST["wfs"] == ""){
+	unset($_REQUEST["wfs"]);
+	unset($_REQUEST["featuretype"]);
+}
+
+echo "<select name='wfs' onchange='selectWFS()'>";
+echo "<option value=''>...</option>";
+for($i=0; $i<count($aWFS->wfs_id);$i++){
+	echo "<option value='".$aWFS->wfs_id[$i]."' ";
+	if(isset($_REQUEST["wfs"]) && $aWFS->wfs_id[$i] == $_REQUEST["wfs"]){
+		echo "selected";
+	}
+	echo ">".$aWFS->wfs_title[$i]."</option>";
+}
+echo "</select>";
+echo "";
+
+/* end select wfs */
+
+
+/* select featuretype */
+
+if(isset($_REQUEST["wfs"])){
+	
+	for($i=0; $i<count($aWFS->wfs_id);$i++){
+		if($aWFS->wfs_id[$i] == $_REQUEST["wfs"]){
+			echo "<table>";
+			echo "<tr><td>ID:</td><td>".$aWFS->wfs_id[$i]."</td></tr>";
+			echo "<tr><td>Name:</td><td>".$aWFS->wfs_name[$i]."</td></tr>";
+			echo "<tr><td>Title:</td><td>".$aWFS->wfs_title[$i]."</td></tr>";
+			echo "<tr><td>Abstract:</td><td>".$aWFS->wfs_abstract[$i]."</td></tr>";
+			echo "<tr><td>Capabilities:</td><td>".$aWFS->wfs_getcapabilities[$i]."</td></tr>";
+			echo "<tr><td>FeaturTypes:</td><td>".$aWFS->wfs_describefeaturetype[$i]."</td></tr>";
+			echo "<tr><td>Feature:</td><td>".$aWFS->wfs_getfeature[$i]."</td></tr>";
+			echo "</table>";
+		}
+	}
+	
+	$aWFS->getfeatures($_REQUEST["wfs"]);
+	echo "<table>";
+	for($i=0; $i<count($aWFS->features->featuretype_id); $i++){
+		echo "<tr>";
+		echo "<td><input type='radio' name='featuretype' value='".$aWFS->features->featuretype_id[$i]."' onclick='submit()' ";
+		if(isset($_REQUEST["featuretype"]) && $_REQUEST["featuretype"] == $aWFS->features->featuretype_id[$i]){
+			echo "checked ";
+		}
+		echo "/></td>";
+		echo "<td>".$aWFS->features->featuretype_name[$i]."</td>";
+		echo "</tr>";	
+	}
+	echo "</table>";
+}
+
+/* end select featuretype */
+
+/* configure elements */
+if(isset($_REQUEST["featuretype"])){
+	
+	
+	for($i=0; $i<count($aWFS->features->featuretype_id); $i++){
+		if($_REQUEST["featuretype"] == $aWFS->features->featuretype_id[$i]){
+			echo "<hr>SRS: ".$aWFS->features->featuretype_srs[$i];
+		}
+	}
+	
+	/* set featuretype options */
+	echo "<table>";
+	echo "<tr><td>Abstract:</td><td><input type='text' name='gazetteer_abstract'></td></tr>" ;
+	echo "<tr><td>Label:</td><td><input type='text' name='g_label'></td></tr>" ;
+	echo "<tr><td>Label_id:</td><td><input type='text' name='g_label_id'></td></tr>" ;
+	echo "<tr><td>Button:</td><td><input type='text' name='g_button'></td></tr>" ;
+	echo "<tr><td>Button_id:</td><td><input type='text' name='g_button_id'></td></tr>" ;
+	echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'></textarea></td></tr>" ;
+	echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer'></td></tr>" ;
+	echo "<tr><td>ResultStye:</td><td><textarea cols=50 rows=5 name='g_res_style'></textarea></td></tr>" ;
+	echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'></td></tr>";
+	echo "</table>";
+	
+	
+	/* set element options */
+	$aWFS->getelements($_REQUEST["featuretype"]);
+	echo "<table border='1'>";
+	echo "<tr>";
+		echo "<td>ID</td>";
+		echo "<td>name</td>";
+		echo "<td>type</td>";
+		echo "<td>search</td>";
+		echo "<td>pos</td>";
+		echo "<td>style_id</td>";
+		echo "<td>to_upper</td>";
+		echo "<td>label</td>";		
+		echo "<td>label_id</td>";
+		echo "<td>show</td>";
+		echo "<td>position</td>";
+	echo "</tr>";
+	
+	for($i=0; $i<count($aWFS->elements->element_id); $i++){
+		echo "<tr>";
+		echo "<td>".$aWFS->elements->element_id[$i]."<input type='hidden' name='f_id[]' value='".$aWFS->elements->element_id[$i]."'></td>";
+		echo "<td>".$aWFS->elements->element_name[$i]."</td>";
+		echo "<td>".$aWFS->elements->element_type[$i]."</td>";
+		echo "<td><input name='f_search[]' type='checkbox'></td>";
+		echo "<td><input name='f_pos[]' type='text' size='2'></td>";
+		echo "<td><input name='f_style_id[]' type='text' size='2'></td>";
+		echo "<td><input name='f_toupper[]' type='checkbox'></td>";
+		echo "<td><input name='f_label[]' type='text' size='10'></td>";		
+		echo "<td><input name='f_label_id[]' type='text' size='2'></td>";
+		echo "<td><input name='f_show[]' type='checkbox'></td>";
+		echo "<td><input name='f_respos[]' type='text' size='4'></td>";
+		echo "</tr>";	
+	}
+	echo "</table>";
+	echo "<input type='submit' name='save' value='save'>";
+}
+
+
+/* end configure elements */
+?>
+</form>
+</body>

Added: trunk/mapbender/http/php/mod_gazetteer_edit.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gazetteer_edit.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gazetteer_edit.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,166 @@
+<?php
+require("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>gazetteer</title>
+<script language="JavaScript" type="text/javascript">
+  function validate(){
+   	for(var i=0; i<document.forms[0].length; i++){
+  		if(document.forms[0].elements[i].type == 'checkbox'){
+   			if(document.forms[0].elements[i].checked){
+  				document.forms[0].elements[i].value = 1;
+  			}
+  			else{
+  				document.forms[0].elements[i].value = 0;
+  			}
+  			document.forms[0].elements[i].checked = true;
+  		}
+  	}
+  	return true;
+  }
+</script>
+    
+</head>
+<body>
+Gazetteer Configuration<br>
+<form method='POST' onsubmit='return validate()'>
+<a href="mod_gazetteer_conf.php">new</a><br>
+  
+<?php
+/* save gazetteer properties */
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+
+if(isset($_REQUEST["save"])){
+	
+	$sql = "UPDATE gazetteer SET ";
+	$sql .= "gazetteer_abstract = '".$_REQUEST["gazetteer_abstract"]."',";
+	$sql .= "g_label = '".$_REQUEST["g_label"]."',";
+	$sql .= "g_label_id = '".$_REQUEST["g_label_id"]."',";
+	$sql .= "g_button = '".$_REQUEST["g_button"]."',";
+	$sql .= "g_button_id = '".$_REQUEST["g_button_id"]."',";
+	$sql .= "g_style = '".$_REQUEST["g_style"]."',";
+	$sql .= "g_buffer = '".$_REQUEST["g_buffer"]."',";	
+	$sql .= "g_res_style = '".$_REQUEST["g_res_style"]."',";
+	$sql .= "g_use_wzgraphics = ".$_REQUEST["g_use_wzgraphics"];
+	$sql .= " WHERE gazetteer_id = ".$_REQUEST["gaz"].";";
+	$res = db_query($sql);		
+
+	for($i=0; $i<count($_REQUEST["f_id"]); $i++){
+		$sql = "UPDATE gazetteer_element SET ";		
+		$sql .= "f_search = '".$_REQUEST["f_search"][$i]."',";
+		$sql .= "f_pos = '".$_REQUEST["f_pos"][$i]."',";
+		$sql .= "f_style_id = '".$_REQUEST["f_style_id"][$i]."',";
+		$sql .= "f_toupper = '".$_REQUEST["f_toupper"][$i]."',";
+		$sql .= "f_label = '".$_REQUEST["f_label"][$i]."',";
+		$sql .= "f_label_id = '".$_REQUEST["f_label_id"][$i]."',";
+		$sql .= "f_show = '".$_REQUEST["f_show"][$i]."',";
+		$sql .= "f_respos = '".$_REQUEST["f_respos"][$i]."'";
+		$sql .= " WHERE fkey_gazetteer_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_id"][$i].";";
+		
+		$res = db_query($sql);
+	}		
+}
+
+/* end save gazetteer properties */
+
+/* select wfs */
+
+$sql = "SELECT * FROM gazetteer";
+$res = db_query($sql);
+echo "<select size='10' name='gaz' onchange='submit()'>";
+$cnt = 0;
+while($row = db_fetch_array($res)){
+	echo "<option value='".$row["gazetteer_id"]."' ";
+	if(isset($_REQUEST["gaz"]) && $row["gazetteer_id"] == $_REQUEST["gaz"]){
+		echo "selected";
+	}
+	echo ">".$row["gazetteer_abstract"]."</option>";
+	$cnt++;		
+}
+echo "</select>";
+
+
+
+/* end select wfs */
+
+
+
+/* configure elements */
+if(isset($_REQUEST["gaz"])){
+	$sql = "SELECT * FROM gazetteer WHERE gazetteer_id = ".$_REQUEST["gaz"];
+	$res = db_query($sql);
+	if($row = db_fetch_array($res)){	
+		echo "<table>";
+		echo "<tr><td>GazetterID:</td><td>".$row["gazetteer_id"]."</td></tr>" ;
+		echo "<tr><td>Abstract:</td><td><input type='text' name='gazetteer_abstract' value='".$row["gazetteer_abstract"]."'></td></tr>" ;
+		echo "<tr><td>Label:</td><td><input type='text' name='g_label' value='".$row["g_label"]."'></td></tr>" ;
+		echo "<tr><td>Label_id:</td><td><input type='text' name='g_label_id' value='".$row["g_label_id"]."'></td></tr>" ;
+		echo "<tr><td>Button:</td><td><input type='text' name='g_button' value='".$row["g_button"]."'></td></tr>" ;
+		echo "<tr><td>Button_id:</td><td><input type='text' name='g_button_id' value='".$row["g_button_id"]."'></td></tr>" ;
+		echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'>".$row["g_style"]."</textarea></td></tr>" ;
+		echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='".$row["g_buffer"]."'></td></tr>" ;
+		echo "<tr><td>ResultStyle:</td><td><textarea cols=50 rows=5 name='g_res_style'>".$row["g_res_style"]."</textarea></td></tr>" ;
+		echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'";
+		if($row["g_use_wzgraphics"] == 1){ echo " checked"; }
+		echo "></td></tr>";
+		echo "</table>";
+	}
+	
+	/* set element options */
+	$sql = "SELECT * FROM gazetteer_element ";
+	$sql .= "JOIN wfs_element ON gazetteer_element.f_id = wfs_element.element_id ";
+	$sql .= "WHERE fkey_gazetteer_id = ".$_REQUEST["gaz"];
+	echo $sql;
+	$res = db_query($sql);
+	
+	echo "<table border='1'>";
+	echo "<tr>";
+		echo "<td>ID</td>";
+		echo "<td>name</td>";
+		echo "<td>type</td>";
+		echo "<td>search</td>";
+		echo "<td>pos</td>";
+		echo "<td>style_id</td>";
+		echo "<td>to_upper</td>";
+		echo "<td>label</td>";		
+		echo "<td>label_id</td>";
+		echo "<td>show</td>";
+		echo "<td>position</td>";
+	echo "</tr>";
+	$cnt = 0;	
+	while($row = db_fetch_array($res)){
+		echo "<tr>";
+		echo "<td><input type='text' size='4' name='f_id[]' value='".$row["f_id"]."' readonly></td>";
+		echo "<td>".$row["element_name"]."</td>";
+		echo "<td>".$row["element_type"]."</td>";
+		echo "<td><input name='f_search[]' type='checkbox'";
+		if($row["f_search"] == 1){ echo " checked"; }
+		echo "></td>";
+		echo "<td><input name='f_pos[]' type='text' size='2' value='".$row["f_pos"]."'></td>";
+		echo "<td><input name='f_style_id[]' type='text' size='2' value='".$row["f_style_id"]."'></td>";
+		echo "<td><input name='f_toupper[]' type='checkbox'";
+		if($row["f_toupper"] == 1){ echo " checked"; }
+		echo "></td>";
+		echo "<td><input name='f_label[]' type='text' size='10' value='".$row["f_label"]."'></td>";		
+		echo "<td><input name='f_label_id[]' type='text' size='2' value='".$row["f_label_id"]."'></td>";
+		echo "<td><input name='f_show[]' type='checkbox'";
+		if($row["f_show"] == 1){ echo " checked"; }
+		echo "></td>";
+		echo "<td><input name='f_respos[]' type='text' size='4' value='".$row["f_respos"]."'></td>";
+		echo "</tr>";
+		$cnt++;	
+	}
+	echo "</table>";
+	echo "<input type='submit' name='save' value='save'>";
+}
+
+
+/* end configure elements */
+?>
+</form>
+</body>

Added: trunk/mapbender/http/php/mod_getStyles.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_getStyles.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_getStyles.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,163 @@
+<?php
+	
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+$pattern = "admin_name";
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>SLD Get Styles</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+<!-- 
+body{
+   background-color: #ffffff;
+}
+.button_del{
+   color: red;
+ 
+}
+.textfield{
+ 
+}
+.wmsList{
+
+   	width:200px
+} 
+-->
+</style>
+<script type="text/javascript">
+<!--
+function validate(){
+	var ind = document.form1.wmsList.selectedIndex;
+
+	document.form1.getstyle.value = 1;
+	document.form1.submit();
+}
+// -->
+</script>
+</head>
+<body>
+<?php
+###delete
+if($wmsList && $getstyle == '1'){
+	
+function proxy_url($proxy_url)
+{
+   global $proxy_name,$proxy_port,$proxy_cont,$proxy_user,$proxy_pass;
+//echo $proxy_user;
+   $proxy_fp = fsockopen($proxy_name, $proxy_port) or die ("Fehler beim öffnen der Verbindung zum Proxy");
+   if (!$proxy_fp)    {return false;}
+      $headers = "GET $proxy_url HTTP/1.0\r\nHost: $proxy_name\r\n";
+   $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($proxy_user . ':' . $proxy_pass)."\r\nConnection: Keep-Alive\r\n\r\n";
+   fputs($proxy_fp, $headers);   
+   while(!feof($proxy_fp)) 
+   {$proxy_cont .= fread($proxy_fp,4096);   
+   }
+   fclose($proxy_fp);
+   $proxy_cont = substr($proxy_cont, strpos($proxy_cont,"\r\n\r\n")+4);
+   return $proxy_cont;
+} 
+
+
+/* Sends an http request to www.example.com
+   with additional headers shown above */
+//$fp = fopen('http://www.example.com', 'r', false, $context);
+	
+	$style_xml = proxy_url($url) or die("Error: ". $ur . " .. no valid resource");
+	#echo "<pre>";
+	#echo $style_xml;
+	#echo "</pre>";
+	#$style_content = fread($style_xml);
+	#<ogc:PropertyName>admin_name</ogc:PropertyName><ogc:Literal>Brandenburg</ogc:Literal>
+	
+	$style_filename = "../getstyles/wms_".$wmsList.".php";
+	$style_file = fopen($style_filename,"w") or die ($style_filename." not writable!");
+	if(!is_writable($style_filename)){
+		echo $style_filename."not writable!!!<br>";
+	}
+	$cnt_line = 0;
+	fwrite($style_file, "<".chr(63)."php echo '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\" ?>'; ".chr(63).">\r\n");
+	//while(!feof($style_xml)){
+		//$line = str_replace("md5userid", "<".chr(63)."php echo ".chr(36)."_REQUEST['id']; ".chr(63).">",fgets($style_xml));
+		
+		fwrite($style_file, $style_xml);
+		#echo fgets($style_xml);
+		//$cnt_line++;
+	//}
+	#fputs($style_file, $style_content) or die ($style_filename." not writable");
+	
+	
+	@fclose($style_xml);
+	fclose($style_file);
+	#include("../../conf/www.conf");
+	$sql = "UPDATE wms SET wms_filter = '".str_replace(basename($login),$style_filename,$login)."' WHERE wms_id = ". $wmsList;
+	echo $sql;
+	db_query($sql) or die("unable to change filter!");	
+}
+###
+
+$sql = "SELECT * FROM wms ORDER BY wms_title";
+$res = db_query($sql);
+$cnt = 0;
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+echo "<select class='wmsList' size='20' name='wmsList' class='wmsList' onchange='submit()'>";
+while($row = db_fetch_array($res)){
+	# getStyle - Request:
+	if($wmsList && $row["wms_id"] == $wmsList){
+		$getStyle = $row["wms_getmap"]."&VERSION=1.1.1&REQUEST=getStyles&SERVICE=WMS&LAYERS=";
+		$sql_style = "SELECT layer_name FROM layer WHERE fkey_wms_id = " . $wmsList;
+		$res_style = db_query($sql_style);
+	
+		$cnt_style = 0;
+		while($row2 = db_fetch_array($res_style)){
+			if($cnt_style > 0){
+				if($cnt_style > 1){
+					$getStyle .= ",";
+				}
+				$getStyle .= $row2["layer_name"];
+			}
+			$cnt_style++;
+		}
+	}
+	echo "<option value='".$row["wms_id"]."' ";
+	if($row["wms_id"] == $wmsList){
+		echo "selected";
+	}
+	echo ">".$row["wms_title"]."</option>";
+	$cnt++;
+}
+echo "</select><br>";
+echo "<textarea class='textfield' name='url' cols='70' rows='3' wrap='virtual'>".$getStyle."</textarea><br>";
+echo "<input class='button_del' type='button' value='getStyle' onclick='validate()'><br>";
+if($style_filename){
+	$style_file = fopen($style_filename,"r");
+	while(!feof($style_file)){
+		$content = str_replace("<","&lt;",fgets($style_file));
+		echo str_replace(">","&gt;",$content)."<br>";
+	}
+	fclose($style_file);
+}
+?>
+<input type='hidden' name='getstyle'>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_group_filteredGui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_group_filteredGui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_group_filteredGui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,221 @@
+<?php
+#$Id: mod_group_filteredGui.php,v 1.15 2006/03/09 11:16:50 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_group_filteredGui.php,v 1.15 2006/03/09 11:16:50 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI Permissions</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+			document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_mb_group_id, fkey_gui_id) VALUES('$selected_group', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get allocated gui  ********************************************************************************************/
+#$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+#$sql_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id ";
+#$sql_gui .= "FROM gui INNER JOIN gui_mb_user ON gui.gui_id = gui_mb_user.fkey_gui_id ";
+#$sql_gui .= "WHERE gui_mb_user.fkey_mb_user_id='".$logged_user_id."'";
+
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_gui .= ",";}
+	$sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get all group **********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get allocated gui from selected_group******************************************************************************/
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+
+$sql_group_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_group.fkey_mb_group_id FROM gui_mb_group ";
+$sql_group_mb_gui .= "INNER JOIN gui ON gui_mb_group.fkey_gui_id = gui.gui_id ";
+$sql_group_mb_gui .= "WHERE gui_mb_group.fkey_mb_group_id=";
+if(!$selected_group){$sql_group_mb_gui .= $group_id[0];}
+if($selected_group){$sql_group_mb_gui .= $selected_group;}
+
+$sql_group_mb_gui .= " AND gui.gui_id IN (";
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_group_mb_gui .= ",";}
+	$sql_group_mb_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_group_mb_gui .= ") ORDER BY gui.gui_name";
+
+
+$res_group_mb_gui = db_query($sql_group_mb_gui);
+while($row = db_fetch_array($res_group_mb_gui)){
+	$gui_id_group[$cnt_gui_group] = $row["gui_id"];
+	$gui_name_group[$cnt_gui_group] =  $row["gui_name"];
+	$cnt_gui_group++;
+}
+
+
+
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all group in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert group_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_group; $i++){
+	echo "<option value='" . $gui_id_group[$i]  . "'>" . $gui_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_group_filteredUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_group_filteredUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_group_filteredUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,190 @@
+<?php
+#$Id: mod_group_filteredUser.php,v 1.14 2006/03/09 11:17:09 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_group_filteredUser.php,v 1.14 2006/03/09 11:17:09 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Group Members</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+		document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_group_id, fkey_mb_user_id) VALUES('$selected_group', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get all group  ********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get owner user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+#$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get only owner user from selected group******************************************************************************/
+$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+$sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= '";
+
+if(!$selected_group){$sql_mb_user_mb_group .= $group_id[0];}
+if($selected_group){$sql_mb_user_mb_group .= $selected_group;}
+$sql_mb_user_mb_group .= "' AND  mb_user.mb_user_owner = '".$logged_user_id."'";
+$sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
+$res_mb_user_mb_group = db_query($sql_mb_user_mb_group);
+while($row = db_fetch_array($res_mb_user_mb_group)){
+	$user_id_group[$cnt_group_user] = $row["mb_user_id"];
+	$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+	$cnt_group_user++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert projects in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all profiles in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+                 for($i=0; $i<$cnt_user; $i++){
+                                  echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_group_gui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_group_gui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_group_gui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,186 @@
+<?php
+#$Id: mod_group_gui.php,v 1.15 2006/03/09 10:52:03 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_group_gui.php,v 1.15 2006/03/09 10:52:03 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI Permissions</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+			document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$exists = false;
+
+$gui_id_array = array();
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_mb_group_id, fkey_gui_id) VALUES('$selected_group', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get all group **********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all gui from selected_group******************************************************************************/
+$sql_group_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_group.fkey_mb_group_id FROM gui_mb_group ";
+$sql_group_mb_gui .= "INNER JOIN gui ON gui_mb_group.fkey_gui_id = gui.gui_id ";
+$sql_group_mb_gui .= "WHERE gui_mb_group.fkey_mb_group_id=";
+
+if(!$selected_group){$sql_group_mb_gui .= $group_id[0];}
+if($selected_group){$sql_group_mb_gui .= $selected_group;}
+$sql_group_mb_gui .= " ORDER BY gui.gui_name";
+$res_group_mb_gui = db_query($sql_group_mb_gui);
+while($row = db_fetch_array($res_group_mb_gui)){
+	$gui_id_group[$cnt_gui_group] = $row["gui_id"];
+	$gui_name_group[$cnt_gui_group] =  $row["gui_name"];
+	$cnt_gui_group++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all group in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert group_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_group; $i++){
+	echo "<option value='" . $gui_id_group[$i]  . "'>" . $gui_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_group_user.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_group_user.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_group_user.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,186 @@
+<?php
+#$Id: mod_group_user.php,v 1.14 2006/03/09 10:52:52 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_group_user.php,v 1.14 2006/03/09 10:52:52 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit Group Members</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_group"].selectedIndex == -1){
+		document.getElementsByName("selected_group")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = '".$selected_group."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_group_id, fkey_mb_user_id) VALUES('$selected_group', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_mb_group_id = '$selected_group'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get all group  ********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get all user from selected group******************************************************************************/
+$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+$sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= '";
+
+if(!$selected_group){$sql_mb_user_mb_group .= $group_id[0];}
+if($selected_group){$sql_mb_user_mb_group .= $selected_group;}
+$sql_mb_user_mb_group .= "' ORDER BY mb_user.mb_user_name";
+$res_mb_user_mb_group = db_query($sql_mb_user_mb_group);
+while($row = db_fetch_array($res_mb_user_mb_group)){
+	$user_id_group[$cnt_group_user] = $row["mb_user_id"];
+	$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+	$cnt_group_user++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert projects in selectbox*************************************************************************************/
+echo "<div class='text1'>GROUP: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_group' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i] . "' ";
+	if($selected_group && $selected_group == $group_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all profiles in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_gui_filteredGroup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gui_filteredGroup.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gui_filteredGroup.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,194 @@
+<?php
+#$Id: mod_gui_filteredGroup.php,v 1.15 2006/03/09 10:40:17 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_gui_filteredGroup.php,v 1.15 2006/03/09 10:40:17 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI Permissions</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+			document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_group where fkey_gui_id = '".$selected_gui."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_gui_id, fkey_mb_group_id) VALUES('$selected_gui', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_gui_id = '$selected_gui'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get owner groups **********************************************************************************************/
+#$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] =  $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get owner groups from selected gui******************************************************************************/
+$sql_gui_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, gui_mb_group.fkey_gui_id FROM gui_mb_group ";
+$sql_gui_group .= "INNER JOIN mb_group ON gui_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_gui_group .= "WHERE gui_mb_group.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_group .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_group .= $selected_gui;}
+$sql_gui_group .= "' AND mb_group.mb_group_owner = '".$logged_user_id."'";
+$sql_gui_group .= " ORDER BY mb_group.mb_group_name";
+$res_gui_group = db_query($sql_gui_group);
+while($row = db_fetch_array($res_gui_group)){
+	$group_id_gui[$cnt_gui_group] = $row["mb_group_id"];
+	$group_name_gui[$cnt_gui_group] =  $row["mb_group_name"];
+	$cnt_gui_group++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert guis in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all groups in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div><br>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert gui_group_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_group; $i++){
+	echo "<option value='" . $group_id_gui[$i]  . "'>" . $group_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_gui_filteredUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gui_filteredUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gui_filteredUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,197 @@
+<?php
+#$Id: mod_gui_filteredUser.php,v 1.15 2006/03/09 12:19:32 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_gui_filteredUser.php,v 1.15 2006/03/09 12:19:32 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI Permissions</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+			document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+#echo $_SESSION["mb_user_name"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+            $exists = false;
+            $sql_insert = "SELECT * from gui_mb_user where fkey_gui_id = '".$selected_gui."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+            $res_insert = db_query($sql_insert);
+            while(db_fetch_row($res_insert)){$exists = true;}
+            if($exists == false){
+                $sql_insert = "INSERT INTO gui_mb_user(fkey_gui_id, fkey_mb_user_id) VALUES('$selected_gui', '".$selected_user[$i]."');";
+                $res_insert = db_query($sql_insert);
+            }
+		}
+	}
+}
+if($remove){
+    if(count($remove_user)>0){
+        for($i=0; $i<count($remove_user); $i++){
+            $sql_remove = "DELETE FROM gui_mb_user WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_gui_id = '$selected_gui'";
+            db_query($sql_remove);
+        }
+    }
+}
+
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+    $gui_id_array[$cnt_gui] = $row["gui_id"];
+    $gui_name[$cnt_gui] = $row["gui_name"];
+    $cnt_gui++;
+}
+
+/*get only owner user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user WHERE mb_user_owner=".$logged_user_id." ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get only owner user from selected gui******************************************************************************/
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_mb_user .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_mb_user .= $selected_gui;}
+#$sql_gui_mb_user .= "' AND  gui_mb_user.fkey_mb_user_id <> '".$logged_user_id."'";
+$sql_gui_mb_user .= "' AND  mb_user.mb_user_owner = '".$logged_user_id."'";
+$sql_gui_mb_user .= " ORDER BY mb_user.mb_user_name";
+$res_gui_mb_user = db_query($sql_gui_mb_user);
+while($row = db_fetch_array($res_gui_mb_user)){
+	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
+	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$cnt_gui_user++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert guis in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*insert all user in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert gui_user_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_gui_group.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gui_group.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gui_group.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,187 @@
+<?php
+#$Id: mod_gui_group.php,v 1.15 2006/03/09 12:19:11 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_gui_group.php,v 1.15 2006/03/09 12:19:11 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI Permissions</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+		document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_group = 0;
+$cnt_group = 0;
+$cnt_gui_group = 0;
+$cnt_gui_group = 0;
+$gui_id_array=array();
+$exists = false;
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_group where fkey_gui_id = '".$selected_gui."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_group(fkey_gui_id, fkey_mb_group_id) VALUES('$selected_gui', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM gui_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_gui_id = '$selected_gui'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get all groups **********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] =  $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all groups from selected gui******************************************************************************/
+$sql_gui_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, gui_mb_group.fkey_gui_id FROM gui_mb_group ";
+$sql_gui_group .= "INNER JOIN mb_group ON gui_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_gui_group .= "WHERE gui_mb_group.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_group .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_group .= $selected_gui;}
+$sql_gui_group .= "' ORDER BY mb_group.mb_group_name";
+$res_gui_group = db_query($sql_gui_group);
+while($row = db_fetch_array($res_gui_group)){
+	$group_id_gui[$cnt_gui_group] = $row["mb_group_id"];
+	$group_name_gui[$cnt_gui_group] =  $row["mb_group_name"];
+	$cnt_gui_group++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert guis in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onChange='submit()' size='10'>";
+                 for($i=0; $i<$cnt_gui; $i++){
+                                  echo "<option value='" . $gui_id_array[$i] . "' ";
+                                 if($selected_gui && $selected_gui == $gui_id_array[$i]){
+                                   echo "selected";
+                                 }
+                                 echo ">" . $gui_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*insert all groups in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div><br>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+                 for($i=0; $i<$cnt_group; $i++){
+                                  echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+                 }
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert gui_group_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+                 for($i=0; $i<$cnt_gui_group; $i++){
+                                  echo "<option value='" . $group_id_gui[$i]  . "'>" . $group_name_gui[$i]  . "</option>";
+                 }
+echo "</select>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_gui_owner.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gui_owner.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gui_owner.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,200 @@
+<?php
+#$Id: mod_gui_owner.php,v 1.15 2006/03/09 11:21:51 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_gui_owner.php,v 1.15 2006/03/09 11:21:51 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+require_once("../php/mb_validateSession.php");
+import_request_variables("PG");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit User Owner</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+			document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+			return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.background = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.background = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$gui_id_array = array();
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0 && count($selected_gui)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_gui_id = '".$selected_gui."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_gui_id, fkey_mb_user_id) VALUES('$selected_gui', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+			$sql_set_owner = "UPDATE gui_mb_user SET mb_user_type = 'owner' WHERE fkey_gui_id = '".$selected_gui."' AND fkey_mb_user_id = ".$selected_user[$i];
+			$res_set_owner = db_query($sql_set_owner);
+		}
+	}
+	
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_gui_id = '$selected_gui'";
+			$sql_remove = "UPDATE gui_mb_user SET mb_user_type = '' WHERE fkey_gui_id = '".$selected_gui."' AND fkey_mb_user_id = ".$remove_user[$i];
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get own guis  ********************************************************************************************/
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+if (count($ownguis)>0){
+	$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+	for($i=0; $i<count($ownguis); $i++){
+		if($i>0){ $sql_gui .= ",";}
+		$sql_gui .= "'".$ownguis[$i]."'";
+	}
+	$sql_gui .= ") ORDER BY gui_name";
+	$res_gui = db_query($sql_gui);
+	while($row = db_fetch_array($res_gui)){
+		$gui_id_array[$cnt_gui] = $row["gui_id"];
+		$gui_name[$cnt_gui] = $row["gui_name"];
+		$cnt_gui++;
+	}
+	
+	/*get all user **********************************************************************************************/
+	$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+	$res_user = db_query($sql_user);
+	while($row = db_fetch_array($res_user)){
+		$user_id[$cnt_user] = $row["mb_user_id"];
+		$user_name[$cnt_user] =  $row["mb_user_name"];
+		$cnt_user++;
+	}
+
+/*get all user from selected gui******************************************************************************/
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_mb_user .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_mb_user .= $selected_gui;}
+$sql_gui_mb_user .= "' AND gui_mb_user.mb_user_type = 'owner' ORDER BY mb_user.mb_user_name";
+$res_gui_mb_user = db_query($sql_gui_mb_user);
+while($row = db_fetch_array($res_gui_mb_user)){
+	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
+	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$cnt_gui_user++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+
+/*insert projects in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onchange='submit()' size='10'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all profiles in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+	for($i=0; $i<$cnt_user; $i++){
+		echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>OWNER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+}else{
+		echo "There are no guis available for this user.<br>";
+}
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_gui_user.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_gui_user.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_gui_user.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,189 @@
+<?php
+#$Id: mod_gui_user.php,v 1.15 2006/03/09 10:50:23 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_gui_user.php,v 1.15 2006/03/09 10:50:23 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit GUI Permissions</title>
+
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_gui"].selectedIndex == -1){
+		document.getElementsByName("selected_gui")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_user[]"].selectedIndex == -1){
+				document.getElementsByName("remove_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_user[]"].selectedIndex == -1){
+				document.getElementsByName("selected_user[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$gui_id_array = array();
+$exists = false;
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_user)>0){
+		for($i=0; $i<count($selected_user); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_gui_id = '".$selected_gui."' and fkey_mb_user_id = '".$selected_user[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_gui_id, fkey_mb_user_id) VALUES('$selected_gui', '".$selected_user[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_mb_user_id = '".$remove_user[$i]."' and fkey_gui_id = '$selected_gui'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get all user from selected gui******************************************************************************/
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
+$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= '";
+
+if(!$selected_gui){$sql_gui_mb_user .= $gui_id_array[0];}
+if($selected_gui){$sql_gui_mb_user .= $selected_gui;}
+$sql_gui_mb_user .= "' ORDER BY mb_user.mb_user_name";
+$res_gui_mb_user = db_query($sql_gui_mb_user);
+while($row = db_fetch_array($res_gui_mb_user)){
+	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
+	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$cnt_gui_user++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert projects in selectbox*************************************************************************************/
+echo "<div class='text1'>GUI: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_gui' onchange='submit()' size='10'>";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i] . "' ";
+	if($selected_gui && $selected_gui == $gui_id_array[$i]){
+		echo "selected";
+	}
+	echo ">" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all profiles in selectbox**************************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_gui.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_loadCapabilities.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadCapabilities.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadCapabilities.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,183 @@
+<?php
+#$Id: mod_loadCapabilities.php,v 1.14 2006/04/05 12:27:47 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadCapabilities.php,v 1.14 2006/04/05 12:27:47 astrid_emde Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+
+include("../php/mb_validateSession.php");
+include("../../conf/mapbender.conf");
+import_request_variables("PG");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WMS</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+  	a:link{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		text-decoration : none;
+  		color: #808080;
+  	}
+  	a:visited {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	a:active {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+   if(wert == 'guiList'){
+      var listIndex = document.form1.guiList.selectedIndex;
+      if(listIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      else{
+         var gui_id=document.form1.guiList.options[listIndex].value;
+			document.form1.action='../php/mod_loadwms.php';
+			document.form1.submit();
+      }
+   }
+}
+</script>
+</head>
+<body>
+
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+
+echo "<table cellpadding='0' cellspacing='0' border='0'>";
+echo "<tr>";
+echo "<td>";
+if (count($ownguis)>0){
+	echo"GUI";
+	echo"<br>";
+	$sql = "SELECT * FROM gui WHERE gui_id IN ("; 
+	for($i=0; $i<count($ownguis); $i++){
+	if($i>0){ $sql .= ",";}
+		$sql .= "'".$ownguis[$i]."'";
+	}
+	$sql .= ") ORDER BY gui_name";
+	
+	
+	$res = db_query($sql);
+	#echo $res;
+	#echo $sql;
+	#echo db_numrows($res);
+	#$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"];
+		
+		echo "<option value='".$row["gui_id"]."' ";
+		   if($guiList && $guiList == $row["gui_name"]){
+	         echo "selected";}
+	          echo ">".$row["gui_name"]."</option>";
+	          #$count++;
+	} 
+	  $arrayGUIs=$_SESSION["mb_user_guis"];
+	  echo count($arrayGUIs);
+	echo "</select><br><br>";
+	
+	echo "</td>";
+	echo "<td>";
+	echo"WMS";
+	echo"<br>";
+	###
+	
+	
+	If (isset($guiList) && $guiList!=""){
+	  $sql="SELECT Distinct wms.wms_title,gui_wms_position from gui_wms JOIN gui on gui_wms.fkey_gui_id=gui.gui_id JOIN wms ON gui_wms.fkey_wms_id=wms.wms_id and gui_wms.fkey_gui_id=gui.gui_id where gui.gui_name='".$guiList."' order by gui_wms_position";
+	  $res = db_query($sql);
+	  $count=0;
+	  echo"<select size='8' name='wmsList' style='width:200px'>";
+	
+	  while($row = db_fetch_array($res)){
+	  	if ($row["wms_title"]!=""){
+		echo "<option value='' ";
+	    echo ">".$row["wms_title"]."</option>";
+		}
+		$count++;
+	  }
+	    echo "</select><br><br>";
+	}else{
+	  echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
+	  echo "</select><br><br>";
+	}
+	echo "</td>";
+	echo "<tr></table><br>";
+	echo "Add the following REQUEST to the Online Resource URL to obtain the Capabilities document:<br>";
+	echo "<i>(Triple click to select and copy)</i><br>"; 
+	echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1<br>";
+	echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0<br>";
+	echo "REQUEST=capabilities&WMTVER=1.0.0<br><br>";
+	echo "Link to WMS Capabilities URL:<br>";
+	#echo "Load WMS capabilities URL:<br>"
+	
+	if (isset($xml_file)){
+		echo"<input type='text' name='xml_file' size='50' value='".$xml_file."'>";
+	}else{
+		echo"<input type='text' name='xml_file' size='50' value='http://'>";
+	}
+	echo"<input type='button' name='loadCap' value='Load' onClick='validate(\"guiList\")'>";
+	echo "</form>";
+}else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_loadCapabilitiesList.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadCapabilitiesList.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadCapabilitiesList.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,261 @@
+<?php
+#$Id: mod_loadCapabilitiesList.php,v 1.13 2006/03/09 10:57:29 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadCapabilitiesList.php,v 1.13 2006/03/09 10:57:29 uli_rothstein Exp $
+session_start();
+include("../../conf/mapbender.conf");
+include("../php/mb_validateSession.php");
+import_request_variables("PG");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WMS from Catalog</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+.text1{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:190px;
+}
+.select1{
+   position:absolute;
+   top:210px;
+   width:270px;
+}
+.text2{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:190px;
+   left:300px;
+}
+.select2{
+   position:absolute;
+   top:210px;
+   left:300px;
+}
+.getcapabilities{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:570px;
+}
+
+  	-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+   if(wert == 'guiList'){
+      var listIndex = document.form1.guiList.selectedIndex;
+      if(listIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      else{
+         var gui_id=document.form1.guiList.options[listIndex].value;
+			document.form1.action='../php/mod_loadwms.php';
+			document.form1.submit();
+      }
+   }
+}
+function load(){
+      if(document.form1.guiList.selectedIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      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+" ?");
+      if(permission == true){
+         document.form1.submit();
+      }
+      else{
+         document.form1.guiID.selectedIndex = -1;
+      }
+}
+</script>
+</head>
+<body>
+
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+
+
+
+###INSERT
+if(isset($wmsID) && isset($guiID)){
+
+   $sql_pos = "SELECT MAX(gui_wms_position) AS my_gui_wms_position FROM gui_wms WHERE fkey_gui_id = '".$guiList."'";
+   $res_pos = db_query($sql_pos);
+   if(db_result($res_pos,0,"my_gui_wms_position") > -1){
+      $gui_wms_position = db_result($res_pos,0,"my_gui_wms_position") + 1;
+   }
+   else{
+      $gui_wms_position = 0;
+   }
+
+#echo $gui_wms_position."<br>";
+   $sql = "SELECT * FROM gui_wms WHERE fkey_gui_id = '".$guiID."' AND fkey_wms_id = ".$wmsID;
+   $res = db_query($sql);
+   $cnt = 0;
+   while($row = db_fetch_array($res)){
+      $sql_ins = "INSERT INTO gui_wms (fkey_gui_id,fkey_wms_id,gui_wms_position,gui_wms_mapformat,gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible) ";
+      $sql_ins .= "VALUES ('".$guiList."',".$wmsID.",".$gui_wms_position.",'".$row["gui_wms_mapformat"]."','".$row["gui_wms_featureinfoformat"]."','".$row["gui_wms_exceptionformat"]."','".$row["gui_wms_epsg"]."',".$row["gui_wms_visible"].")";
+      #echo $sql_ins."<br>";
+      db_query($sql_ins);
+      $cnt++;
+   }
+
+   $sql = "SELECT * FROM gui_layer WHERE fkey_gui_id = '".$guiID."' AND gui_layer_wms_id = ".$wmsID;
+   $res = db_query($sql);
+   $cnt = 0;
+   while($row = db_fetch_array($res)){
+      $sql_ins = "INSERT INTO gui_layer (fkey_gui_id,fkey_layer_id,gui_layer_wms_id,gui_layer_status,gui_layer_selectable,";
+      $sql_ins .= "gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_priority) ";
+      $sql_ins .= "VALUES ('".$guiList."',".$row["fkey_layer_id"].",".$wmsID.",".$row["gui_layer_status"];
+      $sql_ins .= ",".$row["gui_layer_selectable"].",".$row["gui_layer_visible"];
+      $sql_ins .= ",".$row["gui_layer_queryable"].",".$row["gui_layer_querylayer"];
+      $sql_ins .= ",".$row["gui_layer_minscale"].",".$row["gui_layer_maxscale"].",".$row["gui_layer_priority"].")";
+      #echo $sql_ins."<br>";
+      db_query($sql_ins);
+      $cnt++;
+   }    #die;
+}
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+
+echo "<table cellpadding='0' cellspacing='0' border='0'>";
+echo "<tr>";
+echo "<td>";
+if (count($ownguis)>0){
+	echo"GUI";
+	echo"<br>";
+	#$sql = "SELECT * from gui_mb_user, gui WHERE gui.gui_id=gui_mb_user.fkey_gui_id AND gui.gui_public=1 AND gui_mb_user.fkey_mb_user_id=".$_SESSION["mb_user_id"]."  Order BY fkey_gui_id ;";
+	 
+	$sql = "SELECT * FROM gui WHERE gui_id IN (";
+	 for($i=0; $i<count($ownguis); $i++){
+		if($i>0){ $sql .= ",";}
+		$sql .= "'".$ownguis[$i]."'";
+	}
+	$sql .= ") ORDER BY gui_name";
+
+	
+	$res = db_query($sql);
+	$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++;
+		echo "<option value='".$row["gui_id"]."' ";
+		   if($guiList && $guiList == $row["gui_name"]){
+	         echo "selected";
+	      }
+	      echo ">".$row["gui_name"]."</option>";
+	}
+	
+	  $arrayGUIs=$_SESSION["mb_user_guis"];
+	  echo count($arrayGUIs);
+	echo "</select><br><br>";
+	
+	echo "</td>";
+	echo "<td>";
+	echo"WMS";
+	echo"<br>";
+	###
+	
+	
+	If (isset($guiList) && $guiList!=""){
+	  $sql="SELECT Distinct wms.wms_title, gui_wms_position from gui_wms JOIN gui ON gui_wms.fkey_gui_id=gui.gui_id JOIN wms ON gui_wms.fkey_wms_id=wms.wms_id and gui_wms.fkey_gui_id=gui.gui_id where gui.gui_name='".$guiList."' order by gui_wms_position";
+	  $res = db_query($sql);
+	
+	  $count=0;
+	  echo"<select size='8' name='wmsList' style='width:200px'>";
+	
+	  while($row = db_fetch_array($res)){
+	  	if ($row["wms_title"]!=""){
+		echo "<option value='' ";
+	    echo ">".$row["wms_title"]."</option>";
+		}
+		$count++;
+	  }
+	    echo "</select><br><br>";
+	}else{
+	  echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
+	  echo "</select><br><br>";
+	}
+	echo "</td>";
+	echo "<tr></table><br>";
+	
+	echo"<div class='text1'>Load WMS</div>";
+	$sql = "SELECT DISTINCT wms.wms_id,wms.wms_title,wms.wms_abstract FROM gui_wms JOIN wms ON wms.wms_id = gui_wms.fkey_wms_id WHERE gui_wms.fkey_gui_id IN(";
+	for($i=0; $i<count($arrayGUIs); $i++){
+	   if($i>0){$sql .= ",";}
+	   $sql .= "'".$arrayGUIs[$i]."'";
+	}
+	$sql .= ") ORDER BY wms.wms_title";
+	//echo $sql;
+	$res = db_query($sql);
+	echo "<select class='select1' name='wmsID' size='20' onchange='submit()'>";
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+	   echo "<option value='".$row["wms_id"]."' ";
+	   if(isset($wmsID) && $wmsID == $row["wms_id"]){
+	      echo "selected";
+	      $wms_getcapabilities = $row["wms_getcapabilities"];
+	   }
+	   echo ">".$row["wms_title"]."</option>";
+	   $cnt++;
+	}
+	echo "</select>";
+	
+	if(isset($wmsID)){
+	   echo "<div class='text2'>FROM:</div>";
+	   $sql = "SELECT * from gui_wms WHERE fkey_wms_id ='".$wmsID."' ORDER BY fkey_gui_id";
+	   $res = db_query($sql);
+	
+	   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"]."' ";
+	      echo ">".$row["fkey_gui_id"]."</option>";
+	      $cnt++;
+	   }
+	echo "</select>";
+}
+echo "</form>";
+}else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_loadCapabilities_temp.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadCapabilities_temp.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadCapabilities_temp.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,105 @@
+<?php
+#$Id: mod_loadCapabilities_temp.php,v 1.11 2006/03/09 11:22:56 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadCapabilities_temp.php,v 1.11 2006/03/09 11:22:56 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+include("../php/mb_validateSession.php");
+require_once("mb_validateInput.php");
+include("../../conf/mapbender.conf");
+import_request_variables("PG");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WMS Capabilities</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #fbc327;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+  	a:link{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		text-decoration : none;
+  		color: #808080;
+  	}
+  	a:visited {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	a:active {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+			var gui_id= document.form1.gui_id.value; 
+			document.form1.action='../php/mod_loadwms_temp.php';
+			document.form1.submit();
+			var main = parent.window.location;
+			main.reload();
+}
+//location.reload() target="_self">reload page</a>
+
+</script>
+</head>
+<body>
+
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+
+$gui_id = $_SESSION["mb_user_gui"];
+
+echo "<input type='hidden'name='gui_id' value='".$gui_id."'>";
+
+echo"WMS hinzuladen<br>";
+if (isset($xml_file)){
+	echo"<input type='text' name='xml_file' size='50' value='".$xml_file."'>";
+}else{
+	echo"<input type='text' name='xml_file' size='50' value='http://'>";
+}
+echo"<input type='button' name='loadCap' value='Laden' onClick='validate(\"guiList\")'>";
+echo "</form>";
+#echo "<a href='javascript:location.reload()' target='_parent'>reload page</a>";
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_loadWFSCapabilities.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadWFSCapabilities.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadWFSCapabilities.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,147 @@
+<?php
+#$Id: mod_loadWFSCapabilities.php,v 1.14 2006/04/05 08:18:37 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadWFSCapabilities.php,v 1.14 2006/04/05 08:18:37 astrid_emde Exp $
+session_start();
+
+include("../php/mb_validateSession.php");
+include("../../conf/mapbender.conf");
+import_request_variables("PG");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WFS Capabilities</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+  	a:link{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		text-decoration : none;
+  		color: #808080;
+  	}
+  	a:visited {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	a:active {
+  		font-family: Arial, Helvetica, sans-serif;
+  		text-decoration : none;
+  		color: #808080;
+  		font-size : 12px;
+  	}
+  	-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+   if(wert == 'guiList'){
+      var listIndex = document.form1.guiList.selectedIndex;
+      if(listIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      else{
+         var gui_id=document.form1.guiList.options[listIndex].value;
+			document.form1.action='../php/mod_loadwfs.php';
+			document.form1.submit();
+      }
+   }
+}
+</script>
+</head>
+<body>
+
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+
+echo "<table cellpadding='0' cellspacing='0' border='0'>";
+echo "<tr>";
+echo "<td>";
+echo"GUI";
+echo"<br>";
+$sql = "SELECT * from gui_mb_user, gui WHERE gui.gui_id=gui_mb_user.fkey_gui_id AND gui.gui_public=1 AND gui_mb_user.fkey_mb_user_id=".$_SESSION["mb_user_id"]."  Order BY fkey_gui_id ;";
+$res = db_query($sql);
+$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++;
+}
+
+  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);
+echo "</select><br><br>";
+
+echo "</td>";
+echo "<td>";
+echo"WFS";
+echo"<br>";
+###
+
+
+if(isset($guiList) && $guiList!=""){
+  $sql="SELECT Distinct wfs.wfs_title from gui_wfs LEFT JOIN wfs ON gui_wfs.fkey_wfs_id=wfs.wfs_id where gui_wfs.fkey_gui_id='".$guiList."' order by wfs.wfs_title";
+  $res = db_query($sql);
+
+  $count=0;
+  echo"<select size='8' name='wfsList' style='width:200px'>";
+
+  while($row = db_fetch_array($res)){
+  	if ($row["wfs_title"]!=""){
+	echo "<option value='' ";
+    echo ">".$row["wfs_title"]."</option>";
+	}
+	$count++;
+  }
+    echo "</select><br><br>";
+}
+echo "</td>";
+echo "<tr></table><br>";
+echo "Add the following REQUEST to the Online Resource URL to obtain the Capabilities document:<br>";
+echo "<i>(Triple click to select and copy)</i><br>"; 
+echo "REQUEST=getCapabilities&VERSION=1.0.0&SERVICE=WFS<br>";
+echo "<br><br>";
+echo "Link to WFS Capabilities URL:<br>";
+#echo "Load WMS capabilities URL:<br>"
+
+if (isset($xml_file)){
+	echo"<input type='text' name='xml_file' size='50' value='".$xml_file."'>";
+}else{
+	echo"<input type='text' name='xml_file' size='50' value='http://'>";
+}
+echo"<input type='button' name='loadCap' value='Load' onClick='validate(\"guiList\")'>";
+echo "</form>";
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_loadwfs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadwfs.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadwfs.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,17 @@
+<?php
+#$Id: mod_loadwfs.php,v 1.7 2006/01/18 16:06:08 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadwfs.php,v 1.7 2006/01/18 16:06:08 astrid_emde Exp $
+session_start();
+
+require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wfs.php"); 
+echo "file: ".$_REQUEST["xml_file"];
+echo "<br>-------------------------------<br>";
+$gui_id=mb_validateInput($_REQUEST["guiList"]);
+$xml=mb_validateInput($_REQUEST["xml_file"]);
+$mywms = new wfs();
+$mywms->createObjFromXML($xml);      
+$mywms->wfs2db($gui_id);
+$mywms->displayWFS();
+?>

Added: trunk/mapbender/http/php/mod_loadwms.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadwms.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadwms.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,20 @@
+<?php
+#$Id: mod_loadwms.php,v 1.6 2005/09/13 19:04:03 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadwms.php,v 1.6 2005/09/13 19:04:03 bjoern_heuser Exp $
+session_start();
+
+require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+
+
+echo "file: ".$_REQUEST["xml_file"];
+
+$gui_id=mb_validateInput($_REQUEST["guiList"]);
+$xml=mb_validateInput($_REQUEST["xml_file"]);
+
+$mywms = new wms();
+$mywms->createObjFromXML($xml);      
+$mywms->writeObjInDB($gui_id);
+$mywms->displayWMS();
+?>

Added: trunk/mapbender/http/php/mod_loadwms_temp.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_loadwms_temp.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_loadwms_temp.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,22 @@
+<?php
+#$Id: mod_loadwms_temp.php,v 1.5 2005/09/13 17:39:44 bjoern_heuser Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_loadwms_temp.php,v 1.5 2005/09/13 17:39:44 bjoern_heuser Exp $
+session_start();
+require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+
+
+#echo "file: ".$_REQUEST["xml_file"];
+
+$gui_id=mb_validateInput($_REQUEST["gui_id"]);
+$xml=mb_validateInput($_REQUEST["xml_file"]);
+
+		$mywms = new wms();
+		$mywms->createObjFromXML($xml);      
+		$mywms->writeObjInDB($gui_id);
+       
+//      $mywms->displayWMS();
+#echo "<body bgcolor='#fbc327'>";
+#echo "</body>";
+?>

Added: trunk/mapbender/http/php/mod_log.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_log.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_log.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,20 @@
+<?php
+if($_REQUEST['req']){
+	session_start();
+	ignore_user_abort();
+	$req = array();
+	$req[0] = urldecode($_REQUEST['req']);
+	$time_client = $_REQUEST['time_client'];
+	
+	if(empty($req)){$req = "init";}
+	include("../classes/class_log.php");
+	$log = new log("default", $req, $time_client);
+}
+
+header ("Content-type: image/png");
+$im = imagecreate(1,1);
+$col = ImageColorAllocate ($im, 0, 0, 0);  
+imagesetpixel ( $im, 1, 1, $col);
+
+ImagePNG ($im);
+?>

Added: trunk/mapbender/http/php/mod_logout.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_logout.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_logout.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,32 @@
+<?php
+#$Id: mod_logout.php,v 1.8 2006/02/14 09:16:50 astrid_emde Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_logout.php,v 1.8 2006/02/14 09:16:50 astrid_emde Exp $
+
+require_once("../../conf/mapbender.conf");
+
+session_start();
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+
+ob_start();
+
+include '../include/dyn_php.php';
+ignore_user_abort();
+session_start();
+session_unset();
+session_destroy();
+$dir = preg_replace("/\\\/","/", dirname($_SERVER['PHP_SELF']));
+
+if (isset($logout_location) && $logout_location != ''){
+	header("Location: ".$logout_location);     
+}
+else{
+   if(is_file(dirname($_SERVER['PHP_SELF'])."/login.php")){
+      header("Location: http://".$_SERVER['HTTP_HOST'].$dir."/login.php");      
+   }
+   else{
+      header("Location: http://".$_SERVER['HTTP_HOST'].str_replace("/php","/frames",$dir)."/login.php");
+   }
+}
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_map1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_map1.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_map1.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,87 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+
+<title>mod_map1</title>
+<?php
+$sql = "SELECT e_width, e_height FROM gui_element WHERE e_id = 'mapframe1' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+   $e_width = $row["e_width"];
+   $e_height = $row["e_height"];
+   $cnt++;
+}
+if($cnt > 1){ echo "alert('mapframe1: ID not unique!');";}
+echo '<script type="text/javascript">';
+echo "\n";
+echo "var mod_map1_width = '".$e_width."';\n";
+echo "var mod_map1_height = '".$e_height."';\n";
+echo "</script>\n";
+?>
+<script type="text/javascript">
+<!--
+function init_mod_map1(){
+   parent.mb_registerMapObj('mapframe1', 'maps', null,mod_map1_width, mod_map1_height);
+   document.getElementById("maps").style.width = mod_map1_width;
+   document.getElementById("maps").style.height = mod_map1_height;
+}
+// -->
+</script>
+</head>
+<body leftmargin='0' topmargin='0' onload="init_mod_map1()" bgcolor='#ffffff'>
+<div id='markResult' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px;'> </div>
+<div id='maps' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px;'> </div>
+
+<div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif"/></div>
+<div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:10;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
+<div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
+<div id='l_left' name='l_left' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:12;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
+<div id='l_top' name='l_top' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:13;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
+<div id="sandclock" style="position:absolute; top:0px; left:0px; z-index:14;"></div>
+<div id="scalebar" style="position:absolute; top:0px; left:0px; z-index:15;"></div>
+<div id="measuring" style="position:absolute; top:0px; left:0px; z-index:16; font-size:10px"></div>
+<div id="measure_display" style="position:absolute; top:0px; left:0px; z-index:17;"></div>
+<div id="copyright" style="position:absolute; top:0px; left:0px; z-index:18;"></div>
+<div id="measure_sub" style="position:absolute; top:0px; left:0px; z-index:19;"></div>
+<div id='permanent' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:20;visibility:hidden"><img src="../img/redball.gif"/></div>
+<div id="digitize_sub" style="position:absolute; top:0px; left:0px; z-index:24;"></div>
+<div id="digitize_display" style="position:absolute; top:0px; left:0px; z-index:25;"></div>
+<!-- <div id="digitize" style="position:absolute; top:0px; left:0px; z-index:26; font-size:10px"></div> //-->
+<div id='um_title' name='um_title' style="font-family: Arial, Helvetica, sans-serif; DISPLAY:none; OVERFLOW:visible; POSITION:absolute; DISPLAY:none; BACKGROUND:#BEC1C4;border:1px solid black; z-index:98;"></div>
+<div id='um_draw' name='um_draw' style="LEFT:0px;OVERFLOW:visible;POSITION:absolute;TOP:0px;z-index:99;"></div>
+<img id='um_img' name='um_img' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; border:0;z-index:100' src='../img/transparent.gif' useMap='#um'>
+<map name='um' id='um'></map>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_mapOV.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_mapOV.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_mapOV.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,141 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+require_once("../../conf/mapbender.conf");
+if(isset($_REQUEST["wms"])){
+	$rank = $_REQUEST["wms"];
+}
+else{
+	$rank = 0;
+}
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>mod_mapOV0.php</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<?php
+$gui_id = $_SESSION["mb_user_gui"];
+
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_width,e_height, e_target FROM gui_element WHERE e_id = 'overview' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+echo "<script type='text/javascript'>";
+while($row = db_fetch_array($res)){ 
+   echo "var mod_overview_width = " . $row["e_width"].";";
+   echo "var mod_overview_height = " . $row["e_height"].";";
+   echo "var mod_overview_target = '" . $row["e_target"]."';";
+   $cnt++;
+}
+echo "var mod_overview_rank = ".$rank.";";
+if($cnt > 1){ echo "alert('overview: ID not unique!');";}
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function init_mod_mapOV(){
+   parent.mb_registerMapObj('overview', 'maps', mod_overview_rank, mod_overview_width, mod_overview_height);
+    document.onmouseover = mod_ov_setHandler;
+   document.onmousedown = parent.mod_box_start;
+   document.onmouseup = mod_ov_getExtent;
+   document.onmousemove = parent.mod_box_run;
+   document.getElementById("maps").style.width = mod_overview_width;
+   document.getElementById("maps").style.height = mod_overview_height;   
+}
+function mod_ov_setHandler(e){
+   parent.mb_isBF = "overview";
+   parent.mb_zF = mod_overview_target;
+}
+function mod_ov_getExtent(e){
+	mod_ov_setValidClipping(parent.mod_box_stop(e));
+}
+parent.mb_registerSubFunctions("window.frames['overview'].mod_ov_showMapExtent()");
+function mod_ov_showMapExtent(){
+	for(var i=0; i<parent.mb_mapObj.length; i++){
+		if(parent.mb_mapObj[i].frameName == mod_overview_target){
+			var arrayBBox = parent.mb_mapObj[i].extent.split(",");
+			var minX = parseFloat(arrayBBox[0]);
+			var minY = parseFloat(arrayBBox[1]);
+			var maxX = parseFloat(arrayBBox[2]);
+			var maxY = parseFloat(arrayBBox[3]);
+			var posMin = parent.makeRealWorld2mapPos("overview",minX,maxY);
+			var posMax = parent.makeRealWorld2mapPos("overview",maxX,minY);
+			var px1 = posMin[0];
+			var py1 = posMin[1];
+			var px2 = posMax[0];
+			var py2 = posMax[1];
+
+		parent.mb_isBF = "overview";
+		parent.mb_zF = mod_overview_target;
+		while((px2 - px1) < 8){
+			px1 -= 1;
+			px2 += 1;
+		}
+		while((py2 - py1) < 8){
+			py1 -= 1;
+			py2 += 1;
+		}
+		if(px1 < 0){px1 = 1;}
+		if(px1 > mod_overview_width){px1 = mod_overview_width-1;}
+
+		if(py1 < 0){py1 = 1;}
+		if(py1 > mod_overview_height){py1 = mod_overview_height-1;}
+
+		if(px2 > mod_overview_width){px2 = mod_overview_width-1;}
+		if(px2 < 0){px2 = 1;}
+
+		if(py2 > mod_overview_height){py2 = mod_overview_height-1;}
+		if(py2 < 0){py2 = 1;}
+
+		parent.mb_drawBox(px1,py1,px2,py2);
+		}
+	}
+}
+function mod_ov_setValidClipping(coords){
+	if(coords.length > 2){
+		parent.mb_calculateExtent(parent.mb_zF,coords[0],coords[1],coords[2],coords[3]);
+		parent.setMapRequest(parent.mb_zF);
+	}
+	else{
+		parent.zoom(parent.mb_zF,true,1.0,coords[0], coords[1]);
+	}
+}
+// -->
+</script>
+</head>
+<body leftmargin='0' topmargin='0' onload="init_mod_mapOV()"  bgcolor='#ffffff'>
+<div id='maps' name='maps' style =' position:absolute;left:0px;top:0px;width:0px;height:0px;' ></div>
+<div id='l_top' name='l_top' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:red;cursor: crosshair;"></div>
+<div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:12;visibility:hidden;background-color:red;cursor: crosshair;"></div>
+<div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:13;visibility:hidden;background-color:red;cursor: crosshair;"></div>
+<div id='l_left' name='l_left' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:14;visibility:hidden;background-color:red;cursor: crosshair;"></div>
+<div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif" width="14" height="14" /></div>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_monitorCapabilities.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_monitorCapabilities.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_monitorCapabilities.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,120 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+import_request_variables("PG");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Monitor WMS Capabilities</title>
+<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
+</head>
+<body>
+<?php
+require_once("../classes/class_wms.php");
+require_once("../classes/class_administration.php");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+$permguis = $admin->getGuisByPermission($_SESSION["mb_user_id"]);
+$wms_id_own = $admin->getWmsByOwnGuis($ownguis);
+
+for ($k=0; $k<count($wms_id_own); $k++) {
+	$wmsId = $wms_id_own[$k];
+
+	echo "<br><b>Processing WMS Id </b>" . $wmsId . " : ";
+	// get the wms version, capabilities, capabilities_doc
+	$sql = "SELECT wms_version, wms_getcapabilities, wms_getcapabilities_doc FROM wms WHERE wms_id = '" . $wmsId . "'";
+	$res = db_query($sql);
+	$someArray = db_fetch_row($res);
+	$version = $someArray[0];
+	$capabilities = $someArray[1]; 	
+	$capabilities_doc = $someArray[2];
+	
+	// construct capabilities URL
+	if ($version == "1.1.1" || $version == "1.1.0") {
+		$myURL = $capabilities . "REQUEST=GetCapabilities&SERVICE=wms&VERSION=" . $version;	
+	}
+	elseif ($version == "1.0.0" ) {
+		$myURL = $capabilities . "REQUEST=capabilities&WMTVER=1.0.0";	
+	}
+	else {
+		echo "Unknown wms version '" . $version . "'! No update possible.<br><br>";
+
+	}
+	if ($myURL) {
+		// compare the capabilities XML documents
+		$localXml = $capabilities_doc;
+		$remoteXml = implode("", file($myURL));
+ 		
+		$localXmlArray = explode("\n", $localXml);
+		$remoteXmlArray = explode("\n", $remoteXml);
+			
+			
+		for ($i=0; $i<count($localXmlArray); $i++) {
+			$localXmlArray[$i] = trim(htmlentities($localXmlArray[$i]));
+		}	
+		for ($i=0; $i<count($remoteXmlArray); $i++) {
+			$remoteXmlArray[$i] = trim(htmlentities($remoteXmlArray[$i]));
+		}	
+		
+	//print_r($localXmlArray);
+	//print_r($remoteXmlArray);			
+		if (!$remoteXml) {
+			$result = -1;
+			echo "Can't connect to " . $myURL . "<br><br>";
+		}
+		elseif (!$localXml) {
+			$result = 0;
+		}
+		else {
+			if ($localXml == $remoteXml) {
+				$result = 1;
+				echo "No update necessary.<br><br>";
+			}
+			else {
+				$result = 0;
+			}
+		}
+
+				
+		if ($result == 0) {
+			echo "Updating WMS " . $wmsId . "...<br><br>";
+			$mywms = new wms();
+			$mywms->createObjFromXML($myURL);    
+			$mywms->optimizeWMS();
+			$mywms->updateObjInDB($wmsId);
+		}
+
+	}
+	
+}
+
+echo "done!";
+
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_newGui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_newGui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_newGui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,83 @@
+<?php
+/* version 2.0.2*/
+session_start();
+
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>New GUI</title>
+<?php include '../include/dyn_css.php'; ?>
+<?php
+if(isset($newGui) && $newGui != ""){
+  $sql = "SELECT gui_id FROM gui WHERE gui_id ='".$newGui."'";
+  $res = db_query($sql);
+  if(db_fetch_row($res)){
+     echo "<script type='text/javascript'>";
+     echo "alert('Error: Gui already exists!');";
+     echo "</script>";
+  }
+  else{
+     $sql = "INSERT INTO gui (gui_id,gui_name,gui_description,gui_public) VALUES('".$newGui."','".$newGui."','".$newDesc."',1)";
+     $res = db_query($sql);
+     $sql = "INSERT INTO gui_mb_user (fkey_gui_id,fkey_mb_user_id,mb_user_type) VALUES('".$newGui."',".$_SESSION["mb_user_id"].", 'owner')";
+     $res = db_query($sql);
+     require_once("mb_getGUIs.php");
+     $arrayGUIs = mb_getGUIs( $_SESSION["mb_user_id"]);
+     $_SESSION["mb_user_guis"] = $arrayGUIs;
+	  $guiCreated=true;
+  }
+}
+?>
+<script type="text/javascript">
+<!--
+function setFocus(){
+   document.form1.newGui.focus();
+}
+function validate(){
+   if(document.form1.newGui.value == ""){
+      alert("Please enter a GUI-NAME!");
+      document.form1.newGui.focus();
+      return;
+   }
+   else{
+      document.form1.submit();
+   }
+}
+// -->
+</script>
+</head>
+<body onload='setFocus()'>
+<form name='form1' action="<?php echo $PHP_SELF .'?'.SID ?>" method="POST">
+<table>
+<tr><td>Name: </td><td><input type='text' name='newGui'></td></tr>
+<tr><td>Description: </td><td><input type='text' name='newDesc'></td></tr>
+<tr><td></td><td><input type='button' onclick='validate()' value="new"></td></tr>
+</table>
+
+<?php
+if(isset($newGui) && $newGui != ""){
+	if ($guiCreated==true){
+     	echo "<p class = 'guiList'>";
+      echo "The GUI <b>".$newGui."</b> has been created successfully.";
+		echo "<p>";
+   }
+}
+?>
+
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_printView1.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_printView1.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_printView1.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,77 @@
+<?php
+session_start();
+//
+import_request_variables("PG");
+$_SESSION["mb_print_url"] = $map_url;
+$_SESSION["mb_print_resolution"] = $quality;
+include("../../conf/print.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Print Settings</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+	<!--
+
+	.bg_header{
+		background-color: white;
+	}
+	.bg{
+		background-color: black;
+	}
+	body{
+		font-family: Arial, Helvetica, sans-serif;
+	}
+	-->
+</style>
+</head>
+<body leftmargin="0" topmargin="0"> 
+<?php
+
+$printOffset_top = intval($_REQUEST["printOffset_top"]) * $deformation;
+$printOffset_left = intval($_REQUEST["printOffset_left"]) * $deformation;
+$header_height = intval($_REQUEST["header_height"]) * $deformation;
+$map_width = intval($_REQUEST["map_width"]) * $deformation;
+$map_height = intval($_REQUEST["map_height"]) * $deformation;
+$date = date("d.m.y");
+#map
+echo "<img style='position:absolute; top:".($printOffset_top + $header_height)."px; left:".($printOffset_left+1)."px; z-index:3;' src='../extensions/ext_weldMaps.php?". SID."' width='".$map_width."' height='".$map_height."'>";
+echo "<img style='position:absolute; top:".($printOffset_top + $header_height)."px; left:".($printOffset_left+1)."px; z-index:2;' src='../img/white.gif' width='".$map_width."' height='".$map_height."'>";
+
+echo "<img class='bg' style='position: absolute; top:".($printOffset_top - 1)."px;left:".($printOffset_left-1)."px; z-index:1;width:".($map_width+3)."px; height:".($map_height +$header_height +2)."px;' src='../img/black.gif'>";
+#header
+
+
+echo "<img class='bg_header' style='position: absolute; top:".($printOffset_top+1)."px;left:".($printOffset_left+1)."px; z-index:1;width:".($map_width/2-1)."px; height:".($header_height -2)."px;' src='../img/white.gif'>";
+
+echo "<div  style='position: absolute; top:".($printOffset_top+1)."px;left:".($printOffset_left+1)."px; z-index:1;width:".($map_width/2-1)."px; height:".($header_height -2)."px;'>";
+echo "<div style='position:relative;left:5px; font-weight:bold; font-size:20px;z-index:3;'>".$printTitle . "</div>";
+echo "<div style='position:relative;left:5px;z-index:3;'>Datum: ".$date . "</div>";
+echo "<div style='position:relative;left:5px;z-index:3;'>Maßstab: 1:".$map_scale . "</div>";
+echo"</div>"; 
+
+echo "<img class='bg_header' style='position: absolute; top:".($printOffset_top+1)."px;left:".($printOffset_left + $map_width/2+2)."px; z-index:1;width:".($map_width/2-1)."px; height:".($header_height -2)."px;' src='../img/white.gif'>";
+echo "<div style='position: absolute; top:".($printOffset_top+1)."px;left:".($printOffset_left + $map_width/2+2)."px; z-index:1;width:".($map_width/2-1)."px; height:".($header_height -2)."px;' >";
+echo "<div style='position:relative;left:5px;z-index:3;'>".$printComment . "</div>";
+echo"</div>"; 
+
+echo "<div style='position: absolute; top:".($printOffset_top + $header_height + $map_height+5)."px;left:".($printOffset_left+2)."px; z-index:3;font-size:10px' >";
+echo $footer;
+echo "</div>";
+#$myfactor = 37.81;
+#echo "<img style='position: absolute; top:".($printOffset_top + $header_height + $map_height+10)."px;left:".($printOffset_left+2)."px; '  src='../img/black.gif' height='2' width='".(10 * $myfactor)."'>"; 
+?>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_renameGUI.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_renameGUI.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_renameGUI.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,209 @@
+<?php
+/* version 2.0.2*/
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Rename GUI</title>
+<style type="text/css">
+
+body{
+   background-color: #ffffff;
+}
+.button_rename{
+   color: red;
+   position:absolute;
+   top:390px;
+   left:10px;
+}
+.button_copy{
+   color: red;
+   position:absolute;
+   top:390px;
+   left:110px;
+}
+.newName{
+   	position:absolute;
+   	top:350px;
+   	left:60px;
+   	width:150px
+} 
+.newName_str{
+   	position:absolute;
+   	top:350px;
+   	left:10px;
+   	width:200px
+} 
+.guiList{
+   	position:absolute;
+   	top:10px;
+   	left:10px;
+   	width:200px
+} 
+
+</style>
+
+<script type="text/javascript">
+
+
+function validate_rename(){
+   if(document.form1.newGuiName.value == ""){
+      alert("Please enter a GUI name!");
+      document.form1.newGuiName.focus();
+   }
+   else{
+
+    // gui name already taken?
+    var taken = false;
+    for (var i=0; i<document.form1.guiList.options.length; i++){
+      if(document.form1.guiList.options[i].text == document.form1.newGuiName.value){
+        alert("GUI name already taken!");
+        taken = true;
+      }
+    }
+    
+    if (!taken){
+      var ind = document.form1.guiList.selectedIndex;
+      // check if any gui is selected
+      if(ind > -1){
+        var permission =  confirm("rename '" + document.form1.guiList.options[ind].text + "' to '" + document.form1.newGuiName.value + "' ?");
+        if(permission == true){
+          document.form1.rename.value = 1;
+          document.form1.submit();
+        }
+      } 
+      else
+      {
+        alert("Please select a GUI!");
+      }
+    }
+  }
+}
+
+function validate_copy(){
+   if(document.form1.newGuiName.value == ""){
+      alert("Please enter a GUI name!");
+      document.form1.newGuiName.focus();
+   }
+   else{
+
+    // gui name already taken?
+    var taken = false;
+    for (var i=0; i<document.form1.guiList.options.length; i++){
+      if(document.form1.guiList.options[i].text == document.form1.newGuiName.value){
+        alert("GUI name already taken!");
+        taken = true;
+      }
+    }
+    
+    if (!taken){
+      var ind = document.form1.guiList.selectedIndex;
+      // check if any gui is selected
+      if(ind > -1){
+        var permission =  confirm("copy '" + document.form1.guiList.options[ind].text + "' to '" + document.form1.newGuiName.value + "' ?");
+        if(permission == true){
+          document.form1.copy.value = 1;
+          document.form1.submit();
+        }
+      } 
+      else
+      {
+        alert("Please select a GUI!");
+      }
+    }
+  }
+}
+</script>
+</head>
+<body onLoad='document.form1.newGuiName.focus()'>
+<!--<form name='form1' action="<?php $PHP_SELF ?>" method="POST">-->
+<!--<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>;-->
+
+<?php
+
+require_once("../classes/class_administration.php");
+require_once("../classes/class_gui.php");
+
+###rename
+if($rename || $copy){
+
+	$gui = new gui();
+
+	if ($copy) {	
+		$gui->copyGui($guiList, $newGuiName, false);
+	}
+	elseif ($rename) {
+		$gui->renameGui($guiList, $newGuiName);
+	}
+    $rename = 0;
+    $copy = 0;
+  
+}
+###
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+if(count($ownguis)>0){
+$sql = "SELECT * FROM gui WHERE gui_id IN (";
+for($i=0; $i<count($ownguis); $i++){
+				if($i>0){ $sql .= ",";}
+				$sql .= "'".$ownguis[$i]."'";
+				}
+$sql .= ") ORDER BY gui_name";
+$res = db_query($sql);
+$count=0;
+
+while($row = db_fetch_array($res)){
+	$gui_id[$count]=$row["gui_id"];
+	$count++;
+}
+
+
+	echo "<select class='guiList' size='20' name='guiList' onchange='document.form1.guiList.value = this.value;submit();'>";
+	for ($i=0; $i<$count;$i++){
+	  echo "<option value='".$gui_id[$i]."' ";
+	  if($guiList && $guiList == $gui_id[$i]){
+	    echo "selected";
+	  }
+	  echo ">".$gui_id[$i]."</option>";
+	}
+	
+	echo "</select><br><br><br>";
+}else{
+	echo "There are no guis owned by this user.";
+}
+
+
+if($guiList){
+echo "<table>";
+echo "<tr><td class='newName_str'>Name: </td><td><input class='newName' type='text' name='newGuiName'></td></tr>\n";
+echo "<tr>";
+echo " <td><input class='button_rename' type='button' value='rename' onclick='validate_rename()'></td>";
+echo " <td><input class='button_copy' type='button' value='copy' onclick='validate_copy()'></td>";
+echo "</tr>\n";
+echo "</table>";
+}
+?>
+<input type='hidden' name='rename'>
+<input type='hidden' name='copy'>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_saveWKT.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_saveWKT.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_saveWKT.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,235 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>mod_saveWKT</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+<!--
+function validate(){
+	 document.forms[0].x.value = "";
+     document.forms[0].y.value = "";
+     for(var i=0; i<window.opener.mod_measure_RX.length;i++){
+        if(i>0){ document.forms[0].x.value += ",";}
+        document.forms[0].x.value += window.opener.mod_measure_RX[i];
+     }
+     for(var i=0; i<window.opener.mod_measure_RY.length;i++){
+        if(i>0){ document.forms[0].y.value += ",";}
+        document.forms[0].y.value += window.opener.mod_measure_RY[i];
+     }
+     document.forms[0].save.value='true';
+     document.forms[0].src_epsg.value=window.opener.mod_measure_epsg.substr(5,5); //NEW!!!
+     document.forms[0].submit();
+}
+var geoType;
+function checkGeom(){
+   if(window.opener.mod_measure_RX.length == 1){
+      geoType = "POINT";
+   }
+   if(window.opener.mod_measure_RX.length > 1 && (window.opener.mod_measure_RX[0] =! window.opener.mod_measure_RX[window.opener.mod_measure_RX.length -1])){
+      geoType = "MULTILINESTRING";
+   }
+   if(window.opener.mod_measure_RX.length > 1 && (window.opener.mod_measure_RX[0] == window.opener.mod_measure_RX[window.opener.mod_measure_RX.length -1])){
+      geoType = "MULTIPOLYGON";
+   }
+   if(document.forms[0].myGeometryType.value != geoType){
+      alert("Falscher Geometrietyp!");
+   }      
+}
+// -->
+</script>
+</head>
+<!-- <body onload='checkGeom()'>  
+//NEW!!! Bei Erstaufruf ist die ausgewählte Tabelle (und deren Geometrie) noch nicht bekannt! 
+Deshalb zuvor eine Fehlermeldung.  Jetzt als PHP-Code, siehe if($save)   -->
+<body> 
+<?php 
+/*****************************************************************************
+personal postgresql parameters - persönliche Postgresql-Einstellungen    */
+$host = "localhost";
+$port = "5432";
+DBname = "databasename";
+$user = "username";
+$password = "password";
+//personal example: pick only certain (working-) tables, here: tables which start with "mapbender_"
+$tblmb="mapbender_%";  
+//*****************************************************************************
+
+import_request_variables("P");
+
+$con_string = "host=$host port=$port dbname=DBname user=$user password=$password";
+$con = pg_connect ($con_string) or die ("Error while connecting database DBname");
+$sql = "SELECT f_table_name, f_geometry_column,type,srid FROM geometry_columns 
+        where f_table_name like '$tblmb'"; //pick only certain tables (see above)
+//$sql = "SELECT f_table_name, f_geometry_column,type,srid FROM geometry_columns";
+$res = pg_query($con,$sql);
+$cnt = 0;
+echo "<form action='".$PHP_SELF."' method='POST'>";
+#echo "Selektieren: <input name='actionType' type='radio' value='select'>";
+#echo "Speichern: <input name='actionType' type='radio' value='create'><br>";
+echo "<select name='tablenames' onchange='submit()'>";
+echo "<option value=''>Bitte Tabelle ausw&auml;hlen...</option>";
+while(pg_fetch_row($res)){   
+   echo "<option value='".pg_result($res,$cnt,"f_table_name")."' ";
+   if($tablenames == pg_result($res,$cnt,"f_table_name")){
+      echo "selected";
+      $geometry = pg_result($res,$cnt,"f_geometry_column");
+      $geometryType = pg_result($res,$cnt,"type");
+      $epsg = pg_result($res,$cnt,"srid");
+   }
+   echo ">".pg_result($res,$cnt,"f_table_name")."</option>";
+   $cnt++;
+}
+echo "</select>";
+
+
+if(isset($tablenames)){
+   $sql = "SELECT * from ".$tablenames." limit 1";
+   $res = pg_query($con,$sql);
+   $num = pg_num_fields($res);
+   
+   echo "<table>";
+   $cnt = 0;
+   for($i=0; $i<$num; $i++){
+      echo "<tr>";
+      echo "<td>".pg_fieldname($res,$i)."</td><td><input type='text' name='".pg_fieldname($res,$i)."'></td><td>".pg_fieldtype($res,$i)."</td>";
+      echo "</tr>";
+      if(!isset($str_names)){
+         $str_names = pg_fieldname($res,$i);
+      }
+      else{
+         $str_names .= ",".pg_fieldname($res,$i);
+      }
+      $cnt++;        
+   }
+   echo "</table>";
+   echo "<br>";
+   echo "<input type='button' value='save' onclick='validate()'>";
+   echo "<input type='hidden' value='' name='save'>";
+   echo "<input type='text' value='".$x."' name='x'>";  //NEW!!!
+   echo "<input type='text' value='".$y."' name='y'>";  //NEW!!!
+   echo "<input type='text' value='".$geometry."' name='myGeometry'>";
+   echo "<input type='text' value='".$geometryType."' name='myGeometryType'>";
+   echo "<input type='text' value='".$src_epsg."' name='src_epsg'>";   //NEW!!!
+   echo "<input type='text' value='".$epsg."' name='epsg'>";   
+   echo "<input name='myStrColumns' type='text' value='".$str_names."'>";   
+}
+if($save){
+ $myColumns = explode(",",$myStrColumns); 
+ $myX = explode(",", $x);
+ $myY = explode(",", $y);
+ $myxcount = count($myX);
+ 
+ if ($myxcount == 1) {
+	$geoType = 'POINT';
+ }
+ if ($myxcount > 1 && $myX[0] != $myX[$myxcount-1]) {
+	$geoType = 'MULTILINESTRING';
+    if ($geometryType == 'LINESTRING') { $geoType = 'LINESTRING'; } //NEW!! funktioniert aber nur solange, wie keine wirklichen MULTILINESTRING's digitalisiert werden
+ }
+ if ($myxcount > 1 && $myX[0] == $myX[$myxcount-1]) {
+	$geoType = 'MULTIPOLYGON';
+    if ($geometryType == 'POLYGON') { $geoType = 'POLYGON'; } //NEW!! funktioniert aber nur...
+ }
+ //NEW!!! in Tabellen vom GEOMETRY-Typ lassen sich (datensatzweise) verschiedene Geometrien abspeichern
+ if ($geometryType != $geoType && $geometryType != 'GEOMETRY') { 
+	echo "<br>";
+	echo "Geometrie (".$geoType.") stimmt nicht mit der der Tabelle (".$geometryType.") überein!";
+	die;
+ }
+
+ if(count(myX) != count(myY)){
+   echo "Geometrie verschlüsselt.....................";
+   die;
+ }
+ $sql = "INSERT INTO ".$tablenames."(";
+ for($i=0; $i<count($myColumns); $i++){
+   if($i>0){
+      $sql .= ",";
+   }
+   $sql .= $myColumns[$i]; 
+ }
+ $sql .= ") ";
+ $sql .= "VALUES (";
+ for($i=0; $i<count($myColumns); $i++){
+   if($i>0){
+      $sql .= ",";
+   } 
+
+   if($myColumns[$i] == $myGeometry){
+		//NEW!!  $geoType anstelle von $geometryType, um a) auch in Tabellen mit Geometrietyp 'Geometry' abspeichern zu können
+		if ($geoType == "POINT") { 
+			$sql .= "transform(GeometryFromText('".$geoType."("; //$geoType anstelle von $geometryType s. o.
+		} elseif ($geoType == "LINESTRING") { 
+			$sql .= "transform(GeometryFromText('".$geoType."("; 
+		} elseif ($geoType == "MULTILINESTRING") { 
+			$sql .= "transform(GeometryFromText('".$geoType."(("; 
+		} elseif ($geoType == "POLYGON") { 
+			$sql .= "transform(GeometryFromText('".$geoType."(("; 
+		} elseif ($geoType == "MULTIPOLYGON") { 
+			$sql .= "transform(GeometryFromText('".$geoType."((("; 
+		}
+     	for($j=0; $j<count($myX); $j++){  
+     		if($j > 0){$sql .= ", ";}
+  	   	$sql .= $myX[$j] . " " . $myY[$j];
+     	}  	
+		if ($geoType == "POINT") {
+//			$sql .= ")))',".$src_epsg."),".$epsg.")"; //OLD!!!  so funktioniert es mit postgis Version 0.9 !!
+			$sql .= ")',".$src_epsg."),".$epsg.")"; //NEW!!! aber nur so mit 1.0.0 RC6
+			} elseif ($geoType == "LINESTRING") { //NEW!!!
+			$sql .= ")',".$src_epsg."),".$epsg.")"; 
+			} elseif ($geoType == "MULTILINESTRING") { 
+//			$sql .= "))))',".$src_epsg."),".$epsg.")";  // 0.9
+			$sql .= "))',".$src_epsg."),".$epsg.")"; // postgis 1.0.0
+			} elseif ($geoType == "POLYGON") { 
+			$sql .= "))',".$src_epsg."),".$epsg.")"; //NEW!!!
+			} elseif ($geoType == "MULTIPOLYGON") { 
+//			$sql .= ")))))',".$src_epsg."),".$epsg.")";  // 0.9
+			$sql .= ")))',".$src_epsg."),".$epsg.")"; // postgis 1.0.0
+		} 
+/* Linestrings lassen sich in MULTILINESTRING, Polygone in MULTIPOLYGON-Tabellen abspeichern, wenn gegen $geoType geprüft wird, ergibt sich kein Problem
+// da sich aber MULTI... nicht in Tabellen vom einfachen Typ LINESTRING bzw. POLYGON  abspeichern lassen, wurde dies oben (unelegant) abgefangen		
+		else {
+			echo "<br>Tabelle vom Typ Linestring, Polygon etc?";
+		}
+*/
+   }
+   else{
+      $sql .= "'".$_REQUEST[$myColumns[$i]]."'";
+   }
+ }
+ $sql .= ")";
+ #echo  $sql;
+$res = pg_query($con,$sql);
+}
+
+?>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_showLoggedUser.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_showLoggedUser.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_showLoggedUser.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,43 @@
+<?php
+/* version 2.0.1*/
+//
+session_start();
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+require_once("../php/mb_validateSession.php");
+import_request_variables("PG");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<?php
+/*
+ #---------------- FILE HEADER --------------------------------
+ #        PROJECT                : Mapbender
+ #        FILE TYPE        :  Php-Script
+ #  DESCRIPTION : USERADMINISTRATION, allotment of project-authorizations for profiles
+ #        AUTHOR                : Thekla Wirkus, info at ccgis.de
+ #---------------- FILE HEADER --------------------------------
+ # DATE: 11.05.2004
+*/
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Show User</title>
+<?php
+include '../include/dyn_css.php';
+?>
+</head>
+<body leftmargin="5" topmargin="0">
+<?php
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+#echo $logged_user_name;
+#echo <div class="text1">$logged_user_name</div>;
+echo "<div class='text4'>Logged User: ".$logged_user_name."</div>";
+?>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_simpleWMSpreferences.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_simpleWMSpreferences.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_simpleWMSpreferences.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,180 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Edit WMS Context</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<STYLE TYPE="text/css">
+		<!--
+   body{
+   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+   	color:#0066cc;
+      font-size:10pt
+   }    
+   
+   table{
+   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+   	color:#0066cc;
+      font-size:10pt
+   } 
+   
+   th{
+   	background-color:white;
+   }  
+   
+   select{
+		width:240px;
+   }    
+   
+	.up{
+         color:#0066cc;
+         border: solid thin;
+         height:20px;
+         width:70px;
+   }
+   
+	.remove{
+         color:#0066cc;
+         border: solid thin;
+         height:20px;
+         width:60px;
+   }
+	-->
+</STYLE>
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT * FROM gui_element WHERE e_id = 'WMS_preferences' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+   $e_target = $row["e_target"];
+   $cnt++;
+}
+if($cnt > 1){ echo "alert('WMS_preferences: ID not unique!');";}
+echo '<script type="text/javascript">';
+$target = explode(",", $e_target);
+echo "var mod_WMSpreferences_target1 = '".trim($target[0])."';";
+echo "var mod_WMSpreferences_target2 = '".trim($target[1])."';";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);
+var my = window.opener.mb_mapObj[ind];
+
+function setMapformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_mapformat = tmp[1];
+	loadWMS();
+}
+function setFeatureformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_featureinfoformat = tmp[1];
+	loadWMS();
+}
+function setExceptionformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_exceptionformat = tmp[1];
+	loadWMS();
+}
+function up(num){
+	if(num > 0){
+		var upper = new Object();
+		upper = my.wms[num-1];
+		var lower = new Object();
+		my.wms[num-1] = my.wms[num];
+		my.wms[num] = upper;
+		window.opener.frames[mod_WMSpreferences_target2].document.location.reload();
+
+		var upperLayers = my.layers[num-1];
+		var upperStyles = my.styles[num-1];
+		var upperQuerylayers = my.querylayers[num-1];
+		my.layers[num-1] = my.layers[num];
+		my.styles[num-1] = my.styles[num];
+		my.querylayers[num-1] = my.querylayers[num];
+		my.layers[num] = upperLayers;
+		my.styles[num] = upperStyles;
+		my.querylayers[num] = upperQuerylayers;
+		loadWMS();
+		window.opener.zoom(mod_WMSpreferences_target1, true, 1.0);
+	}
+}
+
+
+function remove_wms(num){
+  //alert(num +" length:"+my.wms.length);
+  
+  if (my.wms.length>1) {
+	var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);   
+	window.opener.mb_mapObjremoveWMS(ind,num) 
+  //alert(ind);	
+	window.opener.frames[mod_WMSpreferences_target2].document.location.reload();
+	window.location.reload();
+   }
+   else{
+   	alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
+   }	
+}
+
+function loadWMS(){
+	var str = "";
+	for(var i=0; i < my.wms.length; i++){
+		str += "<table border='0' cellpading ='1' size='100%'>";  
+		
+		str += "<tr>";
+		if(i==0){
+		str += "<th><input src='/evudb/images/mapbender/button_gray/up_off.gif' disabled type='image' onclick='up("+i+")' value='nach oben'>&nbsp;&nbsp;<input src='/evudb/images/mapbender/button_gray/trash_on.gif' type='image' onclick='remove_wms("+i+")' value='entfernen'></th><th  width='300'><div id ='id_"+my.wms[i].wms_id+"' style='cursor:pointer' onmouseover = 'title=\""+my.wms[i].wms_abstract+"\"'><b>"+my.wms[i].wms_title+"</b></div></th>";
+		}
+		else
+		{
+		str += "<th><input type='image' src='/evudb/images/mapbender/button_gray/up_on.gif' onclick='up("+i+")' value='nach oben'>&nbsp;&nbsp;<input src='/evudb/images/mapbender/button_gray/trash_on.gif' type='image' onclick='remove_wms("+i+")' value='entfernen'></th><th  width='300'><div id ='id_"+my.wms[i].wms_id+"' style='cursor:pointer' onmouseover = 'title=\""+my.wms[i].wms_abstract+"\"'><b>"+my.wms[i].wms_title+"</b></div></th>";
+		}
+		
+		
+		str += "<tr>";
+      str += "<table>";
+      
+     
+
+	}   
+	document.getElementById('data').innerHTML = str;
+}
+
+// -->
+</script>
+</head>
+<body onload='loadWMS()'>
+<div id='data'><div>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_treefolderAdmin.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_treefolderAdmin.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_treefolderAdmin.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,534 @@
+<?php
+
+import_request_variables("PG");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<META NAME="Generator" CONTENT="Cosmo Create 1.0.3">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<TITLE>Treefolder Administration</TITLE>
+<STYLE TYPE="text/css"> 
+    <!-- 
+    .sitemap { 
+	    font-family:Arial,Helvetica;
+	    font-size:10pt;
+	    line-height:6pt;
+    }
+
+    body { margin-top:7px;
+           margin-left:4px;
+    }
+    a:link { text-decoration: none }
+    a:visited { text-decoration: none }
+    a:active { text-decoration: none }
+    // -->
+</STYLE>
+<SCRIPT language="JavaScript1.2">
+  <!--
+  
+  /*
+   * sitemap.js 1.31 05/02/2000
+   *  - Opera 5
+   *
+   * sitemap.js 1.3 27/11/2000
+   *  - Netscape 6
+   *
+   * sitemap.js 1.2 20/05/2000
+   *  - split array tree into arrays for each element old tree
+   *  - no mory type flag, an folder is an entry which has sons
+   *  - a folder can have an link
+   *  - while initing an default layers is shown 
+   *
+   * sitemap.js 1.1 20/10/1999
+   *  - showTree only updates and init layers new which have been really changed
+   *  - add deep to knot entry
+   *  - substitute knotDeep[ id ] w/ tree[ id2treeIndex[ id ] ].deep
+   *  - add alignment to img and a &nbsp; at the beginning of eyery line
+   *  - add a fake img for bookmarks on top panel
+   *
+   * sitemap.js 1.02 14/10/1999
+   *  - fix bug in initStyles
+   *
+   * sitemap.js 1.01 06/10/1999
+   *  - fix bug in knotDeep for Netscape 4.00-4.0.5
+   *
+   * sitemap.js 1.0 20/09/1999
+   *
+   * Javascript function for displaying hierarchic directory structures with
+   * the ability to collapse and expand directories.
+   *
+   * Copyright (c) 1999 Polzin GmbH, Duesseldorf. All Rights Reserved.
+   * Author: Lutz Eymers <ixtab at polzin.com>
+   * Download: http://www.polzin.com/inet/fset_inet.phtml?w=goodies
+   *
+   * Permission to use, copy, modify, and distribute this software
+   * and its documentation for any purposes and without fee
+   * is hereby granted provided that this copyright notice
+   * appears in all copies. 
+   *
+   * Of course, this software is provided "as is" without express or implied
+   * warranty of any kind.
+   *
+   */
+
+window.onError=null;
+
+var idx=0
+var treeId = new Array();
+var treeP_id = new Array();
+var treeIsOn = new Array();
+var treeTyp = new Array();
+var treeName = new Array();
+var treeUrl = new Array();
+var treeWasOn = new Array();
+var treeDeep = new Array();
+var treeLastY = new Array();
+var treeIsShown = new Array();
+var treeURL = new Array();
+var treeWMS = new Array();
+  
+function Note( id,p_id,name,url,left,wms_id) {
+	treeId[ idx ] = id;
+	treeP_id[ idx ] = p_id;
+	treeIsOn[ idx ] = true;
+	treeTyp[ idx ] = 'f';
+	treeName[ idx ] = name + " &nbsp;<input type='radio' value='"+left+"' name='radio1' style='width:10px;height:10px' onclick='parent.document.forms[0].left.value="+left+"'>" + left + " ("+url+" - "+wms_id+")"; 
+	treeUrl[ idx ] = url ;
+	treeWasOn[ idx ] = true;
+	treeDeep[ idx ] = 0;
+	treeLastY[ idx ] = 0;
+	treeIsShown[ idx ] = true;
+	treeURL [ idx ] = url;
+	treeWMS [ idx ] = wms_id;
+	idx++;
+//     if(url != ''){
+//      parent.loadImage(name);
+//     }
+  }
+
+  function initDiv ( )
+  {
+    if ( isDOM || isDomIE )
+    {
+      divPrefix='<DIV CLASS="sitemap" style="position:absolute; left:0; top:0; visibility:hidden;" ID="sitemap'
+      divInfo='<DIV CLASS="sitemap" style="position:absolute; visibility:visible" ID="sitemap'
+    }
+    else
+    {
+      divPrefix='<DIV CLASS="sitemap" ID="sitemap'
+      divInfo='<DIV CLASS="sitemap" ID="sitemap'
+    }
+    document.writeln( divInfo +  'info">Bitte haben Sie etwas Geduld.<BR>&nbsp;<BR>Es werden die Eintr&auml;ge aus<BR>&nbsp;<BR>der Datenbank initialisiert.</DIV> ' );
+	 document.writeln("<form name='treeForm'>");
+    for ( var i=1; i<idx; i++ )
+    {
+	 
+      // linked Name ? 
+      if ( treeUrl[i] != '' )
+//		 onClick='if(this.checked){parent.addSelectedLayer(&quot;1&quot;,&quot;"+treeURL[i]+"&quot;,&quot;visibles&quot;)} else{parent.removeSelectedLayer(&quot;1&quot;,&quot;"+treeURL[i]+"&quot;,&quot;visibles&quot;)}'
+        linkedName = "<input type='checkbox' onClick=''><IMG SRC='../img/tree/1w.gif' BORDER='0' WIDTH='3'><span>" + treeName[i] + "</span>"
+      else
+        linkedName =  '<IMG SRC="../img/tree/1w.gif" BORDER="0" WIDTH="3">' + treeName[i]
+      // don't link folder icon if node has no sons
+      if ( i == idx-1 || treeP_id[i+1] != treeId[i] ) {
+        if ( treeDeep[ i ] == 0 )
+          folderImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="1" HSPACE="0">'
+        else
+          folderImg = ''
+      } else {
+        folderImg = '<A HREF="javascript:sitemapClick(' + treeId[i] + ')"><IMG ALIGN="BOTTOM" SRC="../img/tree/folder_off.gif" BORDER="0" NAME="folder' + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0"></A>'
+      }
+      // which type of file icon should be displayed?
+      if ( treeP_id[i] != 0 )
+      {
+        if ( lastEntryInFolder( treeId[i] ) )
+          fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_last.gif" BORDER="0" NAME="file'
+            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
+        else    
+          fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file.gif" BORDER="0" NAME="file'
+            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
+      }
+      else
+        fileImg = ''
+      // traverse parents up to root and show vertical lines if parent 
+      // is not the last entry on this layer
+      verticales = ''
+      for( var act_id=treeId[i] ; treeDeep[ id2treeIndex[ act_id ] ] > 1;  )
+      {  
+        act_id = treeP_id[ id2treeIndex[ act_id ]]
+        if ( lastEntryInFolder( act_id ) )
+        {
+          verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
+        }
+        else
+        {
+          verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_vert.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
+        }
+      }
+
+      
+      document.writeln( divPrefix + treeId[i] + '"><NOBR>&nbsp;' + verticales + fileImg + folderImg + linkedName + '</NOBR></DIV><BR>'
+      )  
+    }
+	  document.writeln("</form>");
+  }
+
+  function initStyles ( )
+  {
+    document.writeln( '<STYLE TYPE="text/css">' + "\n" + '<!--' )
+    for ( var i=1,y=y0; i<idx; i++ )
+    {  
+      document.writeln( '#sitemap' + treeId[i] + ' {POSITION: absolute; VISIBILITY: hidden;}' )
+      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
+        y += deltaY
+    }
+    document.writeln( '#sitemapinfo {POSITION: absolute; VISIBILITY: visible;}' )
+    document.writeln( '//-->' + "\n" + '</STYLE>' )
+  }
+
+
+
+  function sitemapClick( id )
+  {
+    var i = id2treeIndex[ id ]
+
+    if ( treeIsOn[ i ] )
+    // close directory
+    {
+      // mark node as invisible
+      treeIsOn[ i ]=false
+      // mark all sons as invisible
+      actDeep = treeDeep[ i ]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
+      {
+        treeWasOn[ j ] = treeIsOn[ j ]
+        treeIsOn[ j ]=false
+      }
+      gif_off( id )
+    }
+    else
+    // open directory
+    { 
+      treeIsOn[ i ]=true
+      // remember and restore old status
+      actDeep = treeDeep[ i ]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
+      {
+        treeIsOn[ j ] = treeWasOn[ j ]
+      }
+      gif_on( id )
+    }
+    showTree()
+  }
+
+  function knotDeep( id )
+  {
+    var deep=0
+    while ( true )
+      if ( treeP_id[ id2treeIndex[id] ] == 0 )
+        return deep
+      else
+      {
+        ++deep
+        id = treeP_id[ id2treeIndex[id] ]
+      }
+    return deep  
+  }
+
+  function initTree( id )
+  {
+    treeIsOn[ id2treeIndex[id] ] = true
+    if ( treeTyp[ id2treeIndex[id] ] != 'b' )
+      gif_on( id ) 
+    while ( treeP_id[ id2treeIndex[id] ] != 0 )
+    {
+      id = treeP_id[ id2treeIndex[id] ]
+      treeIsOn[ id2treeIndex[id] ] = true
+      if ( treeTyp[ id2treeIndex[id] ] != 'b' )
+        gif_on( id ) 
+    }
+  }
+
+  function lastEntryInFolder( id )
+  {
+    var i = id2treeIndex[id]
+    if ( i == idx-1 )
+      return true
+    if ( treeTyp[i] == 'b' )
+    {
+      if ( treeP_id[i+1] != treeP_id[i] )
+        return true
+      else 
+        return false
+    }
+    else
+    {
+      var actDeep = treeDeep[i]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep ; j++ )
+      ;
+      if ( j<idx && treeDeep[j] == actDeep )
+        return false
+      else
+        return true
+    }
+  }
+
+  function showTree()
+  {
+    for( var i=1, y=y0, x=x0; i<idx; i++ )
+    {
+      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
+      {
+        // show current node
+        if ( !(y == treeLastY[i] && treeIsShown[i] ) )
+        {
+          showLayer( "sitemap"+ treeId[i] ) 
+          setyLayer( "sitemap"+ treeId[i], y )
+          treeIsShown[i] = true
+        } 
+        treeLastY[i] = y
+        y += deltaY
+      }
+      else
+      {
+        // hide current node and all sons
+        if ( treeIsShown[ i ] )
+        {
+          hideLayer( "sitemap"+ treeId[i] ) 
+          treeIsShown[i] = false
+        }
+      }
+    }
+  }
+
+  function initIndex() {
+    for( var i=0; i<idx; i++ )
+      id2treeIndex[ treeId[i] ] = i
+  }
+
+  function gif_name (name, width, height) {
+    this.on = new Image (width, height);
+    this.on.src ="../img/tree/" +  name + "_on.gif"
+    this.off = new Image (width, height);
+    this.off.src ="../img/tree/" +  name + "_off.gif"
+  }
+
+  function load_gif (name, width, height) {
+    gif_name [name] = new gif_name (name,width,height);
+  }
+
+  function load_all () {
+    load_gif ('folder',30,16)
+    file_last = new Image( 30,16 )
+    file_last.src = "file_last.gif"
+    file_middle = new Image( 30,16 )
+    file_middle.src = "file.gif"
+    file_vert = new Image( 30,16 )
+    file_vert.src = "file_vert.gif"
+    file_empty = new Image( 30,16 )
+    file_empty = "file_empty.gif"
+  }
+
+  function gif_on ( id ) {
+    eval("document['folder" + id + "'].src = gif_name['folder'].on.src")
+  }
+
+  function gif_off ( id ) {
+    eval("document['folder" + id + "'].src = gif_name['folder'].off.src")
+  }
+ 
+  // global configuration
+  var deltaX = 30
+  var deltaY = 16
+  var x0 = 5
+  var y0 = 5
+  var defaultTarget = 'examplemain'
+
+  var browserName = navigator.appName;
+  var browserVersion = parseInt(navigator.appVersion);
+  var isIE = false;
+  var isNN = false;
+  var isDOM = false;
+  var isDomIE = false;
+  var isDomNN = false;
+  var layerok = false;
+
+  var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true;
+  var isNN = browserName.indexOf("Netscape")==-1?false:true;
+  var isOpera = browserName.indexOf("Opera")==-1?false:true;
+  var isDOM = document.getElementById?true:false;
+  var isDomNN = document.layers?true:false;
+  var isDomIE = document.all?true:false;
+
+  if ( isNN && browserVersion>=4 ) layerok=true;
+  if ( isIE && browserVersion>=4 ) layerok=true;
+  if ( isOpera && browserVersion>=5 ) layerok=true;
+
+    
+  function hideLayer(layerName) {
+    if (isDOM)
+      document.getElementById(layerName).style.visibility="hidden"
+    else if (isDomIE)
+      document.all[layerName].style.visibility="hidden";
+    else if (isDomNN) 
+      document.layers[layerName].visibility="hidden";
+  }
+
+  function showLayer(layerName) {
+    if (isDOM)
+      document.getElementById(layerName).style.visibility="visible"
+    else if (isDomIE)
+      document.all[layerName].style.visibility="visible";
+    else if (isDomNN)
+      document.layers[layerName].visibility="visible";
+  }
+
+  function setyLayer(layerName, y) {
+    if (isDOM)
+      document.getElementById(layerName).style.top=y
+    else if (isDomIE)
+      document.all[layerName].style.top=y;
+    else if (isDomNN)
+      document.layers[layerName].top=y;
+  }
+
+  var id2treeIndex = new Array()
+
+  // the structure is easy to understand with a simple example
+  // p_id is the id of the parent
+  // E0                                      ( id=0,p_id=-1 )
+  //          E11                            ( id=1,p_id=0)
+  //                     E111                ( id=2,p_id=1 )
+  //                     E112                ( id=3,p_id=1 )
+  //          E12                            ( id=4,p_id=0 )
+  //                     E121                ( id=5,p_id=4 ) 
+  //          E13                            ( id=6,p_id=0 ) 
+  //                     E131                ( id=7,p_id=6 ) 
+  //                                 E1311   ( id=8,p_id=7 ) 
+  //                     E132                ( id=9,p_id=6 ) 
+  // this is a multinary tree structure which is easy to
+  // populate with database data :)
+<?php
+$sql = "SELECT id FROM gui_treegde WHERE fkey_gui_id = '".$guiList."'";
+$res = db_query($sql);
+if(!db_fetch_row($res)){
+	$sql = "INSERT INTO gui_treegde(fkey_gui_id, my_layer_title,lft,rgt,layer) VALUES('".$guiList."', 'new','1','4','')";
+	db_query($sql);
+	$sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES('".$guiList."','new','2','3','')";
+	db_query($sql);      
+}
+
+$sql = "SELECT n.wms_id, n.id, n.my_layer_title, n.lft, n.rgt, n.layer, COUNT(*) AS level1, ((n.rgt - n.lft -1)/2) AS offspring ";
+$sql .= "FROM gui_treegde as n, gui_treegde as p WHERE n.lft BETWEEN p.lft AND p.rgt ";
+$sql .= " AND n.fkey_gui_id = '".$guiList."' AND p.fkey_gui_id = '".$guiList."' ";
+$sql .= " GROUP BY n.wms_id, n.lft, n.my_layer_title,  ((n.rgt - n.lft -1)/2) , n.id, n.rgt, n.layer ORDER BY n.lft;";
+#echo $sql;
+$res = db_query($sql);
+	echo "function initArray(){";
+	echo "Note(0,-1,'','');";
+	$cnt = 0;
+	
+	while($row = db_fetch_array($res)){
+		if(db_result($res, $cnt, "level1") == 1 && $row["offspring"] >= 0 ){
+			if(count($parent) > 0){unset($parent);}
+			$level =  db_result($res, $cnt, "level1");
+			$parent[$level+1] = db_result($res, $cnt, "id");
+			echo "Note(".$row["id"].",0,'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
+			if($row["wms_id"] != ''){
+				echo ", '".$row["wms_id"]."'";
+			}
+			echo ");";
+			}
+		/**/
+		else if($row["level1"] > $level){
+			$level =  $row["level1"];
+			$parent[$level+1] = $row["id"]; 
+			echo "Note(".$row["id"].",".$parent[$level].",'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
+			if($row["wms_id"] != ''){
+				echo ", '".$row["wms_id"]."'";
+			}
+			echo ");";
+		}
+		/**/
+		else if($row["level1"] == $level){
+			$level =  $row["level1"];
+			$parent[$level+1] = $row["id"];
+			echo "Note(".$row["id"].",".$parent[$level].",'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
+			if($row["wms_id"] != ''){
+				echo ", '".$row["wms_id"]."'";
+			}
+			echo ");";
+		}
+		/**/
+		else if($row["level1"] < $level){
+			$level =  $row["level1"];
+			$parent[$level + 1] = $row["id"]; 
+			echo "Note(".$row["id"].",".$parent[$level].",'".$row["my_layer_title"]."','".$row["layer"]."',".$row["lft"];
+			if($row["wms_id"] != ''){
+				echo ", '".$row["wms_id"]."'";
+			}
+			echo ");";
+		}
+	
+		$cnt++;
+	}
+	echo "treeTyp[0] = 'f'; treeIsOn[0] = true; treeWasOn[0] = true;";
+	echo "}";
+?>	
+  function initArray_()
+  {
+    Note(0,-1,'','')
+	  Note(1,0,'Tutorials','')	  	  
+    Note(8,1,'HTML','')
+    Note(10,8,'SelfHtml','http://www.teamone.de/selfaktuell/') 
+	  Note(9,1,'willi','')
+    Note(100,9,'SelfHtml','http://www.teamone.de/selfaktuell/')       
+	  Note(3,1,'JavaScript','')
+    Note(4,3, 'Netscape Guide 1.3','http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm')
+    Note(7,3, 'Introduction to Javascript','http://rummelplatz.uni-mannheim.de/~skoch/js/script.htm')	  
+    Note(12,1, 'Perl','')
+    Note(14,12, 'Perl Tutorial','http://www.awu.id.ethz.ch/~didi/perl/perl_start.html')
+    Note(13,1,'SQL','')
+    Note(15,13, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
+	  Note(111,1, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
+    Note(2,0, 'Reference Manuals','')
+    Note(11,2, 'HTML Version 3.2 Referenz','http://www.cls-online.de/htmlref/index.htm')
+    Note(6,2,'Netscape Reference 1.3','http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm')
+    Note(17,2,'PHP Manual','http://www.php.net/manual/html/')	  
+    treeTyp[0] = 'f'
+    treeIsOn[0] = true
+    treeWasOn[0] = true
+  }
+
+  var idx=0
+  initArray()
+  initIndex()
+  load_all()
+  for( i=1; i<idx; i++ )
+  {
+    treeDeep[i] = knotDeep( treeId[i] )
+    if ( treeDeep[i] == 0 )
+      treeIsShown[i] = true
+  }
+  if ( isDomNN )
+    initStyles();
+  //-->  
+  </SCRIPT>
+</HEAD>
+<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
+ onLoad="if (layerok) showTree();"
+ MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0" onkeydown="parent.keyhandler('FolderFrame')">
+<SCRIPT language="JavaScript1.2">
+<!--
+  initDiv();
+  hideLayer("sitemapinfo");
+//-->
+</SCRIPT>
+</BODY>
+</HTML>

Added: trunk/mapbender/http/php/mod_treefolderClient.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_treefolderClient.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_treefolderClient.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,652 @@
+<?php
+session_start();
+
+import_request_variables("PG");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$guiList = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<META NAME="Generator" CONTENT="Cosmo Create 1.0.3">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+
+<TITLE>Treefolder Client</TITLE>
+    <STYLE TYPE="text/css"> 
+    <!-- 
+    .sitemap { 
+	    font-family:Arial,Helvetica;
+	    font-size:10pt;
+	    line-height:6pt;
+    }
+
+    body { margin-top:7px;
+    	font-family : Arial, Helvetica, sans-serif;
+   	font-size : 12px;
+	   font-weight : bold;
+      color: #808080;
+      margin-left:4px;
+      overflow-x: hidden;
+   }
+    a:link { 
+      text-decoration: none;
+     	font-family : Arial, Helvetica, sans-serif;
+	   font-size : 12px;
+   	font-weight : bold;
+      color: #808080; 
+    }
+    a:visited { 
+      text-decoration: none;
+    	font-family : Arial, Helvetica, sans-serif;
+   	font-size : 12px;
+	   font-weight : bold;
+      color: #808080; 
+   }
+    a:active { text-decoration: none }
+        a:active { text-decoration: none }
+    .header{
+      font-family : Arial, Helvetica, sans-serif;
+   	font-size : 14px;
+	   font-weight : bold;
+      color: #808080;
+    }
+    // -->
+    </STYLE>
+<?php
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'treeConfGDE' AND fkey_gui_id = '".$guiList."'";
+$res = db_query($sql);
+$cnt = 0;
+while(db_fetch_row($res)){ 
+	$e_target = db_result($res,0,"e_target");
+	$cnt++;
+}
+if($cnt > 1){ echo "alert('treeConfGDE: ID not unique!');";}
+echo "<script language='JavaScript'>";
+echo "var treetarget = '".$e_target."';";
+echo "</script>";
+?>
+  <SCRIPT language="JavaScript1.2">
+  <!--
+  
+  /*
+   * sitemap.js 1.31 05/02/2000
+   *  - Opera 5
+   *
+   * sitemap.js 1.3 27/11/2000
+   *  - Netscape 6
+   *
+   * sitemap.js 1.2 20/05/2000
+   *  - split array tree into arrays for each element old tree
+   *  - no mory type flag, an folder is an entry which has sons
+   *  - a folder can have an link
+   *  - while initing an default layers is shown 
+   *
+   * sitemap.js 1.1 20/10/1999
+   *  - showTree only updates and init layers new which have been really changed
+   *  - add deep to knot entry
+   *  - substitute knotDeep[ id ] w/ tree[ id2treeIndex[ id ] ].deep
+   *  - add alignment to img and a &nbsp; at the beginning of eyery line
+   *  - add a fake img for bookmarks on top panel
+   *
+   * sitemap.js 1.02 14/10/1999
+   *  - fix bug in initStyles
+   *
+   * sitemap.js 1.01 06/10/1999
+   *  - fix bug in knotDeep for Netscape 4.00-4.0.5
+   *
+   * sitemap.js 1.0 20/09/1999
+   *
+   * Javascript function for displaying hierarchic directory structures with
+   * the ability to collapse and expand directories.
+   *
+   * Copyright (c) 1999 Polzin GmbH, Duesseldorf. All Rights Reserved.
+   * Author: Lutz Eymers <ixtab at polzin.com>
+   * Download: http://www.polzin.com/inet/fset_inet.phtml?w=goodies
+   *
+   * Permission to use, copy, modify, and distribute this software
+   * and its documentation for any purposes and without fee
+   * is hereby granted provided that this copyright notice
+   * appears in all copies. 
+   *
+   * Of course, this software is provided "as is" without express or implied
+   * warranty of any kind.
+   *
+   */
+
+  window.onError=null;
+
+  var idx=0
+  var treeId = new Array();
+  var treeP_id = new Array();
+  var treeIsOn = new Array();
+  var treeTyp = new Array();
+  var treeName = new Array();
+  var treeUrl = new Array();
+  var treeWasOn = new Array();
+  var treeDeep = new Array();
+  var treeLastY = new Array();
+  var treeIsShown = new Array();
+  var treeURL = new Array();
+  var treeWMS_id = new Array();
+// o_id,level, Beschr, layer_id,lft, wms_id
+  function Note( id,p_id,name,url,left, wms_id ) {
+    treeId[ idx ] = id;
+    treeP_id[ idx ] = p_id;
+    treeIsOn[ idx ] = false;
+    treeTyp[ idx ] = 'f';
+    treeName[ idx ] = name; 
+    treeUrl[ idx ] = url ;
+    treeWasOn[ idx ] = false;
+    treeDeep[ idx ] = 0;
+    treeLastY[ idx ] = 0;
+    treeIsShown[ idx ] = false;
+    treeURL [ idx ] = url;
+    treeWMS_id [ idx ] = wms_id;
+     idx++;
+//     if(url != ''){
+//      parent.loadImage(name);
+//     }
+  }
+function handleClick(wms,layer){
+	var array_wms = new Array();
+	var array_layer = new Array();
+	array_wms = wms.split(",");
+	array_layer = layer.split(",");
+	var myObj;
+	var ind = parent.getMapObjIndexByName(treetarget);
+	for(var i=0; i<array_wms.length; i++){
+		var indwms = parent.getWMSIndexById(treetarget,array_wms[i]);
+		for(var j=0; j<parent.mb_mapObj[ind].wms[indwms].objLayer.length; j++){
+			myObj = parent.mb_mapObj[ind].wms[indwms].objLayer[j]; 
+			if(myObj.layer_name == array_layer[i] && myObj.layer_metadataurl != ""){
+				window.open(myObj.layer_metadataurl);
+			}
+		}
+	}
+}
+function handleLayer(obj){
+	var params = obj.value.split("###");
+	var array_wms = new Array();
+	var array_layer = new Array();
+	array_wms = params[0].split(",");
+	array_layer = params[1].split(",");
+	var type = params[2];
+	if(obj.checked == true){ var status = '1';}
+	else{var status = '0';}
+	//handleSelectedLayer_array(mapObj, array_wms, array_layer, type, status)
+	parent.handleSelectedLayer_array(treetarget, array_wms, array_layer, 'visible', status);
+	parent.handleSelectedLayer_array(treetarget, array_wms, array_layer, 'querylayer', status);
+}
+var cBox = new Array();
+function setObjArray(){
+	for (var i=0; i< document.getElementsByTagName("input").length; i++){
+		var temp = document.getElementsByTagName("input")[i].value.split("###");
+		array_wms = temp[0].split(",");
+		array_layer = temp[1].split(",");
+		var ind = cBox.length;
+		cBox[ind] = new Array();
+		cBox[ind]['id'] = document.getElementsByTagName("input")[i].id;
+		cBox[ind]['wms'] = new Array();
+		cBox[ind]['layer'] = new Array();
+		cBox[ind]['wms'] = array_wms;
+		cBox[ind]['layer'] = array_layer;
+	}
+}
+function checkLayer(){
+	var checkit;
+	for(var i=0; i<cBox.length; i++){
+		checkit = true;
+		for(var j=0; j<cBox[i]['wms'].length;j++){
+			var obj = parent.mb_getLayerObjByName(treetarget,cBox[i]['wms'][j],cBox[i]['layer'][j]);
+			if(obj){
+				if(obj.gui_layer_visible == '0' || obj.gui_layer_visible == 0){
+					checkit = false;
+				}
+			}
+			else{
+				alert(cBox[i]['wms'][j]+" / "+cBox[i]['layer'][j]+"not defined.");
+			}
+		}
+		if(checkit){
+			document.getElementById(cBox[i]['id']).checked = true;
+		}
+		else{
+			document.getElementById(cBox[i]['id']).checked = false;
+		}
+	}
+}
+  function initDiv ( )
+  {
+  document.writeln("<span class='header'><?php echo  $language[MSG53] ?></span>");
+    if ( isDOM || isDomIE )
+    {
+      divPrefix='<DIV CLASS="sitemap" style="position:absolute; left:0; top:0; visibility:hidden;" ID="sitemap'
+      divInfo='<DIV CLASS="sitemap" style="position:absolute; visibility:visible" ID="sitemap'
+    }
+    else
+    {
+      divPrefix='<DIV CLASS="sitemap" ID="sitemap'
+      divInfo='<DIV CLASS="sitemap" ID="sitemap'
+    }
+    document.writeln( divInfo +  'info">Bitte haben Sie etwas Geduld.<BR>&nbsp;<BR>Es werden die Eintr&auml;ge aus<BR>&nbsp;<BR>der Datenbank initialisiert.</DIV> ' );
+	 document.writeln("<form name='treeForm'>");
+    for ( var i=1; i<idx; i++ )
+    {
+	 
+      // linked Name ? 
+      if ( treeUrl[i] != '' ){
+      linkedName = "<input type='checkbox' id='c_"+i+"' value='"+treeWMS_id[i]+"###"+treeUrl[i]+"' onClick='handleLayer(this)'>";
+      //linkedName += "<input type='checkbox' id='q"+i+"' value='"+treeWMS_id[i]+"###"+treeUrl[i]+"###querylayer' onClick='handleLayer(this.value)'>";
+      linkedName += "<IMG SRC='../img/tree/1w.gif' BORDER='0' WIDTH='3'>";
+      linkedName += "<A onclick='handleClick(\""+treeWMS_id[i]+"\",\""+treeUrl[i]+"\")' style='cursor:pointer'>" + treeName[i] + "</A>";
+      }
+      else{
+        linkedName =  '<IMG SRC="../img/tree/1w.gif" BORDER="0" WIDTH="3">' + treeName[i];
+       }
+      // don't link folder icon if node has no sons
+      if ( i == idx-1 || treeP_id[i+1] != treeId[i] ) {
+        if ( treeDeep[ i ] == 0 )
+          folderImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="1" HSPACE="0">'
+        else
+          folderImg = ''
+      } else {
+        folderImg = '<A HREF="javascript:sitemapClick(' + treeId[i] + ')"><IMG ALIGN="BOTTOM" SRC="../img/tree/folder_off.gif" BORDER="0" NAME="folder' + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0"></A>'
+      }
+      // which type of file icon should be displayed?
+      if ( treeP_id[i] != 0 )
+      {
+        if ( lastEntryInFolder( treeId[i] ) )
+          fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_last.gif" BORDER="0" NAME="file'
+            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
+        else    
+          fileImg = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file.gif" BORDER="0" NAME="file'
+            + treeId[i] + '" HEIGHT="16" WIDTH="30" HSPACE="0">'  
+      }
+      else
+        fileImg = ''
+      // traverse parents up to root and show vertical lines if parent 
+      // is not the last entry on this layer
+      verticales = ''
+      for( var act_id=treeId[i] ; treeDeep[ id2treeIndex[ act_id ] ] > 1;  )
+      {  
+        act_id = treeP_id[ id2treeIndex[ act_id ]]
+        if ( lastEntryInFolder( act_id ) )
+        {
+          verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_empty.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
+        }
+        else
+        {
+          verticales = '<IMG ALIGN="BOTTOM" SRC="../img/tree/file_vert.gif" BORDER="0" HEIGHT="16" WIDTH="30" HSPACE="0">' + verticales
+        }
+      }
+
+      
+      document.writeln( divPrefix + treeId[i] + '"><NOBR>&nbsp;' + verticales + fileImg + folderImg + linkedName + '</NOBR></DIV>'
+      )  
+    }
+	  document.writeln("</form>");
+  }
+
+  function initStyles ( )
+  {
+    document.writeln( '<STYLE TYPE="text/css">' + "\n" + '<!--' )
+    for ( var i=1,y=y0; i<idx; i++ )
+    {  
+      document.writeln( '#sitemap' + treeId[i] + ' {POSITION: absolute; VISIBILITY: hidden;}' )
+      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
+        y += deltaY
+    }
+    document.writeln( '#sitemapinfo {POSITION: absolute; VISIBILITY: visible;}' )
+    document.writeln( '//-->' + "\n" + '</STYLE>' )
+  }
+
+
+
+  function sitemapClick( id )
+  {
+    var i = id2treeIndex[ id ]
+
+    if ( treeIsOn[ i ] )
+    // close directory
+    {
+      // mark node as invisible
+      treeIsOn[ i ]=false
+      // mark all sons as invisible
+      actDeep = treeDeep[ i ]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
+      {
+        treeWasOn[ j ] = treeIsOn[ j ]
+        treeIsOn[ j ]=false
+      }
+      gif_off( id )
+    }
+    else
+    // open directory
+    { 
+      treeIsOn[ i ]=true
+      // remember and restore old status
+      actDeep = treeDeep[ i ]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep; j++ )
+      {
+        treeIsOn[ j ] = treeWasOn[ j ]
+      }
+      gif_on( id )
+    }
+    showTree()
+  }
+
+  function knotDeep( id )
+  {
+    var deep=0
+    while ( true )
+      if ( treeP_id[ id2treeIndex[id] ] == 0 )
+        return deep
+      else
+      {
+        ++deep
+        id = treeP_id[ id2treeIndex[id] ]
+      }
+    return deep  
+  }
+
+  function initTree( id )
+  {
+    treeIsOn[ id2treeIndex[id] ] = true
+    if ( treeTyp[ id2treeIndex[id] ] != 'b' )
+      gif_on( id ) 
+    while ( treeP_id[ id2treeIndex[id] ] != 0 )
+    {
+      id = treeP_id[ id2treeIndex[id] ]
+      treeIsOn[ id2treeIndex[id] ] = true
+      if ( treeTyp[ id2treeIndex[id] ] != 'b' )
+        gif_on( id ) 
+    }
+  }
+
+  function lastEntryInFolder( id )
+  {
+    var i = id2treeIndex[id]
+    if ( i == idx-1 )
+      return true
+    if ( treeTyp[i] == 'b' )
+    {
+      if ( treeP_id[i+1] != treeP_id[i] )
+        return true
+      else 
+        return false
+    }
+    else
+    {
+      var actDeep = treeDeep[i]
+      for( var j=i+1; j<idx && treeDeep[j] > actDeep ; j++ )
+      ;
+      if ( j<idx && treeDeep[j] == actDeep )
+        return false
+      else
+        return true
+    }
+  }
+
+  function showTree()
+  {
+    for( var i=1, y=y0, x=x0; i<idx; i++ )
+    {
+      if ( treeIsOn[ id2treeIndex[ treeP_id[i] ] ] )
+      {
+        // show current node
+        if ( !(y == treeLastY[i] && treeIsShown[i] ) )
+        {
+          showLayer( "sitemap"+ treeId[i] ) 
+          setyLayer( "sitemap"+ treeId[i], y )
+          treeIsShown[i] = true
+        } 
+        treeLastY[i] = y
+        y += deltaY
+      }
+      else
+      {
+        // hide current node and all sons
+        if ( treeIsShown[ i ] )
+        {
+          hideLayer( "sitemap"+ treeId[i] ) 
+          treeIsShown[i] = false
+        }
+      }
+    }
+  }
+
+  function initIndex() {
+    for( var i=0; i<idx; i++ )
+      id2treeIndex[ treeId[i] ] = i
+  }
+
+  function gif_name (name, width, height) {
+    this.on = new Image (width, height);
+    this.on.src ="../img/tree/" +  name + "_on.gif"
+    this.off = new Image (width, height);
+    this.off.src ="../img/tree/" +  name + "_off.gif"
+  }
+
+  function load_gif (name, width, height) {
+    gif_name [name] = new gif_name (name,width,height);
+  }
+
+  function load_all () {
+    load_gif ('folder',30,16)
+    file_last = new Image( 30,16 )
+    file_last.src = "file_last.gif"
+    file_middle = new Image( 30,16 )
+    file_middle.src = "file.gif"
+    file_vert = new Image( 30,16 )
+    file_vert.src = "file_vert.gif"
+    file_empty = new Image( 30,16 )
+    file_empty = "file_empty.gif"
+  }
+
+  function gif_on ( id ) {
+    eval("document['folder" + id + "'].src = gif_name['folder'].on.src")
+  }
+
+  function gif_off ( id ) {
+    eval("document['folder" + id + "'].src = gif_name['folder'].off.src")
+  }
+ 
+  // global configuration
+  var deltaX = 30
+  var deltaY = 16
+  var x0 = 5
+  var y0 = 20
+  var defaultTarget = '_blank'
+
+  var browserName = navigator.appName;
+  var browserVersion = parseInt(navigator.appVersion);
+  var isIE = false;
+  var isNN = false;
+  var isDOM = false;
+  var isDomIE = false;
+  var isDomNN = false;
+  var layerok = false;
+
+  var isIE = browserName.indexOf("Microsoft Internet Explorer" )==-1?false:true;
+  var isNN = browserName.indexOf("Netscape")==-1?false:true;
+  var isOpera = browserName.indexOf("Opera")==-1?false:true;
+  var isDOM = document.getElementById?true:false;
+  var isDomNN = document.layers?true:false;
+  var isDomIE = document.all?true:false;
+
+  if ( isNN && browserVersion>=4 ) layerok=true;
+  if ( isIE && browserVersion>=4 ) layerok=true;
+  if ( isOpera && browserVersion>=5 ) layerok=true;
+
+    
+  function hideLayer(layerName) {
+    if (isDOM)
+      document.getElementById(layerName).style.visibility="hidden"
+    else if (isDomIE)
+      document.all[layerName].style.visibility="hidden";
+    else if (isDomNN) 
+      document.layers[layerName].visibility="hidden";
+  }
+
+  function showLayer(layerName) {
+    if (isDOM)
+      document.getElementById(layerName).style.visibility="visible"
+    else if (isDomIE)
+      document.all[layerName].style.visibility="visible";
+    else if (isDomNN)
+      document.layers[layerName].visibility="visible";
+  }
+
+  function setyLayer(layerName, y) {
+    if (isDOM)
+      document.getElementById(layerName).style.top=y
+    else if (isDomIE)
+      document.all[layerName].style.top=y;
+    else if (isDomNN)
+      document.layers[layerName].top=y;
+  }
+
+  var id2treeIndex = new Array()
+
+  // the structure is easy to understand with a simple example
+  // p_id is the id of the parent
+  // E0                                      ( id=0,p_id=-1 )
+  //          E11                            ( id=1,p_id=0)
+  //                     E111                ( id=2,p_id=1 )
+  //                     E112                ( id=3,p_id=1 )
+  //          E12                            ( id=4,p_id=0 )
+  //                     E121                ( id=5,p_id=4 ) 
+  //          E13                            ( id=6,p_id=0 ) 
+  //                     E131                ( id=7,p_id=6 ) 
+  //                                 E1311   ( id=8,p_id=7 ) 
+  //                     E132                ( id=9,p_id=6 ) 
+  // this is a multinary tree structure which is easy to
+  // populate with database data :)
+<?php
+$sql = "SELECT id FROM gui_treegde WHERE fkey_gui_id = '".$guiList."'";
+$res = db_query($sql);
+if(!db_fetch_row($res)){
+	$sql = "INSERT INTO gui_treegde(fkey_gui_id, my_layer_title,lft,rgt,layer) VALUES('".$guiList."', 'new','1','4','')";
+	db_query($sql);
+	$sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES('".$guiList."','new','2','3','')";
+	db_query($sql);      
+}
+
+$sql = "SELECT n.wms_id, n.id, n.my_layer_title, n.lft, n.rgt, n.layer, COUNT(*) AS level1, ((n.rgt - n.lft -1)/2) AS offspring ";
+$sql .= "FROM gui_treegde as n, gui_treegde as p WHERE n.lft BETWEEN p.lft AND p.rgt ";
+$sql .= " AND n.fkey_gui_id = '".$guiList."' AND p.fkey_gui_id = '".$guiList."' ";
+$sql .= " GROUP BY n.wms_id, n.lft, n.my_layer_title,  ((n.rgt - n.lft -1)/2) , n.id, n.rgt, n.layer ORDER BY n.lft";
+
+$res = db_query($sql);
+	echo "function initArray(){";
+	echo "Note(0,-1,'','');";
+	$cnt = 0;
+	
+	while(db_fetch_row($res)){
+		if(db_result($res, $cnt, "level1") == 1 && db_result($res, $cnt, "offspring") >= 0 ){
+			if(count($parent) > 0){unset($parent);}
+			$level =  db_result($res, $cnt, "level1");
+			$parent[$level+1] = db_result($res, $cnt, "id");
+			
+			echo "Note(".db_result($res, $cnt, "id").",0,'".db_result($res, $cnt, "my_layer_title")."','".db_result($res, $cnt, "layer")."',".db_result($res, $cnt, "lft");
+			if(db_result($res, $cnt, "wms_id") != ''){
+				echo ", '".db_result($res, $cnt, "wms_id")."'";
+			}
+			echo ");";
+			}
+		/**/
+		else if(db_result($res, $cnt, "level1") > $level){
+			$level =  db_result($res, $cnt, "level1");
+			$parent[$level+1] = db_result($res, $cnt, "id"); 
+			echo "Note(".db_result($res, $cnt, "id").",".$parent[$level].",'".db_result($res, $cnt, "my_layer_title")."','".db_result($res, $cnt, "layer")."',".db_result($res, $cnt, "lft");
+			if(db_result($res, $cnt, "wms_id") != ''){
+				echo ", '".db_result($res, $cnt, "wms_id")."'";
+			}
+			echo ");";
+		}
+		/**/
+		else if(db_result($res, $cnt, "level1") == $level){
+			$level =  db_result($res, $cnt, "level1");
+			$parent[$level+1] = db_result($res, $cnt, "id");
+			echo "Note(".db_result($res, $cnt, "id").",".$parent[$level].",'".db_result($res, $cnt, "my_layer_title")."','".db_result($res, $cnt, "layer")."',".db_result($res, $cnt, "lft");
+			if(db_result($res, $cnt, "wms_id") != ''){
+				echo ", '".db_result($res, $cnt, "wms_id")."'";
+			}
+			echo ");";
+		}
+		/**/
+		else if(db_result($res, $cnt, "level1") < $level){
+			$level =  db_result($res, $cnt, "level1");
+			$parent[$level + 1] = db_result($res, $cnt, "id"); 
+			echo "Note(".db_result($res, $cnt, "id").",".$parent[$level].",'".db_result($res, $cnt, "my_layer_title")."','".db_result($res, $cnt, "layer")."',".db_result($res, $cnt, "lft");
+			if(db_result($res, $cnt, "wms_id") != ''){
+				echo ", '".db_result($res, $cnt, "wms_id")."'";
+			}
+			echo ");";
+		}
+	
+		$cnt++;
+	}
+	echo "treeTyp[0] = 'f'; treeIsOn[0] = true; treeWasOn[0] = true;";
+	echo "}";
+?>
+  function initArray_()
+  {
+    Note(0,-1,'','')
+	  Note(1,0,'Tutorials','')	  	  
+    Note(8,1,'HTML','')
+    Note(10,8,'SelfHtml','http://www.teamone.de/selfaktuell/') 
+	  Note(9,1,'willi','')
+    Note(100,9,'SelfHtml','http://www.teamone.de/selfaktuell/')       
+	  Note(3,1,'JavaScript','')
+    Note(4,3, 'Netscape Guide 1.3','http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm')
+    Note(7,3, 'Introduction to Javascript','http://rummelplatz.uni-mannheim.de/~skoch/js/script.htm')	  
+    Note(12,1, 'Perl','')
+    Note(14,12, 'Perl Tutorial','http://www.awu.id.ethz.ch/~didi/perl/perl_start.html')
+    Note(13,1,'SQL','')
+    Note(15,13, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
+	  Note(111,1, 'Introduction to SQL','http://w3.one.net/~jhoffman/sqltut.htm')
+    Note(2,0, 'Reference Manuals','')
+    Note(11,2, 'HTML Version 3.2 Referenz','http://www.cls-online.de/htmlref/index.htm')
+    Note(6,2,'Netscape Reference 1.3','http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm')
+    Note(17,2,'PHP Manual','http://www.php.net/manual/html/')	  
+    treeTyp[0] = 'f'
+    treeIsOn[0] = true
+    treeWasOn[0] = true
+  }
+
+  var idx=0
+  initArray()
+  initIndex()
+  load_all()
+  for( i=1; i<idx; i++ )
+  {
+    treeDeep[i] = knotDeep( treeId[i] )
+    if ( treeDeep[i] == 0 )
+      treeIsShown[i] = true
+  }
+  if ( isDomNN )
+    initStyles();
+  //-->  
+  </SCRIPT>
+</HEAD>
+<BODY VLINK="#000000" ALINK="#000000" LINK="#000000" BGCOLOR="#ffffff" TEXT="#000000"
+ onLoad="if (layerok) showTree();" 
+ >
+ <!-- onkeydown="parent.keyhandler('FolderFrame')"-->
+<SCRIPT language="JavaScript1.2">
+<!--
+  initDiv();
+  hideLayer("sitemapinfo");
+  setObjArray();
+//-->
+</SCRIPT>
+</BODY>
+</HTML>

Added: trunk/mapbender/http/php/mod_updateWMS.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_updateWMS.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_updateWMS.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,171 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+
+require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+import_request_variables("PG");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>updateWMS</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type='text/javascript'>
+function validate(){
+	var ind = document.form1.selWMS.selectedIndex;
+	if(ind < 0){
+		alert("No WMS selected!");
+		return;
+	}
+	else{
+		document.form1.submit();
+	}
+}
+function sel(){
+	var ind = document.form1.selWMS.selectedIndex;
+	var wmsData = document.form1.selWMS.options[ind].value.split("###");
+	document.form1.capURL.value = wmsData[1];
+	document.form1.myWMS.value = wmsData[0];
+}
+</script>
+</head>
+<body>
+<form name='form1' action='<?php  $PHP_SELF ?>' method='POST'>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+$permguis = $admin->getGuisByPermission($_SESSION["mb_user_id"]);
+$wms_id_own = $admin->getWmsByOwnGuis($ownguis);
+
+if (count($wms_id_own)>0 AND count($ownguis)>0 AND count($permguis)>0){
+	$sql = "SELECT wms_id, wms_title, wms_getcapabilities  FROM wms ";
+	$sql .= "WHERE wms_id IN(";
+	for($i=0; $i<count($wms_id_own); $i++){
+		if($wms_id_own[$i] != ''){
+		if($i>0){ $sql .= ",";}
+		$sql .= "'".$wms_id_own[$i]."'";
+		}
+	}
+	$sql .= ")";
+	$sql .= " ORDER BY wms_title";
+	$res = db_query($sql);
+	$cnt = 0;
+	echo "<select name='selWMS' size='15' onchange='sel()'>";
+	while($row = db_fetch_array($res)){
+		echo "<option value='".$row['wms_id']."###".$row['wms_getcapabilities']."'>".$row['wms_title']."</option>";
+		$cnt++;
+	}
+	echo "</select><br /><br />";
+	echo "Link to the last uploaded Online Resource URL:<br><input type='text' size='120' name='capURL'><br />";
+	echo "<input type='hidden' name='myWMS' value=''><br>";
+	echo "Add the following REQUEST to the Online Resource URL to obtain the Capabilities document:<br>";
+	echo "<i>(Triple click to select and copy)</i><br>"; 
+	echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1<br>";
+	echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0<br>";
+	echo "REQUEST=capabilities&WMTVER=1.0.0<br><br>";
+	echo "Link to new WMS Capabilities URL:<br><input size='120' type='text' name='myURL'><br>";
+	echo "<input type='button' value='Preview Capabilities' onclick='window.open(this.form.myURL.value,\"\",\"\")'>&nbsp;";
+	echo "<input type='button' value='Upload Capabilities' onclick='validate()'><br>";
+
+/**/
+if(isset($myURL) && $myURL != ''){
+	$myURL=mb_validateInput($myURL);
+
+	$mywms = new wms();
+	$mywms->createObjFromXML($myURL);    
+	$mywms->optimizeWMS();
+	echo "<br />";  
+	$mywms->updateObjInDB($myWMS);
+	$mywms->displayWMS();
+
+	//
+	//
+	// start (owners of the updated wms will be notified by email)
+	//
+	//
+
+	
+	if ($use_php_mailing) {
+		$owner = $admin->getOwnerByWms($myWMS);
+		
+		if ($owner && count($owner)>0) {
+			$owner_ids = array();
+			$owner_mail_addresses = array();
+			for ($i=0; $i<count($owner); $i++) {
+				$tmp_array = $admin->getUserIdByUserName($owner[$i]);
+				$owner_ids[$i] = $tmp_array[0]; 
+			}
+			$j=0;
+			for ($i=0; $i<count($owner_ids); $i++) {
+				$adr_tmp = $admin->getEmailByUserId($owner_ids[$i]);
+				if (!in_array($adr_tmp, $owner_mail_addresses) && $adr_tmp) {
+					$owner_mail_addresses[$j] = $adr_tmp;
+					$j++;
+				} 
+			}
+			
+			$replyto = $admin->getEmailByUserId($_SESSION["mb_user_id"]);
+			$from = $replyto;
+			$pathArray = explode("http/php/", $_SERVER["PATH_TRANSLATED"]);
+			$path = $pathArray[0];		
+			$body = "WMS '" . $admin->getWmsTitleByWmsId($myWMS) . "' has been updated. \n\nServer name:  " . $_SERVER["SERVER_NAME"] . "\nInstallation Path: " . $path . "\n\nYou may want to check the changes as you are an owner of this WMS.";
+			$error_msg = "";
+			for ($i=0; $i<count($owner_mail_addresses); $i++) {
+				if (!$admin->sendEmail($replyto, $from, $owner_mail_addresses[$i], $owner_mail_addresses[$i], "[Mapbender] A user has updated one of your WMS", $body, $error)) {
+					if ($error){
+						$error_msg .= $error . " ";
+					}
+				}
+			}
+			if (!$error_msg) {
+				echo "<script language='javascript'>";
+				echo "alert('Other owners of this WMS have been informed about the changes!');";
+				echo "</script>";
+			}
+			else {
+				echo "<script language='javascript'>";
+				echo "alert('When notifying the owners of this WMS about your changes, an error occured: ' + '" . $error_msg . "');";
+				echo "</script>";
+			}
+		}
+	}
+	//
+	//
+	// end (owners of the updated wms will be notified by email)
+	//
+	//
+	
+}
+
+	echo "</form>";
+	echo "</body>";
+}else{
+	echo "There are no wms available for this user.<br>";
+}
+?>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_usemap.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_usemap.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_usemap.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,34 @@
+<html>
+<head>
+<?php
+require_once("../../conf/mapbender.conf");
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>image map generator</title>
+</head>
+<?php
+include_once("../classes/class_gml.php");
+$url = urldecode($_REQUEST["url"]);
+$gml[0] = file_get_contents($url);
+$g = new gml();
+$g->addGml($gml);
+$data = $g->getAllGeomColl();
+echo "<script language='JavaScript'>";
+echo "var um_title = new Array();";
+echo "var um_x = new Array();";
+echo "var um_y = new Array();";
+	for($ii=0; $ii<count($data[0]->member);$ii++){
+		echo "um_title[um_title.length] = '".$data[0]->member[$ii]->attributes["firma"]."';";
+		echo "um_x[um_x.length] = ".$data[0]->member[$ii]->geometry[0]->realx[0].";";
+		echo "um_y[um_y.length] = ".$data[0]->member[$ii]->geometry[0]->realy[0].";";
+	}
+echo "</script>"
+?>
+<script language="JavaScript" type="text/javascript">
+function init(){
+	parent.mod_usemap_set(um_title,um_x,um_y)
+}  
+</script>  
+<body onload='init()'>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_user_filteredGroup.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_user_filteredGroup.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_user_filteredGroup.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,192 @@
+<?php
+#$Id: mod_user_filteredGroup.php,v 1.14 2006/03/09 11:27:41 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_user_filteredGroup.php,v 1.14 2006/03/09 11:27:41 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add User to Group</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+		document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = '".$selected_user."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_user_id, fkey_mb_group_id) VALUES('$selected_user', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get owner groups  ********************************************************************************************/
+#$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$sql_group = "SELECT * FROM mb_group WHERE mb_group_owner='".$logged_user_id."' ORDER BY mb_group_name";
+
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get owner group from selected_user******************************************************************************/
+$sql_user_mb_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id FROM mb_user_mb_group ";
+$sql_user_mb_group .= "INNER JOIN mb_group ON mb_user_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id='";
+
+if(!$selected_user){$sql_user_mb_group .= $user_id[0];}
+if($selected_user){$sql_user_mb_group .= $selected_user;}
+$sql_user_mb_group .= "' AND mb_group.mb_group_owner = '".$logged_user_id."'";
+$sql_user_mb_group .= " ORDER BY mb_group.mb_group_name";
+$res_user_mb_group = db_query($sql_user_mb_group);
+while($row = db_fetch_array($res_user_mb_group)){
+	$group_id_user[$cnt_group_user] = $row["mb_group_id"];
+	$group_name_user[$cnt_group_user] =  $row["mb_group_name"];
+	$cnt_group_user++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all group in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $group_id_user[$i]  . "'>" . $group_name_user[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_user_filteredGui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_user_filteredGui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_user_filteredGui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,226 @@
+<?php
+# $Id: mod_user_filteredGui.php,v 1.14 2006/03/09 08:41:26 uli_rothstein Exp $
+# $Head$
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import_request_variables("PG");
+session_start();
+$gui_id = $_SESSION["mb_user_gui"];
+//require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Add User to Group</title>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+		document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}        
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+require_once("../php/mb_getGUIs.php");
+
+$fieldHeight = 25;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$exists = false;
+$cnt_gui_user = 0;
+$cnt_gui_logged_user = 0;
+
+$gui_id_array = array();
+
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_mb_user_id = '".$selected_user."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_mb_user_id, fkey_gui_id) VALUES('$selected_user', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get allocated gui  ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_gui .= ",";}
+	$sql_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+
+
+/*get allocated gui from logged_user******************************************************************************/
+$sql_logged_user_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id FROM gui_mb_user ";
+$sql_logged_user_mb_gui .= "INNER JOIN gui ON gui_mb_user.fkey_gui_id = gui.gui_id ";
+$sql_logged_user_mb_gui .= "WHERE gui_mb_user.fkey_mb_user_id='".$logged_user_id."'";
+$sql_logged_user_mb_gui .= " ORDER BY gui.gui_name";
+
+
+$res_logged_user_mb_all_gui = db_query($sql_logged_user_mb_gui);
+while($roe = db_fetch_array($res_logged_user_mb_all_gui)){
+	$gui_id_logged_user[$cnt_gui_logged_user] = $row["gui_id"];
+	$gui_name_logged_user[$cnt_gui_logged_user] =  $row["gui_name"];
+	$cnt_gui_logged_user++;
+}
+
+/*get allocated gui from selected_user******************************************************************************/
+$sql_user_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id FROM gui_mb_user ";
+$sql_user_mb_gui .= "INNER JOIN gui ON gui_mb_user.fkey_gui_id = gui.gui_id ";
+$sql_user_mb_gui .= "WHERE gui_mb_user.fkey_mb_user_id=";
+if(!$selected_user){$sql_user_mb_gui .= $user_id[0];}
+if($selected_user){$sql_user_mb_gui .= $selected_user;}
+$sql_user_mb_gui .= " AND gui.gui_id IN(";
+for($i=0; $i<count($arrayGuis); $i++){
+	if($i>0){ $sql_user_mb_gui .= ",";}
+	$sql_user_mb_gui .= "'".$arrayGuis[$i]."'";
+}
+$sql_user_mb_gui .= ") ORDER BY gui.gui_name";
+
+$res_user_mb_gui = db_query($sql_user_mb_gui);
+while($row = db_fetch_array($res_user_mb_gui)){
+	$gui_id_user[$cnt_gui_user] = $row["gui_id"];
+	$gui_name_user[$cnt_gui_user] =  $row["gui_name"];
+	$cnt_gui_user++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i] . "</option>";}
+echo "</select>";
+/*insert allocated gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+/*Button****************************************************************************************************/
+echo "<div class='button1' ><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' style='background:#ffffff' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $gui_id_user[$i]  . "'>" . $gui_name_user[$i]  . "</option>";
+}
+
+echo "</select>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_user_group.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_user_group.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_user_group.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,188 @@
+<?php
+#$Id: mod_user_group.php,v 1.14 2006/03/09 10:43:33 uli_rothstein Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/php/mod_user_group.php,v 1.14 2006/03/09 10:43:33 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+session_start();
+
+require_once("mb_validateSession.php");
+require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+include '../include/dyn_css.php'; 
+?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+		document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_group[]"].selectedIndex == -1){
+				document.getElementsByName("remove_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_group[]"].selectedIndex == -1){
+				document.getElementsByName("selected_group[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$exists = false;
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_group)>0){
+		for($i=0; $i<count($selected_group); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = '".$selected_user."' and fkey_mb_group_id = '".$selected_group[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+    			$sql_insert = "INSERT INTO mb_user_mb_group(fkey_mb_user_id, fkey_mb_group_id) VALUES('$selected_user', '".$selected_group[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_group)>0){
+		for($i=0; $i<count($remove_group); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = '".$remove_group[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get all groups  ********************************************************************************************/
+$sql_group = "SELECT * FROM mb_group ORDER BY mb_group_name";
+$res_group = db_query($sql_group);
+while($row = db_fetch_array($res_group)){
+	$group_id[$cnt_group] = $row["mb_group_id"];
+	$group_name[$cnt_group] = $row["mb_group_name"];
+	$cnt_group++;
+}
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get all group from selected_user******************************************************************************/
+$sql_user_mb_group = "SELECT mb_group.mb_group_id, mb_group.mb_group_name, mb_user_mb_group.fkey_mb_user_id FROM mb_user_mb_group ";
+$sql_user_mb_group .= "INNER JOIN mb_group ON mb_user_mb_group.fkey_mb_group_id = mb_group.mb_group_id ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id='";
+
+if(!$selected_user){$sql_user_mb_group .= $user_id[0];}
+if($selected_user){$sql_user_mb_group .= $selected_user;}
+$sql_user_mb_group .= "' ORDER BY mb_group.mb_group_name";
+$res_user_mb_group = db_query($sql_user_mb_group);
+while($row = db_fetch_array($res_user_mb_group)){
+	$group_id_user[$cnt_group_user] = $row["mb_group_id"];
+	$group_name_user[$cnt_group_user] =  $row["mb_group_name"];
+	$cnt_group_user++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all group in selectbox**************************************************************************/
+echo "<div class='text2'>GROUP:</div>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group; $i++){
+	echo "<option value='" . $group_id[$i]  . "'>" . $group_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_group_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GROUP:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_group[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "<option value='" . $group_id_user[$i]  . "'>" . $group_name_user[$i]  . "</option>";
+}
+echo "</select>";
+
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_user_gui.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_user_gui.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_user_gui.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,183 @@
+<?php
+# $Id: mod_user_gui.php,v 1.15 2006/03/09 12:11:54 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_user_gui.php,v 1.15 2006/03/09 12:11:54 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+import_request_variables("PG");
+session_start();
+$gui_id = $_SESSION["mb_user_gui"];
+//require_once("mb_validateInput.php");
+require_once("../../conf/mapbender.conf");
+require_once("../classes/class_wms.php"); 
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<?php include '../include/dyn_css.php'; ?>
+<script language="JavaScript">
+function validate(wert){
+	if(document.forms[0]["selected_user"].selectedIndex == -1){
+		document.getElementsByName("selected_user")[0].style.backgroundColor = '#ff0000';
+		return;
+	}else{
+		if(wert == "remove"){
+			if(document.forms[0]["remove_gui[]"].selectedIndex == -1){
+				document.getElementsByName("remove_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.remove.value = 'true';
+			document.form1.submit();
+		}
+		if(wert == "insert"){
+			if(document.forms[0]["selected_gui[]"].selectedIndex == -1){
+				document.getElementsByName("selected_gui[]")[0].style.backgroundColor = '#ff0000';
+				return;
+			}
+			document.form1.insert.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+</head>
+<body>
+<?php
+$fieldHeight = 20;
+
+$cnt_gui = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_gui_user = 0;
+$cnt_gui_group = 0;
+$exists = false;
+
+$gui_id_array = array();
+
+
+/*handle remove, update and insert**************************************************************************************/
+if($insert){
+	if(count($selected_gui)>0){
+		for($i=0; $i<count($selected_gui); $i++){
+			$exists = false;
+			$sql_insert = "SELECT * from gui_mb_user where fkey_mb_user_id = '".$selected_user."' and fkey_gui_id = '".$selected_gui[$i]."'";
+			$res_insert = db_query($sql_insert);
+			while($row = db_fetch_array($res_insert)){$exists = true;}
+			if($exists == false){
+				$sql_insert = "INSERT INTO gui_mb_user(fkey_mb_user_id, fkey_gui_id) VALUES('$selected_user', '".$selected_gui[$i]."');";
+				$res_insert = db_query($sql_insert);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_gui)>0){
+		for($i=0; $i<count($remove_gui); $i++){
+			$sql_remove = "DELETE FROM gui_mb_user WHERE fkey_gui_id = '".$remove_gui[$i]."' and fkey_mb_user_id = '$selected_user'";
+			db_query($sql_remove);
+		}
+	}
+}
+
+/*get all gui  ********************************************************************************************/
+$sql_gui = "SELECT * FROM gui ORDER BY gui_name";
+$res_gui = db_query($sql_gui);
+while($row = db_fetch_array($res_gui)){
+	$gui_id_array[$cnt_gui] = $row["gui_id"];
+	$gui_name[$cnt_gui] = $row["gui_name"];
+	$cnt_gui++;
+}
+
+/*get all user **********************************************************************************************/
+$sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
+
+$res_user = db_query($sql_user);
+while($row = db_fetch_array($res_user)){
+	$user_id[$cnt_user] = $row["mb_user_id"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$cnt_user++;
+}
+
+/*get all gui from selected_user******************************************************************************/
+$sql_user_mb_gui = "SELECT gui.gui_id, gui.gui_name, gui_mb_user.fkey_mb_user_id FROM gui_mb_user ";
+$sql_user_mb_gui .= "INNER JOIN gui ON gui_mb_user.fkey_gui_id = gui.gui_id ";
+$sql_user_mb_gui .= "WHERE gui_mb_user.fkey_mb_user_id=";
+
+if(!$selected_user){$sql_user_mb_gui .= $user_id[0];}
+if($selected_user){$sql_user_mb_gui .= $selected_user;}
+$sql_user_mb_gui .= " ORDER BY gui.gui_name";
+$res_user_mb_gui = db_query($sql_user_mb_gui);
+while($row = db_fetch_array($res_user_mb_gui)){
+	$gui_id_user[$cnt_gui_user] = $row["gui_id"];
+	$gui_name_user[$cnt_gui_user] =  $row["gui_name"];
+	$cnt_gui_user++;
+}
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
+
+/*insert all user in selectbox*************************************************************************************/
+echo "<div class='text1'>USER: </div>";
+echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i] . "' ";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*insert all gui in selectbox**************************************************************************/
+echo "<div class='text2'>GUI:</div><br>";
+echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui; $i++){
+	echo "<option value='" . $gui_id_array[$i]  . "'>" . $gui_name[$i]  . "</option>";
+}
+echo "</select>";
+
+/*Button****************************************************************************************************/
+
+echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
+echo "<input type='hidden' name='insert'>";
+
+echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
+echo "<input type='hidden' name='remove'>";
+
+/*insert user_gui_dependence in selectbox**************************************************/
+echo "<div class='text3'>SELECTED GUI:</div>";
+echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_gui[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "<option value='" . $gui_id_user[$i]  . "'>" . $gui_name_user[$i]  . "</option>";
+}
+echo "</select>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_user.focus();
+// -->
+</script>
+
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfs.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,152 @@
+<?php
+# $Id: mod_wfs.php,v 1.5 2006/03/09 12:11:07 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_wfs.php,v 1.5 2006/03/09 12:11:07 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# session_start();
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>mod_wfs</title>
+<script language='JavaScript' type='text/javascript'>
+var wfs_conf = new Array();
+function register(){
+	var isReg = false;
+	for(var i=0; i<parent.mb_InitFunctions.length; i++){
+		if(parent.mb_InitFunctions[i] == (window.name+".fetchInf()")){
+			isReg = true;
+		}
+	}
+	if(isReg == false){
+		parent.mb_registerInitFunctions(window.name+".fetchInf()");
+	}
+}
+function fetchInf(){
+	var wfs = new Array();
+	var l;
+	var ind = parent.getMapObjIndexByName('mapframe1');
+	for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+		for(var j=0; j<parent.mb_mapObj[ind].wms[i].objLayer.length; j++){
+			l = parent.mb_mapObj[ind].wms[i].objLayer[j];			
+			if(l.gui_layer_wfs_featuretype != ""){
+				wfs[wfs.length] = l.gui_layer_wfs_featuretype; 
+			}
+		}	
+	}	
+	document.location.href = "../php/mod_wfs.php?id=" + wfs.join(",");
+	
+}
+function get_wfs_conf(){
+	return wfs_conf;
+}
+var iamready = false;
+</script>
+<?php
+echo "<script language='JavaScript' type='text/javascript'>";
+if(isset($_REQUEST['id'])){
+	$wfs = split(",",$_REQUEST['id']);
+	
+	$con = db_connect($DBSERVER,$OWNER,$PW);
+	db_select_db($DB,$con);
+	
+	for($i=0; $i<count($wfs); $i++){	
+		
+		/* wfs_conf */
+	
+		
+		$sql = "SELECT * FROM wfs_conf ";
+		$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+		$sql .= "WHERE wfs_conf.wfs_conf_id = ".$wfs[$i];
+		
+		$res = db_query($sql);
+	
+		if($row = db_fetch_array($res)){
+			$wfs_id  = $row["fkey_wfs_id"];
+			$featuretype_id  = $row["fkey_featuretype_id"];
+			echo "var len = wfs_conf.length;";
+			echo "wfs_conf[".$i."] = new Array();";
+			echo "wfs_conf[".$i."]['wfs_conf_id']  = '".$row["wfs_conf_id"]."';";
+			echo "wfs_conf[".$i."]['wfs_conf_abstract']  = '".$row["wfs_conf_abstract"]."';";
+			echo "wfs_conf[".$i."]['g_label']  = '".$row["g_label"]."';";
+			echo "wfs_conf[".$i."]['g_label_id']  = '".$row["g_label_id"]."';";
+//			echo "wfs_conf[".$i."]['g_style']  = '".$row["g_style"]."';";
+			echo "wfs_conf[".$i."]['g_button']  = '".$row["g_button"]."';";
+			echo "wfs_conf[".$i."]['g_button_id']  = '".$row["g_button_id"]."';";
+			echo "wfs_conf[".$i."]['g_buffer']  = '".$row["g_buffer"]."';";
+//			echo "wfs_conf[".$i."]['g_res_style']  = '".$row["g_res_style"]."';";
+			echo "wfs_conf[".$i."]['g_use_wzgraphics']  = '".$row["g_use_wzgraphics"]."';";
+			echo "wfs_conf[".$i."]['fkey_featuretype_id']  = '".$row["fkey_featuretype_id"]."';";
+			echo "wfs_conf[".$i."]['wfs_getfeature']  = '".$row["wfs_getfeature"]."';";
+			echo "wfs_conf[".$i."]['wfs_transaction']  = '".$row["wfs_transaction"]."';";
+			
+		}else{die("wfs_conf data not available");}
+		
+		$sql = "SELECT * FROM wfs_featuretype ";
+		$sql .= "WHERE fkey_wfs_id = ".$wfs_id." AND featuretype_id = ".$featuretype_id;
+		$res = db_query($sql);
+		if($row = db_fetch_array($res)){
+			echo "wfs_conf[".$i."]['featuretype_name']  = '".$row["featuretype_name"]."';";
+			echo "wfs_conf[".$i."]['featuretype_srs']  = '".$row["featuretype_srs"]."';";
+		}else{die("wfs_featuretype data not available");}
+		
+		/* wfs_conf_element */
+		$sql = "SELECT * FROM wfs_conf_element ";
+		$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+		$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = ".$wfs[$i]." ";
+		$sql .= " ORDER BY wfs_conf_element.f_respos";
+		#$sql .= "AND wfs_conf_element.f_search = 1 ORDER BY wfs_conf_element.f_search;";
+				
+		$res = db_query($sql);
+		
+		echo "wfs_conf[".$i."]['element']  = new Array();";
+		$cnt = 0;
+		
+		while($row = db_fetch_array($res)){
+			echo "wfs_conf[".$i."]['element'][".$cnt."] = new Array();";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_search'] = ".$row["f_search"].";";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_style_id'] = '".$row["f_style_id"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_toupper'] = '".$row["f_toupper"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label'] = '".$row["f_label"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label_id'] = '".$row["f_label_id"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_show'] = '".$row["f_show"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_respos'] = '".$row["f_respos"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_name'] = '".$row["element_name"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_type'] = '".$row["element_type"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_geom'] = '".$row["f_geom"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_gid'] = '".$row["f_gid"]."';";
+			$cnt++;
+		}
+		if($cnt == 0){die("wfs_conf data not available");}		
+	}
+	echo "iamready = true;";
+}
+
+?>
+if(iamready){
+	
+}
+
+</script>
+</head>
+<body leftmargin='0' topmargin='10'  bgcolor='#ffffff' onload='register()'>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfsLayerObj_conf.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfsLayerObj_conf.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfsLayerObj_conf.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,99 @@
+<?php
+require("../classes/class_wfs_conf.php");
+require("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>wfs_conf</title>
+<script language="JavaScript" type="text/javascript">
+  function selectWFS(){
+          if(document.forms[0].featuretype){
+                  if(document.forms[0].featuretype.length){
+                          for(var i=0; i<document.forms[0].featuretype.length;i++){
+                                  document.forms[0].featuretype[i].checked = false;
+                          }
+                  }
+                  else{
+                          document.forms[0].featuretype.checked = false;
+                  }
+          }
+          document.forms[0].submit();
+  }
+  function validate(){
+           for(var i=0; i<document.forms[0].length; i++){
+                  if(document.forms[0].elements[i].type == 'checkbox'){
+                           if(document.forms[0].elements[i].checked){
+                                  document.forms[0].elements[i].value = 1;
+                          }
+                          else{
+                                  document.forms[0].elements[i].value = 0;
+                          }
+                          document.forms[0].elements[i].checked = true;
+                  }
+          }
+          return true;
+  }
+</script>
+
+</head>
+<body>
+wfs_conf Configuration<br>
+<form method='POST' onsubmit='return validate()'>
+
+<?php
+if(isset($_REQUEST["save"])){
+        
+        $sql = "UPDATE gui_layer SET gui_layer_wfs_featuretype = '".$_REQUEST["wfs_conf"]."' ";
+        $sql .= "WHERE fkey_gui_id='".$_REQUEST["gui"]."' AND fkey_layer_id=".$_REQUEST["layer"];
+        $res = db_query($sql);
+        echo "layer is connected with wfs_conf: ".$_REQUEST["wfs_conf"];
+}
+else if(isset($_REQUEST["del"])){
+        
+        $sql = "UPDATE gui_layer SET gui_layer_wfs_featuretype = '' ";
+        $sql .= "WHERE fkey_gui_id='".$_REQUEST["gui"]."' AND fkey_layer_id=".$_REQUEST["layer"];
+        $res = db_query($sql);
+        echo "layer connection removed";
+}
+echo "<input type='hidden' name='gui' value='".$_REQUEST["gui"]."'>";
+echo "<input type='hidden' name='wms' value='".$_REQUEST["wms"]."'>";
+echo "<input type='hidden' name='layer' value='".$_REQUEST["layer"]."'>";
+
+/* select wfs */
+
+$sql = "SELECT * FROM wfs_conf";
+$res = db_query($sql);
+echo "<select size='20' name='wfs_conf' onchange='submit()'>";
+$cnt = 0;
+while($row = db_fetch_array($res)){
+        echo "<option value='".$row["wfs_conf_id"]."' ";
+        if(isset($_REQUEST["wfs_conf"]) && $row["wfs_conf_id"] == $_REQUEST["wfs_conf"]){
+                echo "selected";
+        }
+        echo ">".$row["wfs_conf_abstract"]."</option>";
+        $cnt++;
+}
+echo "</select>";
+
+echo "<br><input type='submit' name='save' value='save'><br>";
+echo "<input name='del' type='submit' value='delete'>";
+/* save wfs_conf properties */
+
+
+
+/* end save wfs_conf properties */
+
+
+
+
+
+
+/* end configure elements */
+?>
+</form>
+</body>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfs_conf.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs_conf.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfs_conf.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,231 @@
+<?php
+require("../classes/class_wfs_conf.php");
+require("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>wfs_conf</title>
+<script language="JavaScript" type="text/javascript">
+function selectWFS(){
+	if(document.forms[0].featuretype){
+		if(document.forms[0].featuretype.length){
+			for(var i=0; i<document.forms[0].featuretype.length;i++){
+				document.forms[0].featuretype[i].checked = false;
+			}
+		}
+		else{
+			document.forms[0].featuretype.checked = false;
+		}
+	}
+	document.forms[0].submit();
+}
+function validate(){
+	return true;
+}
+</script>
+
+</head>
+<body>
+wfs_conf Configuration<br>
+<form method='POST' onsubmit='return validate()'>
+<a href="mod_wfs_edit.php">edit</a><br>
+<?php
+$aWFS = new wfs_conf();
+$aWFS->getallwfs();
+
+/* save wfs_conf properties */
+
+if(isset($_REQUEST["save"])){
+        global $DBSERVER,$DB,$OWNER,$PW;
+        $con = db_connect($DBSERVER,$OWNER,$PW);
+        db_select_db($DB,$con);
+
+        $sql = "INSERT INTO wfs_conf (wfs_conf_abstract,fkey_wfs_id,fkey_featuretype_id,g_label,g_label_id,g_button,g_button_id,g_style,g_buffer,g_res_style,g_use_wzgraphics) VALUES(";
+        $sql .= "'".$_REQUEST["wfs_conf_abstract"]."',";
+        $sql .= "'".$_REQUEST["wfs"]."',";
+        $sql .= "'".$_REQUEST["featuretype"]."',";
+        $sql .= "'".$_REQUEST["g_label"]."',";
+        $sql .= "'".$_REQUEST["g_label_id"]."',";
+        $sql .= "'".$_REQUEST["g_button"]."',";
+        $sql .= "'".$_REQUEST["g_button_id"]."',";
+        $sql .= "'".$_REQUEST["g_style"]."',";
+        $sql .= "'".$_REQUEST["g_buffer"]."',";
+        $sql .= "'".$_REQUEST["g_res_style"]."',";        
+        if(!empty($_REQUEST["g_use_wzgraphics"])){
+			$sql .= "'1'";
+		}else{$sql .= "'0'";}
+        $sql .= "); ";
+
+        $res = db_query($sql);
+        $wfsID = db_insert_id($con,'wfs_conf','wfs_conf_id');
+        for($i=0; $i<$_REQUEST["num"]; $i++){
+                $sql = "INSERT INTO wfs_conf_element (fkey_wfs_conf_id,f_id,f_search,f_pos,f_style_id,f_toupper,f_label,f_label_id,f_show,f_respos) VALUES(";
+                $sql .= "'".$wfsID."',";
+                $sql .= "'".$_REQUEST["f_id".$i]."',";
+                if(!empty($_REQUEST["f_search".$i])){
+                	$sql .= "'1',";
+                }else{$sql .= "'0',";}
+                $sql .= "'".$_REQUEST["f_pos".$i]."',";
+                $sql .= "'".$_REQUEST["f_style_id".$i]."',";                
+				if(!empty($_REQUEST["f_toupper".$i])){
+                	$sql .= "'1',";
+                }else{$sql .= "'0',";}				
+                $sql .= "'".$_REQUEST["f_label".$i]."',";
+                $sql .= "'".$_REQUEST["f_label_id".$i]."',";
+                if(!empty($_REQUEST["f_show".$i])){
+                	$sql .= "'1',";
+                }else{$sql .= "'0',";}
+                $sql .= "'".$_REQUEST["f_respos".$i]."'";
+                $sql .= "); ";
+
+                $res = db_query($sql);
+     
+        }
+        $sql = "UPDATE wfs_conf_element SET ";
+        $sql .= "f_geom = 1";
+        $sql .= " WHERE fkey_wfs_conf_id = ".$wfsID." AND f_id = ".$_REQUEST["f_geom"].";";
+		$res = db_query($sql);
+		
+
+        $sql = "UPDATE wfs_conf_element SET ";
+        $sql .= "f_gid = 1";
+        $sql .= " WHERE fkey_wfs_conf_id = ".$wfsID." AND f_id = ".$_REQUEST["f_gid"].";";
+		$res = db_query($sql);
+		
+		echo "<script language='javascript'>";
+		echo "document.location.href = mod_wfs_edit.php?gaz=".$wfsID;
+		echo "</script>";
+}
+
+/* end save wfs_conf properties */
+
+/* select wfs */
+
+if(isset($_REQUEST["wfs"]) && $_REQUEST["wfs"] == ""){
+        unset($_REQUEST["wfs"]);
+        unset($_REQUEST["featuretype"]);
+}
+
+echo "<select name='wfs' onchange='selectWFS()'>";
+echo "<option value=''>...</option>";
+for($i=0; $i<count($aWFS->wfs_id);$i++){
+        echo "<option value='".$aWFS->wfs_id[$i]."' ";
+        if(isset($_REQUEST["wfs"]) && $aWFS->wfs_id[$i] == $_REQUEST["wfs"]){
+                echo "selected";
+        }
+        echo ">".$aWFS->wfs_title[$i]."</option>";
+}
+echo "</select>";
+echo "";
+
+/* end select wfs */
+
+
+/* select featuretype */
+
+if(isset($_REQUEST["wfs"])){
+
+        for($i=0; $i<count($aWFS->wfs_id);$i++){
+                if($aWFS->wfs_id[$i] == $_REQUEST["wfs"]){
+                        echo "<table>";
+                        echo "<tr><td>ID:</td><td>".$aWFS->wfs_id[$i]."</td></tr>";
+                        echo "<tr><td>Name:</td><td>".$aWFS->wfs_name[$i]."</td></tr>";
+                        echo "<tr><td>Title:</td><td>".$aWFS->wfs_title[$i]."</td></tr>";
+                        echo "<tr><td>Abstract:</td><td>".$aWFS->wfs_abstract[$i]."</td></tr>";
+                        echo "<tr><td>Capabilities:</td><td>".$aWFS->wfs_getcapabilities[$i]."</td></tr>";
+                        echo "<tr><td>FeaturTypes:</td><td>".$aWFS->wfs_describefeaturetype[$i]."</td></tr>";
+                        echo "<tr><td>Feature:</td><td>".$aWFS->wfs_getfeature[$i]."</td></tr>";
+                        echo "</table>";
+                }
+        }
+
+        $aWFS->getfeatures($_REQUEST["wfs"]);
+        echo "<table>";
+        for($i=0; $i<count($aWFS->features->featuretype_id); $i++){
+                echo "<tr>";
+                echo "<td><input type='radio' name='featuretype' value='".$aWFS->features->featuretype_id[$i]."' onclick='submit()' ";
+                if(isset($_REQUEST["featuretype"]) && $_REQUEST["featuretype"] == $aWFS->features->featuretype_id[$i]){
+                        echo "checked ";
+                }
+                echo "/></td>";
+                echo "<td>".$aWFS->features->featuretype_name[$i]."</td>";
+                echo "</tr>";
+        }
+        echo "</table>";
+}
+
+/* end select featuretype */
+
+/* configure elements */
+if(isset($_REQUEST["featuretype"])){
+
+
+        for($i=0; $i<count($aWFS->features->featuretype_id); $i++){
+                if($_REQUEST["featuretype"] == $aWFS->features->featuretype_id[$i]){
+                        echo "<hr>SRS: ".$aWFS->features->featuretype_srs[$i];
+                }
+        }
+
+        /* set featuretype options */
+        echo "<table>";
+        echo "<tr><td>Abstract:</td><td><input type='text' name='wfs_conf_abstract'></td></tr>" ;
+        echo "<tr><td>Label:</td><td><input type='text' name='g_label'></td></tr>" ;
+        echo "<tr><td>Label_id:</td><td><input type='text' name='g_label_id'></td></tr>" ;
+        echo "<tr><td>Button:</td><td><input type='text' name='g_button'></td></tr>" ;
+        echo "<tr><td>Button_id:</td><td><input type='text' name='g_button_id'></td></tr>" ;
+        echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'></textarea></td></tr>" ;
+        echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='1'></td></tr>" ;
+        echo "<tr><td>ResultStyle:</td><td><textarea cols=50 rows=5 name='g_res_style'></textarea></td></tr>" ;
+        echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'></td></tr>";
+        echo "</table>";
+
+
+        /* set element options */
+        $aWFS->getelements($_REQUEST["featuretype"]);
+        echo "<table border='1'>";
+        echo "<tr>";
+                echo "<td>ID</td>";
+                echo "<td>name</td>";
+                echo "<td>type</td>";
+                echo "<td>geom</td>";
+                echo "<td>gid</td>";
+                echo "<td>search</td>";
+                echo "<td>pos</td>";
+                echo "<td>style_id</td>";
+                echo "<td>upper</td>";
+                echo "<td>label</td>";
+                echo "<td>label_id</td>";
+                echo "<td>show</td>";
+                echo "<td>position</td>";
+        echo "</tr>";
+
+        for($i=0; $i<count($aWFS->elements->element_id); $i++){
+                echo "<tr>";
+                echo "<td>".$aWFS->elements->element_id[$i]."<input type='hidden' name='f_id".$i."' value='".$aWFS->elements->element_id[$i]."'></td>";
+                echo "<td>".$aWFS->elements->element_name[$i]."</td>";
+                echo "<td>".$aWFS->elements->element_type[$i]."</td>";
+                echo "<td><input name='f_geom' type='radio' value='".$aWFS->elements->element_id[$i]."'></td>";
+                echo "<td><input name='f_gid' type='radio' value='".$aWFS->elements->element_id[$i]."'></td>";
+                echo "<td><input name='f_search".$i."' type='checkbox'></td>";
+                echo "<td><input name='f_pos".$i."' type='text' size='2' value='0'></td>";
+                echo "<td><input name='f_style_id".$i."' type='text' size='2' value='0'></td>";
+                echo "<td><input name='f_toupper".$i."' type='checkbox'></td>";
+                echo "<td><input name='f_label".$i."' type='text' size='10'></td>";
+                echo "<td><input name='f_label_id".$i."' type='text' size='2'  value='0'></td>";
+                echo "<td><input name='f_show".$i."' type='checkbox'></td>";
+                echo "<td><input name='f_respos".$i."' type='text' size='4' value='0'></td>";
+                echo "</tr>";
+        }
+        echo "</table>";
+        echo "<input type='hidden' name='num' value='".$i."'>";
+        echo "<input type='submit' name='save' value='save'>";
+}
+
+
+/* end configure elements */
+?>
+</form>
+</body>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfs_edit.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs_edit.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfs_edit.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,201 @@
+<?php
+require("../../conf/mapbender.conf");
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>wfs_edit</title>
+<script language="JavaScript" type="text/javascript">
+function validate(){	
+	return true;
+}
+</script>
+
+</head>
+<body>
+wfs_conf Configuration<br>
+<form name='form1' method='POST' onsubmit='return validate()'>
+<a href="mod_wfs_conf.php">new</a><br>
+
+<?php
+/* save wfs_conf properties */
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+
+if(isset($_REQUEST["save"])){
+
+        $sql = "UPDATE wfs_conf SET ";
+        $sql .= "wfs_conf_abstract = '".$_REQUEST["wfs_conf_abstract"]."',";
+        $sql .= "g_label = '".$_REQUEST["g_label"]."',";
+        $sql .= "g_label_id = '".$_REQUEST["g_label_id"]."',";
+        $sql .= "g_button = '".$_REQUEST["g_button"]."',";
+        $sql .= "g_button_id = '".$_REQUEST["g_button_id"]."',";
+        $sql .= "g_style = '".$_REQUEST["g_style"]."',";
+        $sql .= "g_buffer = '".$_REQUEST["g_buffer"]."',";
+        $sql .= "g_res_style = '".$_REQUEST["g_res_style"]."',";
+        $sql .= "g_use_wzgraphics = ";
+        if(!empty($_REQUEST["g_use_wzgraphics"])){
+        	$sql .= '1';
+        }else{$sql .= '0';}
+        $sql .= " WHERE wfs_conf_id = ".$_REQUEST["gaz"].";";
+        
+        $res = db_query($sql);
+		        
+        $sql = "UPDATE wfs_conf_element SET ";
+        $sql .= "f_geom = 1";
+        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_geom"].";";
+		$res = db_query($sql);
+		
+		$sql = "UPDATE wfs_conf_element SET ";
+        $sql .= "f_geom = 0";
+        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id <>  ".$_REQUEST["f_geom"].";";
+		$res = db_query($sql);
+
+        $sql = "UPDATE wfs_conf_element SET ";
+        $sql .= "f_gid = 1";
+        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_gid"].";";
+		$res = db_query($sql);
+		
+		$sql = "UPDATE wfs_conf_element SET ";
+        $sql .= "f_gid = 0";
+        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id <> ".$_REQUEST["f_gid"].";";
+		$res = db_query($sql);
+		
+		
+		
+        for($i=0; $i<$_REQUEST["num"]; $i++){
+                $sql = "UPDATE wfs_conf_element SET ";
+                $sql .= "f_search = '";
+                if(!empty($_REQUEST["f_search".$i])){
+                	$sql .= '1';
+                }else{$sql .= '0';}
+                $sql .= "',";
+                $sql .= "f_pos = '".$_REQUEST["f_pos".$i]."',";
+                $sql .= "f_style_id = '".$_REQUEST["f_style_id".$i]."',";
+                $sql .= "f_toupper = '" ;
+                if(!empty($_REQUEST["f_toupper".$i])){
+                	$sql .= '1';
+                }else{$sql .= '0';}
+                $sql .= "',";
+                $sql .= "f_label = '".$_REQUEST["f_label".$i]."',";
+                $sql .= "f_label_id = '".$_REQUEST["f_label_id".$i]."',";
+                $sql .= "f_show = '";
+                if(!empty($_REQUEST["f_show".$i])){
+                	$sql .= '1';
+                }else{$sql .= '0';}
+				$sql .= "',";
+                $sql .= "f_respos = '".$_REQUEST["f_respos".$i]."'";
+                $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_id".$i].";";
+                $res = db_query($sql);
+        }
+}
+
+/* end save wfs_conf properties */
+
+/* select wfs */
+
+$sql = "SELECT * FROM wfs_conf";
+$res = db_query($sql);
+echo "<select size='10' name='gaz' onchange='submit()'>";
+$cnt = 0;
+while($row = db_fetch_array($res)){
+        echo "<option value='".$row["wfs_conf_id"]."' ";
+        if(isset($_REQUEST["gaz"]) && $row["wfs_conf_id"] == $_REQUEST["gaz"]){
+                echo "selected";
+        }
+        echo ">".$row["wfs_conf_abstract"]."</option>";
+        $cnt++;
+}
+echo "</select>";
+
+
+
+/* end select wfs */
+
+
+
+/* configure elements */
+if(isset($_REQUEST["gaz"])){
+        $sql = "SELECT * FROM wfs_conf WHERE wfs_conf_id = ".$_REQUEST["gaz"];
+        $res = db_query($sql);
+        if($row = db_fetch_array($res)){
+                echo "<table>";
+                echo "<tr><td>GazetterID:</td><td>".$row["wfs_conf_id"]."</td></tr>" ;
+                echo "<tr><td>Abstract:</td><td><input type='text' name='wfs_conf_abstract' value='".$row["wfs_conf_abstract"]."'></td></tr>" ;
+                echo "<tr><td>Label:</td><td><input type='text' name='g_label' value='".$row["g_label"]."'></td></tr>" ;
+                echo "<tr><td>Label_id:</td><td><input type='text' name='g_label_id' value='".$row["g_label_id"]."'></td></tr>" ;
+                echo "<tr><td>Button:</td><td><input type='text' name='g_button' value='".$row["g_button"]."'></td></tr>" ;
+                echo "<tr><td>Button_id:</td><td><input type='text' name='g_button_id' value='".$row["g_button_id"]."'></td></tr>" ;
+                echo "<tr><td>Style:</td><td><textarea cols=50 rows=5 name='g_style'>".$row["g_style"]."</textarea></td></tr>" ;
+                echo "<tr><td>Buffer:</td><td><input type='text' size='4' name='g_buffer' value='".$row["g_buffer"]."'></td></tr>" ;
+                echo "<tr><td>ResultStyle:</td><td><textarea cols=50 rows=5 name='g_res_style'>".$row["g_res_style"]."</textarea></td></tr>" ;
+                echo "<tr><td>WZ-Graphics:</td><td><input name='g_use_wzgraphics' type='checkbox'";
+                if($row["g_use_wzgraphics"] == 1){ echo " checked"; }
+                echo "></td></tr>";
+                echo "</table>";
+        }
+
+        /* set element options */
+        $sql = "SELECT * FROM wfs_conf_element ";
+        $sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+        $sql .= "WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"];
+
+        $res = db_query($sql);
+
+        echo "<table border='1'>";
+        echo "<tr>";
+                echo "<td>ID</td>";
+                echo "<td>name</td>";
+                echo "<td>type</td>";
+                echo "<td>geom</td>";
+                echo "<td>gid</td>";
+                echo "<td>search</td>";
+                echo "<td>pos</td>";
+                echo "<td>style_id</td>";
+                echo "<td>upper</td>";
+                echo "<td>label</td>";
+                echo "<td>label_id</td>";
+                echo "<td>show</td>";
+                echo "<td>position</td>";
+        echo "</tr>";
+        $cnt = 0;
+        while($row = db_fetch_array($res)){
+                echo "<tr>";
+                echo "<td><input type='text' size='4' name='f_id".$cnt."' value='".$row["f_id"]."' readonly></td>";
+                echo "<td>".$row["element_name"]."</td>";
+                echo "<td>".$row["element_type"]."</td>";
+                echo "<td><input name='f_geom' type='radio' value='".$row["f_id"]."' ";
+                	if($row["f_geom"] == 1){ echo " checked"; }
+				echo "></td>";
+				echo "<td><input name='f_gid' type='radio' value='".$row["f_id"]."' ";
+                	if($row["f_gid"] == 1){ echo " checked"; }
+				echo "></td>";
+                echo "<td><input name='f_search".$cnt."' type='checkbox'";
+                if($row["f_search"] == 1){ echo " checked"; }
+                echo "></td>";
+                echo "<td><input name='f_pos".$cnt."' type='text' size='2' value='".$row["f_pos"]."'></td>";
+                echo "<td><input name='f_style_id".$cnt."' type='text' size='2' value='".$row["f_style_id"]."'></td>";
+                echo "<td><input name='f_toupper".$cnt."' type='checkbox'";
+                if($row["f_toupper"] == 1){ echo " checked"; }
+                echo "></td>";
+                echo "<td><input name='f_label".$cnt."' type='text' size='10' value='".$row["f_label"]."'></td>";
+                echo "<td><input name='f_label_id".$cnt."' type='text' size='2' value='".$row["f_label_id"]."'></td>";
+                echo "<td><input name='f_show".$cnt."' type='checkbox'";
+                if($row["f_show"] == 1){ echo " checked"; }
+                echo "></td>";
+                echo "<td><input name='f_respos".$cnt."' type='text' size='4' value='".$row["f_respos"]."'></td>";
+                echo "</tr>";
+                $cnt++;
+        }
+        echo "</table>";
+        echo "<input type='hidden' name='num' value='".$cnt."'>";
+        echo "<input type='submit' name='save' value='save'>";
+}
+
+
+/* end configure elements */
+?>
+</form>
+</body>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfs_gazetteer.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs_gazetteer.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfs_gazetteer.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,411 @@
+<?php
+# $Id: mod_wfs_gazetteer.php,v 1.11 2006/02/03 15:35:13 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_wfs_gazetteer.php,v 1.11 2006/02/03 15:35:13 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+session_start();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<title>mod_wfs_gazetteer</title>
+<?php
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+
+$gui_id = $_SESSION["mb_user_gui"];
+include '../include/dyn_css.php';
+/* wfs_conf */
+$sql = "SELECT * FROM wfs_conf ";
+$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+$sql .= "WHERE wfs_conf.wfs_conf_id = ".$_REQUEST["wfs_conf"];
+
+$res = db_query($sql);
+if($row = db_fetch_array($res)){
+	$g_label  = $row["g_label"];
+	$g_label_id  = $row["g_label_id"];
+	$g_style  = $row["g_style"];
+	$g_button = $row["g_button"];
+	$g_button_id = $row["g_button_id"];
+	$g_buffer  = $row["g_buffer"];
+	$g_res_style  = $row["g_res_style"];
+	$g_use_wzgraphics = $row["g_use_wzgraphics"];
+	$wfs_id  = $row["fkey_wfs_id"];
+	$featuretype_id  = $row["fkey_featuretype_id"];
+	$wfs_getfeature = $row["wfs_getfeature"];
+}else{die("wfs_conf data not available");}
+
+$sql = "SELECT * FROM wfs_featuretype ";
+$sql .= "WHERE fkey_wfs_id = ".$wfs_id." AND featuretype_id = ".$featuretype_id;
+$res = db_query($sql);
+if($row = db_fetch_array($res)){
+	$featuretype_name  = $row["featuretype_name"];
+	$featuretype_srs  = $row["featuretype_srs"];
+}else{die("wfs_conf data not available");}
+
+echo "<style type='text/css''>";
+echo $g_style;
+echo "</style>";
+
+/* wfs_conf_element */
+$sql = "SELECT * FROM wfs_conf_element ";
+$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = ".$_REQUEST["wfs_conf"]." ";
+$sql .= "AND wfs_conf_element.f_search = 1 ORDER BY wfs_conf_element.f_search;";
+
+$res = db_query($sql);
+
+echo '<script type="text/javascript">';
+echo "var el = new Array();";
+$cnt = 0;
+while($row = db_fetch_array($res)){
+	echo "el[".$cnt."] = new Array();";
+	echo "el[".$cnt."]['f_search'] = ".$row["f_search"].";";
+	echo "el[".$cnt."]['f_style_id'] = '".$row["f_style_id"]."';";
+	echo "el[".$cnt."]['f_toupper'] = '".$row["f_toupper"]."';";
+	echo "el[".$cnt."]['f_label'] = '".$row["f_label"]."';";
+	echo "el[".$cnt."]['f_label_id'] = '".$row["f_label_id"]."';";
+	echo "el[".$cnt."]['element_name'] = '".$row["element_name"]."';";
+	echo "el[".$cnt."]['element_type'] = '".$row["element_type"]."';";
+	$cnt++;
+}
+if($cnt == 0){die("wfs_conf data not available");}
+
+echo "var g_label = '".$g_label."';";
+echo "var g_label_id = '".$g_label_id."';";
+echo "var g_button = '".$g_button."';";
+echo "var g_button_id = '".$g_button_id."';";
+echo "var g_buffer = ".$g_buffer.";";
+echo "var g_res_style = '".urlencode($g_res_style)."';";
+echo "var g_use_wzgraphics = ".$g_use_wzgraphics.";";
+echo "var featuretype_name= '".$featuretype_name."';";
+echo "var featuretype_srs = '".$featuretype_srs."';";
+echo "var wfs_getfeature = '".$wfs_getfeature."';";
+
+echo "var wfs_conf_id = '".$_REQUEST["wfs_conf"]."';";
+echo "var targets = '".$_REQUEST["target"]."';";
+echo "var resultFrame = '".$_REQUEST["resultFrame"]."';";
+echo "</script>";
+?>
+
+<script type="text/javascript">
+//var res = true;
+var wfs_conf_color = "255,0,0";
+var cnt = 0;
+function checkTag(){
+	var target = targets.split(",");
+	canvas = new Array();
+	canvasHasDrawing = new Array();
+	for(var i=0; i<target.length; i++){
+		var isTag = (parent.frames[target[i]].document.getElementById('mod_gaz_draw'))?1:0;
+		if(isTag == 0){
+			var draw = parent.frames[target[i]].document.createElement("div");
+			var tmp = parent.frames[target[i]].document.getElementsByTagName("body")[0].appendChild(draw);
+			tmp.setAttribute("id","mod_gaz_draw");
+			tmp.setAttribute("style","position:absolute;top:0px;left:0px;width:0px;height:0px");
+		}
+		canvas[target[i]] = new parent.jsGraphics('mod_gaz_draw', parent.window.frames[target[i]]);
+		canvas[target[i]].setStroke(3);
+		canvasHasDrawing[target[i]] = false;
+	}
+	return true;
+}
+function check(){
+	var cnt = 0;
+	for(var i=0; i<el.length; i++){
+		if(el[i]['f_search'] == 1){
+			if(document.getElementById(el[i]['element_name']).value != ''){
+				cnt++;
+			}
+		}
+	}
+	return cnt;
+}
+
+
+function validate(){
+	var cnt = check();
+	
+	if(cnt == 0){
+		return false;
+	}
+	else{
+		document.sendForm.wfs_conf_id.value = wfs_conf_id;
+		document.sendForm.frame.value = this.name;
+		/* url */
+		var u = wfs_getfeature;
+		if(wfs_getfeature.indexOf("?") > -1){u += "&";}
+		if(wfs_getfeature.indexOf("?") == -1){u += "?";}
+		u += "REQUEST=getFeature&Typename="+featuretype_name+"&Version=1.0.0&service=WFS";
+		u += "&filter=";
+		document.sendForm.url.value = u;
+		/* filter */
+		var f = '<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml">';
+		if(cnt > 1){
+			f += "<And>";
+		}
+		for(var i=0; i<el.length; i++){
+			if(el[i]['f_search'] == 1 && document.getElementById(el[i]['element_name']).value != ''){
+		
+				var a = new Array();
+				a = document.getElementById(el[i]['element_name']).value.split(",");
+				if(a.length > 1){
+					f += "<Or>";
+				}
+				for(var j=0; j<a.length; j++){
+					
+					f += "<ogc:PropertyIsLike wildCard='*' singleChar='.' escape='!'>";
+//equal				f += "<ogc:PropertyIsEqualTo>";
+					f += '<ogc:PropertyName>';
+					f += el[i]['element_name'];
+					f += '</ogc:PropertyName>';
+					f += '<ogc:Literal>';
+					
+					if(el[i]['f_toupper'] == 1){
+						f += a[j].toUpperCase();
+					}
+					else{
+						f += a[j];
+					}
+					f += "*";
+					
+					f += '</ogc:Literal>';
+					f += '</ogc:PropertyIsLike>';
+//equal				f += '</ogc:PropertyIsEqualTo>';
+				}
+				if(a.length > 1){
+					f += "</Or>";
+				}
+			}
+		}
+		if(cnt > 1){
+			f += "</And>";
+		}
+		f += '</ogc:Filter>';
+		document.sendForm.filter.value = f;
+		document.sendForm.backlink.value = 'parent';
+		document.sendForm.submit();
+//		prompt("",b);
+		return false;
+	}
+}
+function init_mod_wfs_gazetteer(){
+	var s = "";
+	s += "<form onsubmit='return validate()'>";
+	s += "<div class='"+g_label_id+"'>"+g_label+"</div>";
+	for(var i=0; i<el.length; i++){
+		s += "<span class='"+el[i]["f_label_id"]+"'>"+el[i]["f_label"]+"</span>";
+		s += "<input type='text' class='"+el[i]["f_style_id"]+"' id='"+el[i]["element_name"]+"'><br>";
+	}
+	s += "<input type='submit' class='"+g_button_id+"' value='"+g_button+"' >";
+	s += "</form>";
+	document.getElementById("gaz").innerHTML = s;
+          
+	return true;
+}
+
+/*
+* event -> {over || out || click}
+* geom -> commaseparated coordinates x1,y1,x2,y2 ...
+*/
+function setResult(geomtype,event,geom){
+//  alert(geomtype + " - " + event + " - " + geom);
+	var geomtype = geomtype.toLowerCase();
+	var target = targets.split(",");
+	var x = new Array();
+	var y = new Array();
+	var mygeom = new Array();
+	mygeom = geom.split(":");
+	if(event != 'out'){
+		var minx;
+		var miny;
+		var maxx;
+		var maxy;
+		for(var i=0; i<mygeom.length; i++){
+			x[i] = new Array();
+			y[i] = new Array();
+			var tmp = new Array();
+			tmp = mygeom[i].split(",");
+
+			var k = 0;
+			for(var j=0; j<(tmp.length-1); j=j+2){
+				x[i][k] = tmp[j];
+				y[i][k] = tmp[j+1];
+				//bounded by:
+				if(i==0 && j==0){
+					minx = tmp[j];
+					miny = tmp[j+1];
+					maxx = tmp[j];
+					maxy = tmp[j+1];
+				}
+				else{
+					if(tmp[j]<minx){ minx = tmp[j];}
+					if(tmp[j+1]<miny){ miny = tmp[j+1]; }
+					if(tmp[j]>maxx){ maxx = tmp[j]; }
+					if(tmp[j+1]>maxy){ maxy = tmp[j+1]; }
+				}
+				k++;
+			}
+		}
+	}
+
+	//events
+	if(event == "over"){
+		if(g_use_wzgraphics == 1){
+			for(var i=0; i<target.length;i++){
+				for(var j=0; j<x.length; j++){
+					var ev = setFocus(target[i],geomtype,x[j],y[j]);
+				}
+			}
+		}
+		else{
+			if(geomtype == 'point'){
+				parent.mb_showHighlight(target[0],x[0][0],y[0][0]);
+				parent.mb_showHighlight(target[1],x[0][0],y[0][0]);
+			}
+			else{
+				parent.mb_showHighlight(target[1],x[0][0],y[0][0]);
+				parent.mb_markResult(target[0],mygeom,wfs_conf_color);
+			}
+		}
+	}
+	else if (event == "out"){
+		if(g_use_wzgraphics == 1){
+			for(var i=0; i<target.length;i++){
+				clearFocus(target[i]);
+			}
+		}
+		else{
+			hideResult();
+		}
+	}
+	else if (event == "click"){
+		minx -=g_buffer;
+		miny -= g_buffer;
+		maxx = parseFloat(maxx) +  parseFloat(g_buffer);
+		maxy = parseFloat(maxy) + parseFloat(g_buffer);
+		parent.mb_calculateExtent(target[0],minx,miny,maxx,maxy);
+		parent.zoom(target[0], 'true', 1.0);
+		if(g_use_wzgraphics == 1){
+			for(var i=0; i<target.length;i++){
+				clearFocus(target[i]);
+			}
+		}
+		else{
+			hideResult();
+		}
+	}
+	return true;
+}
+function hideResult(geom_type){
+	var target = targets.split(",");
+	if(geom_type == 'point'){
+		parent.mb_hideHighlight(target[0]);
+		parent.mb_hideHighlight(target[1]);
+	}
+	else{
+		parent.mb_hideHighlight(target[1]);
+	parent.mb_disableResult(target[0]);
+	}
+}
+function Numsort(a,b)
+{ return a-b; }
+
+/* Opacity for hilighting */
+    parent.cw_opacity = 1.5;
+/* Color for polygon boundary */
+    var cw_bndcolor = "#cc33cc";
+/* Color for polygon fill */
+    var cw_fillcolor = "#cc33cc";
+
+    var point_px = 10;
+
+
+function setFocus(frame,geomtype,coordsx,coordsy) {
+	var pxx = new Array();
+	var pxy = new Array();
+	var c = checkTag();
+	for(var i=0; i<coordsx.length; i++){
+		var pos = parent.makeRealWorld2mapPos(frame,coordsx[i],coordsy[i]);
+		pxx[i] = pos[0];
+		pxy[i] = pos[1];
+		//check min/max
+		if(i == 0){
+			var minx = pos[0];
+			var miny = pos[1];
+                        var maxx = pos[0];
+                        var maxy = pos[1];
+                }
+                else{
+                        if(pos[0]<minx){ minx = pos[0]; }
+                        if(pos[0]>maxx){ maxx = pos[0]; }
+                        if(pos[1]<miny){ miny = pos[1]; }
+                        if(pos[1]>maxy){ maxy = pos[1]; }
+                }
+        }
+        if((maxx-minx)<8 && (maxy-miny)<8){
+                geomtype = 'point';
+                pxx.length = 0;
+                pxx[0] = minx;
+                pxy.length = 0;
+                pxy[0] = miny;
+        }
+        if (geomtype == 'linestring') {
+                canvas[frame].setColor(cw_bndcolor);
+                canvas[frame].drawPolyline(pxx,pxy);
+                canvas[frame].paint();
+        }
+        if (geomtype == 'polygon') {
+//                canvas[frame].setColor(cw_fillcolor);
+//                canvas[frame].fillPolygon(pxx,pxy);
+//                canvas[frame].paint();
+                canvas[frame].setColor(cw_bndcolor);
+                canvas[frame].drawPolygon(pxx,pxy);
+                canvas[frame].paint();
+        }
+        if (geomtype == 'point') {
+//                canvas.setColor(cw_fillcolor);
+//                canvas.fillEllipse((parseInt(x)-point_px/2),(parseInt(y)-point_px/2),point_px,point_px);
+//                canvas.paint();
+                canvas[frame].setColor(cw_bndcolor);
+                canvas[frame].drawEllipse((pxx[0]-point_px/2),(pxy[0]-point_px/2),point_px,point_px);
+                canvas[frame].paint();
+        }
+        canvasHasDrawing[frame] = true;
+        return true;
+}
+function clearFocus(frame) {
+        parent.frames[frame].document.getElementById('mod_gaz_draw').innerHTML = "";
+        canvasHasDrawing[frame] = false;
+        return true;
+}
+
+</script>
+</head>
+<body leftmargin='0' topmargin='10'  bgcolor='#ffffff' onload='init_mod_wfs_gazetteer()'>
+<div id='gaz'></div>
+<iframe name='res' id='res' src='' frameborder='0' style='width:180px;height:200px'></iframe>
+<form name='sendForm' action='mod_wfsrequest.php' target='res' method='POST'>
+<input type='hidden' name='wfs_conf_id'>
+<input type='hidden' name='frame'>
+<input type='hidden' name='url'>
+<input type='hidden' name='backlink'>
+<input type='hidden' name='filter'>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfs_result.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs_result.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfs_result.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,121 @@
+<?php
+# $Id: mod_wfs_result.php,v 1.8 2006/03/09 12:17:27 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_wfs_result.php,v 1.8 2006/03/09 12:17:27 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+$req = urldecode($_REQUEST["url"]).urlencode(stripslashes($_REQUEST["filter"]));
+require_once("../../conf/mapbender.conf");
+
+function sepNameSpace($s){
+	$c = strpos($s,":"); 
+	if($c>0){
+		return substr($s,$c+1);
+	}
+	else{
+		return $s;
+	}		
+}
+
+$gml = 'off';
+if($gml == 'on'){
+	header("Location: ".$req);
+}
+else{   
+	$geometries = array('Point', 'Polygon', 'LineString', 'MultiPolygon', 'MultiLineString');
+	$data = implode("",file($req)) or die("wfs not available");
+	$parser = xml_parser_create();
+	xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
+	xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
+	xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
+	xml_parse_into_struct($parser,$data,$values,$tags);
+	xml_parser_free($parser);
+	$member = -1;
+	
+	
+	$section = false;
+	$geom = false;
+	$str = array();
+	$geomtype = array();
+	$el = -1;
+	echo "<html><head>\n";
+	echo "<meta http-equiv='Content-Type' content='text/html; charset=".CHARSET."'>\n";
+	echo "<script language='JavaScript' type='text/javascript'>\n<!--\n";
+	echo "var member = new Array();\n";
+	foreach ($values as $element) {
+		if(strtoupper($element[tag]) == strtoupper("gml:featureMember") && $element[type] == "open"){
+			$member++;
+			echo "member[".$member."] = new Array();\n";
+			echo "member[".$member."]['geometry'] = new Array();\n";
+			echo "member[".$member."]['element'] = new Array();\n";
+			$section = true;
+			$cnt_geom = 0;
+		}
+		else if(in_array(sepNameSpace($element[tag]),$geometries) && $element[type] == "open" && $section == true){
+			$geom = true;
+			// edited by CB: only Line, Polygon and Point are allowed as geomtype
+			if (sepNameSpace($element[tag]) == "LineString" || sepNameSpace($element[tag]) == "MultiLineString" ) {
+				echo "member[".$member."]['geomtype'] = 'Line';\n";
+			}
+			else if (sepNameSpace($element[tag]) == "Point" || sepNameSpace($element[tag]) == "MultiPoint" ) {
+				echo "member[".$member."]['geomtype'] = 'Point';\n";
+			}
+			else if (sepNameSpace($element[tag]) == "MultiPolygon") {
+				echo "member[".$member."]['geomtype'] = 'Polygon';\n";
+			}
+			else {
+				echo "member[".$member."]['geomtype'] = '".sepNameSpace($element[tag])."';\n";
+			}
+		}
+		else if(strtoupper($element[tag]) == strtoupper("gml:coordinates") && $geom == true){
+			$tmp =  str_replace(",,","",str_replace(" ",",",trim($element[value])));
+			echo "var tmp = '".$tmp."';";
+			echo "member[".$member."]['geometry'][".$cnt_geom."] = tmp.split(',');\n";
+            $cnt_geom++;
+            
+		}
+		else if(in_array(sepNameSpace($element[tag]),$geometries) && $element[type] == "close"){			
+			$geom = false;
+		}
+		else if($section == true && $geom == false && $element[value]){
+			$el++;
+			echo "member[".$member."]['element'][".$el."] = new Array();\n";
+			echo "member[".$member."]['element'][".$el."]['name'] = '".sepNameSpace($element[tag])."';\n";
+			$str = $element[value];
+			echo "member[".$member."]['element'][".$el."]['val'] = '".$str."';\n";
+		}
+		else if(strtoupper($element[tag]) == strtoupper("gml:featureMember") && $element[type] == "close"){
+			$section = false;	
+			$el = -1;			
+		}
+   	}
+}   	
+?> 
+function mb_wfs_reg(){
+	if(member.length > 0){
+		parent.mb_wfs_register('<?php echo $_REQUEST['id'] ?>',member);
+	}
+	else{ 
+		parent.mb_wfs_register('<?php echo $_REQUEST['id'] ?>',false);
+	}
+}
+//-->
+</script>
+</head>
+<body onLoad='mb_wfs_reg()'>
+</body>
+</html>
+

Added: trunk/mapbender/http/php/mod_wfs_save.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfs_save.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfs_save.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,135 @@
+<html>
+<head>
+<?php
+require_once("../../conf/mapbender.conf");
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>WFS Save</title>
+<script language='JavaScript' type='text/javascript'>
+var my = window.opener.parent.frames.wfs_conf.wfs_conf;
+var dig = window.opener.parent.frames.digitize;
+var w;
+function sepNameSpace(n){
+	var c = n.indexOf(":"); 
+	if(c>0){
+		var temp = n.split(":");
+		return temp[1];
+	}
+	else{
+		return n;
+	}
+}
+function init(){	
+	for(var i=0; i<my.length; i++){
+		N = new Option(my[i]['wfs_conf_abstract'],i,false,false);		
+		document.forms[0].thema.options[document.forms[0].thema.length] = N;
+	}	
+}
+function validate(obj){
+	var ind = obj.selectedIndex;
+	if(ind == 0){return;}
+	w = obj[ind].value;
+	
+	var str = "<table>";
+	for(var i=0; i< my[w]['element'].length; i++){
+		if(my[w]['element'][i]['f_geom'] != '1'){
+			str += "<tr>";
+			str += "<td>" + my[w]['element'][i]['element_name'] + "</td>";
+			str += "<td><input name='"+my[w]['element'][i]['element_name']+"' type='text'></td>";
+			str += "<tr>";
+		}
+	}
+	str += "</table>";
+	str += "<input type='submit' value='save'>"
+	document.getElementById("a").innerHTML = str;
+}
+function set(){
+	document.forms[1].url.value = my[w]['wfs_transaction'];
+	var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someserver.com/myns http://wms1.ccgis.de/geoserver-1.3-beta4/wfs/getCapabilities?request=describefeaturetype&amp;typename=mapbender_user http://www.opengis.net/wfs../wfs/1.0.0/WFS-transaction.xsd">';
+	str += '<wfs:Insert>';
+	str += '<'+ sepNameSpace(my[w]['featuretype_name'])+'>';
+	for(var i=0; i<document.forms[0].elements.length; i++){
+		if(document.forms[0].elements[i].type == 'text' && document.forms[0].elements[i].value != ''){
+			var tmp = sepNameSpace(document.forms[0].elements[i].name);
+			str += '<' + tmp  + '>';
+			str += document.forms[0].elements[i].value;
+			str += '</' + tmp  + '>';
+		}
+	}
+		
+	for(var j=0; j<my[w]['element'].length; j++){
+		if(my[w]['element'][j]['f_geom'] == 1){
+			var el_geom = my[w]['element'][j]['element_name'];	
+		}
+	}
+	str += '<' + el_geom + '>';	
+	
+	if(dig.D[0].type == 'text'){
+		str += '<gml:Point srsName="epsg:4326">';
+		str += '<gml:coordinates>';
+		str += dig.D[0].x[0] + "," + dig.D[0].y[0]; 
+		str += '</gml:coordinates>';
+		str += '</gml:Point>';		
+	}
+	if(dig.D[0].type == 'line'){
+		str += '<gml:MultiLineString srsName="epsg:4326">';
+		str += '<gml:lineStringMember>';
+		str += '<gml:LineString>';		
+            
+		str += '<gml:coordinates>';
+		for(var k=0; k<dig.D[0].x.length; k++){
+			if(k>0){
+				str += " ";	
+			}
+			str += dig.D[0].x[k] + "," + dig.D[0].y[k];
+		} 
+		str += '</gml:coordinates>';
+		str += '</gml:LineString>';
+		str += '</gml:lineStringMember>';
+		str += '</gml:MultiLineString>';
+	}
+	if(dig.D[0].type == 'polygon'){
+		str += '<gml:MultiPolygon srsName="epsg:4326">';
+		str += '<gml:polygonMember>';
+		str += '<gml:Polygon>';
+		str += '<gml:outerBoundaryIs>';
+		str += '<gml:LinearRing>';
+            
+		str += '<gml:coordinates>';
+		for(var k=0; k<dig.D[0].x.length; k++){
+			if(k>0){
+				str += " ";	
+			}
+			str += dig.D[0].x[k] + "," + dig.D[0].y[k];
+		} 
+		str += '</gml:coordinates>';
+		str += '</gml:LinearRing>';
+		str += '</gml:outerBoundaryIs>';
+		str += '</gml:Polygon>';
+		str += '</gml:polygonMember>';
+		str += '</gml:MultiPolygon>';
+	}
+	str += '</' + el_geom + '>';
+	str += '</'+ sepNameSpace(my[w]['featuretype_name'])+'>';
+	str += '</wfs:Insert>';
+	str += '</wfs:Transaction>';
+	document.forms[1].filter.value = str;
+	document.forms[1].submit();
+	return false;	
+}
+</script>
+</head>
+<body onload='init()'>
+<form onsubmit='return set()'>
+<select name='thema' onchange='validate(this)'>
+<option value=''>WFS...</option>
+</select><br>
+<div id='a' name='a'></div>
+</form>
+
+<form action='../extensions/geom2wfst.php' method='POST'>
+<input type='text' name='url'>
+<input type='text' name='filter'>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_wfsrequest.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_wfsrequest.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_wfsrequest.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,91 @@
+<?php
+# $Id: mod_wfsrequest.php,v 1.4 2006/01/29 11:31:42 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/mod_wfsrequest.php,v 1.4 2006/01/29 11:31:42 uli_rothstein Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db($DB,$con);
+if(isset($_REQUEST["backlink"]) && $_REQUEST["backlink"] == 'parent'){
+	$p = 'parent';
+}else{
+	$p = "parent.frames[\"".$_REQUEST["frame"]."\"]";
+}
+
+/* wfs_conf */
+$sql = "SELECT * FROM wfs_conf ";
+$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+$sql .= "WHERE wfs_conf.wfs_conf_id = ".$_REQUEST['wfs_conf_id'];
+
+$res = db_query($sql);
+if($row = db_fetch_array($res)){
+        $g_res_style  = $row["g_res_style"];
+        
+}else{die("wfs_conf data not available");}
+
+/* wfs_conf_element */
+$sql = "SELECT * FROM wfs_conf_element ";
+$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = ".$_REQUEST['wfs_conf_id']." ";
+$sql .= "AND wfs_conf_element.f_show = 1 ORDER BY wfs_conf_element.f_respos;";
+
+$res = db_query($sql);
+$col = array();
+$cnt = 0;
+while($row = db_fetch_array($res)){
+	$col[$cnt] = $row["element_name"];
+	$cnt++;
+}
+if($cnt == 0){die("wfs_conf_element data not available");}
+
+$req = urldecode($_REQUEST["url"]).urlencode(stripslashes($_REQUEST["filter"]));
+#echo $req; die;
+
+$gml = 'off';
+if($gml == 'on'){
+	header("Location: ".$req);
+}
+else{
+	echo "<html><head><style type='text/css'>".$g_res_style."</style></head><body>";
+	include("../classes/class_gml2.php");
+        $mygml = new gml2();
+        $mygml->parsegml($req);
+        $c = $mygml->getMemberCount();
+        for($i=0; $i<$c; $i++){
+                echo "<div style='cursor:pointer;' ";
+                if(fmod($i,2) == 0){
+                        echo "class='even'";
+                }
+                else{
+                        echo "class='uneven'";
+                }
+                $mygeom = implode(":",$mygml->getGeometriesFromMember($i));
+                $geomtype = $mygml->getGeometryTypeFromMember($i);
+                echo " onmouseover='".$p.".setResult(\"".$geomtype."\",\"over\",\"".$mygeom."\")' ";
+                echo " onmouseout='".$p.".setResult(\"".$geomtype."\",\"out\",\"false\")' ";
+                echo " onclick='".$p.".setResult(\"".$geomtype."\",\"click\",\"".$mygeom."\")'>";
+                for($j=0; $j<count($col); $j++){
+                        echo $mygml->getValueBySeparatedKey($i,$col[$j]) . " ";
+                }
+                echo "</div>";
+
+        }
+if($i == 0){ echo "Kein Ergebnis...";}
+        echo "</body></html>";
+}
+
+
+?>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_zoomCoords.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_zoomCoords.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_zoomCoords.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,165 @@
+<?php
+/* version 2.0.0*/
+session_start();
+
+import_request_variables("PG");
+
+
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!-- version 2.0.0 -->
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Zoom to Coordinate</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+	    <!--
+
+	    body{
+	    	font-family : Arial, Helvetica, sans-serif;
+	    	font-size: 11px;
+	    }
+	    .labelx{
+	    	position: absolute;
+	    	left: 5px;
+	    	top:5px;
+	    	color: Gray;
+	    }
+	    .labely{
+	    	position: absolute;
+	    	left: 90px;
+	    	top:5px;
+	    	color: Gray;
+	    }
+	    .textx{
+	    	position: absolute;
+	    	left:5px;
+	    	top:20px;
+	    	color: Gray;
+	    	width:70px;
+         border: solid thin;
+         height:20px;
+	    }
+	    .texty{
+	    	position: absolute;
+	    	left:90px;
+	    	top:20px;
+         color: Gray;
+	    	width:70px;
+         border: solid thin;
+         height:20px;
+	    }
+       .send{
+  	    	position: absolute;
+	    	left:177px;
+	    	top:20px;
+         color: Gray;
+         border: solid thin;
+         height:20px;
+         width:30px;
+       }
+	    -->
+</style>
+<?php
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'zoomCoords' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+   $e_target = $row["e_target"];
+   $cnt++;
+}
+
+echo '<script type="text/javascript">';
+if($cnt > 1){ echo "alert('zoomCoords: ID not unique!');";}
+
+echo "var mod_zoomCoords_target = '".$e_target."';";
+echo "var target = mod_zoomCoords_target.split(',')";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function zoomCoordinate(){
+   var coordx = document.form1.X.value; 
+   var coordy = document.form1.Y.value;
+   coordx = coordx.replace(",",".");
+   coordy = coordy.replace(",",".");
+   var valid = true;
+    
+ /*  if(parseFloat(coordx) < 5.88 ||  parseFloat(coordx) > 15){
+      alert("Eingabe unzulässig!");
+      document.form1.X.select();
+      document.form1.X.focus();
+      valid = false; 
+      return false;
+   }
+   if(parseFloat(coordy) < 46.62 ||  parseFloat(coordy) > 55.71){
+      alert("Eingabe unzulässig!");
+      document.form1.Y.select();
+      document.form1.Y.focus();
+      valid = false;
+      return false;
+   }   */
+   setPermanentMarker(coordx,coordy);
+   parent.mb_hideHighlight(target[0]);
+   parent.mb_hideHighlight(target[1]);
+   parent.zoom(target[0],true, 1.0,coordx,coordy);
+}
+
+function highlight(x, y){
+  
+   x=x.replace(",",".");
+   y=y.replace(",",".");
+   
+   document.form1.X.value=x;
+   document.form1.Y.value=y;
+   
+   if (isNaN(x)==true || isNaN(y)==true){
+     
+   }
+   else{
+      parent.mb_showHighlight(target[0],x,y);
+      parent.mb_showHighlight(target[1],x,y);
+   }
+}
+
+function hideHighlight(){
+   parent.mb_hideHighlight(target[0]);
+   parent.mb_hideHighlight(target[1]);
+}
+
+function setPermanentMarker(x,y){
+   parent.mod_permanentHighlight_x = parseFloat(x);
+   parent.mod_permanentHighlight_y = parseFloat(y);
+}
+// -->
+</script>
+</head>
+<body bgcolor='#ffffff' onload=''>
+
+<?php
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+#coordinates
+   
+   #deutsche Version
+      echo "<span class='labelx'>Länge:</span>";
+      echo "<span class='labely'>Breite:</span>";
+      echo "<input class='textx' type='text' name='X'>";
+      echo "<input class='texty' type='text' name='Y'>";
+      echo "<input class='send' type='button' value='ok' onclick='zoomCoordinate();' onmouseover='highlight(document.form1.X.value, document.form1.Y.value)' onmouseout='hideHighlight(document.form1.X.value, document.form1.Y.value)' >";
+
+?>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/mod_zoomCoords_en.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_zoomCoords_en.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/mod_zoomCoords_en.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,177 @@
+<?php
+# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+require_once("../../conf/mapbender.conf");
+import_request_variables("PG");
+
+require_once("../php/mb_validateSession.php");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Zoom to Coordinate</title>
+<style type="text/css">
+	    <!--
+
+	    body{
+	    	font-family : Arial, Helvetica, sans-serif;
+	    	font-size: 11px;
+	    }
+	    .labelx{
+	    	position: absolute;
+	    	left: 5px;
+	    	top:5px;
+	    	color: Gray;
+	    }
+	    .labely{
+	    	position: absolute;
+	    	left: 90px;
+	    	top:5px;
+	    	color: Gray;
+	    }
+	    .textx{
+	    	position: absolute;
+	    	left:5px;
+	    	top:20px;
+	    	color: Gray;
+	    	width:70px;
+         border: solid thin;
+         height:20px;
+	    }
+	    .texty{
+	    	position: absolute;
+	    	left:90px;
+	    	top:20px;
+         color: Gray;
+	    	width:70px;
+         border: solid thin;
+         height:20px;
+	    }
+       .send{
+  	    	position: absolute;
+	    	left:177px;
+	    	top:20px;
+         color: Gray;
+         border: solid thin;
+         height:20px;
+         width:30px;
+       }
+	    -->
+</style>
+<?php
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'zoomCoords' AND fkey_gui_id = '".$_SESSION["mb_user_gui"]."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){
+   $e_target = $row["e_target"];
+   $cnt++;
+}
+
+echo '<script type="text/javascript">';
+if($cnt > 1){ echo "alert('zoomCoords: ID not unique!');";}
+
+echo "var mod_zoomCoords_target = '".$e_target."';";
+echo "var target = mod_zoomCoords_target.split(',')";
+echo "</script>";
+?>
+<script type="text/javascript">
+<!--
+function zoomCoordinate(){
+   var coordx = document.form1.X.value; 
+   var coordy = document.form1.Y.value;
+   coordx = coordx.replace(",",".");
+   coordy = coordy.replace(",",".");
+   var valid = true;
+    
+ /*  if(parseFloat(coordx) < 5.88 ||  parseFloat(coordx) > 15){
+      alert("Eingabe unzulässig!");
+      document.form1.X.select();
+      document.form1.X.focus();
+      valid = false; 
+      return false;
+   }
+   if(parseFloat(coordy) < 46.62 ||  parseFloat(coordy) > 55.71){
+      alert("Eingabe unzulässig!");
+      document.form1.Y.select();
+      document.form1.Y.focus();
+      valid = false;
+      return false;
+   }   */
+   setPermanentMarker(coordx,coordy);
+   parent.mb_hideHighlight(target[0]);
+   parent.mb_hideHighlight(target[1]);
+   parent.zoom(target[0],true, 1.0,coordx,coordy);
+}
+
+function highlight(x, y){
+  
+   x=x.replace(",",".");
+   y=y.replace(",",".");
+   
+   document.form1.X.value=x;
+   document.form1.Y.value=y;
+   
+   if (isNaN(x)==true || isNaN(y)==true){
+     
+   }
+   else{
+      parent.mb_showHighlight(target[0],x,y);
+      parent.mb_showHighlight(target[1],x,y);
+   }
+}
+
+function hideHighlight(){
+   parent.mb_hideHighlight(target[0]);
+   parent.mb_hideHighlight(target[1]);
+}
+
+function setPermanentMarker(x,y){
+   parent.mod_permanentHighlight_x = parseFloat(x);
+   parent.mod_permanentHighlight_y = parseFloat(y);
+}
+// -->
+</script>
+</head>
+<body bgcolor='#ffffff' onload=''>
+
+<?php
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+#coordinates
+   
+   #deutsche Version
+      echo "<span class='labelx'>X-Coordinate:</span>";
+      echo "<span class='labely'>Y-Coordinate:</span>";
+      echo "<input class='textx' type='text' name='X'>";
+      echo "<input class='texty' type='text' name='Y'>";
+      echo "<input class='send' type='button' value='ok' onclick='zoomCoordinate();' onmouseover='highlight(document.form1.X.value, document.form1.Y.value)' onmouseout='hideHighlight(document.form1.X.value, document.form1.Y.value)' >";
+
+?>
+</form>
+</body>
+</html>

Added: trunk/mapbender/http/php/nestedSets.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/nestedSets.php?view=auto&rev=52
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/php/nestedSets.php	2006-04-13 21:02:33+0000
@@ -0,0 +1,379 @@
+<?php
+# $Id: nestedSets.php,v 1.12 2006/03/09 12:09:29 uli_rothstein Exp $
+# $Header: /cvsroot/mapbender/mapbender/http/php/nestedSets.php,v 1.12 2006/03/09 12:09:29 uli_rothstein Exp $
# Copyright (C) 2002 CCGIS 
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+session_start();
+require_once("../../conf/mapbender.conf");
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>nestedSets</title>
+<?php
+include '../include/dyn_css.php';
+?>
+
+<style type="text/css">
+   <!--
+
+   input{
+   	width: 164px;
+   }
+   body{
+   	font-family : Arial, Helvetica, sans-serif;
+      font-size: 12px;
+   }
+   
+   -->
+</style>
+</head>
+<!-- <link rel='stylesheet' type='text/css' href='administration.css'> -->
+<script type="text/javascript">
+<!--
+function validate(value){
+	var permission = true;
+	if(value == 'insert'){
+		/*
+		if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Wählen Sie eine Position."); permission = false; return;}
+      	*/
+      	if(document.forms[0].title.value == ''){alert("Please insert a title."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Please choose a position."); permission = false; return;}
+      
+      if(document.forms[0].wmsList.selectedIndex > 0 && document.forms[0].layer.selectedIndex == 0){alert("Wählen Sie einen Layer."); permission = false; return;}
+		if(permission == true){document.forms[0].action.value = "insert"; document.forms[0].submit();}
+	}
+	if(value == 'delete'){
+		//permission = confirm("Soll das Objekt mit Inhalten gelöscht werden?");
+		permission = confirm("Do you want to delete the object and the content if the object?");
+		if(permission == true){
+		document.forms[0].action.value = "delete"; 
+		document.forms[0].submit();
+		} 
+	}
+	if(value == 'update'){
+		/*
+		if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
+		*/
+		
+		if(document.forms[0].title.value == ''){alert("Please fill in a labeling."); permission = false; return;}
+		if(document.forms[0].left.value == ''){alert("Please choose a position."); permission = false; return;}
+
+		if(permission == true){document.forms[0].action.value = "update"; document.forms[0].submit();}
+	}
+	if(value == 'add'){
+		/*
+		if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
+		if(document.forms[0].guiList.selectedIndex == 0){alert("Bitte wählen Sie eine GUI."); permission = false; return;}
+		if(document.forms[0].wmsList.selectedIndex == 0){alert("Bitte wählen Sie einen WMS."); permission = false; return;}
+		if(document.forms[0].layer.selectedIndex == 0){alert("Bitte wählen Sie eine Ebene."); permission = false; return;}
+		*/
+		
+		if(document.forms[0].left.value == ''){alert("Please fill in a position."); permission = false; return;}
+		if(document.forms[0].guiList.selectedIndex == 0){alert("Please choose a GUI."); permission = false; return;}
+		if(document.forms[0].wmsList.selectedIndex == 0){alert("Please choose a WMS."); permission = false; return;}
+		if(document.forms[0].layer.selectedIndex == 0){alert("Please choose a layer."); permission = false; return;}
+		
+		if(permission == true){document.forms[0].action.value = "add"; document.forms[0].submit();}
+	}
+}
+function rmWMS(obj){
+	if(obj.value == ''){
+		document.forms[0].wmsList.selectedIndex = 0;
	}
+}
+// -->
+</script>
+<body >
+<?php
+
+if(isset($action)){	
+   if($layer == 'Ordner'){$layer = "";}
+}
+if(isset($action) && $action == "insert"){
+	$temp = explode("###", $layer);
+	$sql = "SELECT rgt FROM gui_treegde WHERE lft = ".$left." AND fkey_gui_id = '".$guiList."'";
+	$res = db_query($sql);
+	if($pos == 'in'){$left = $left + 1;}
+	else if($pos == 'hinter'){$left = db_result($res,0,"rgt") + 1;}
+	else{ $left = $left + 2;}
+	$sql = "UPDATE gui_treegde SET rgt=rgt+2 WHERE rgt >=". $left." AND fkey_gui_id = '".$guiList."'";
+	db_query($sql);
+	$sql = "UPDATE gui_treegde SET lft=lft+2 WHERE lft >=".$left." AND fkey_gui_id = '".$guiList."'";
+	db_query($sql);
+	$sql = "INSERT INTO gui_treegde(fkey_gui_id, fkey_layer_id, lft,rgt, my_layer_title, layer, wms_id) VALUES(";
+		$sql .= "'".$guiList."', ";
+		$sql .= "'".$temp[0]."', ";	
+		$sql .= $left.", ";
+		$sql .= ($left+1).", ";
+		$sql .= "'".$name."', ";
+		$sql .= "'".$temp[1]."', ";
+		$sql .= "'".$wmsList."'";
+		$sql .= ")";
+		#echo $sql . "<br>";		
+	db_query($sql);
+	/*
+	if($layer == ""){
+		$left = $left + 1;
+		$sql = "UPDATE gui_treegde SET rgt=rgt+2 WHERE rgt >=". $left." AND fkey_gui_id = '".$guiList."'";
+		db_query($sql);
+		$sql = "UPDATE gui_treegde SET lft=lft+2 WHERE lft >=".$left." AND fkey_gui_id = '".$guiList."'";
+		db_query($sql);
+		#hier ist noch was falsch
+		$sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES('".$guiList."','new',".$left.",".($left+1).",'new')";
+		echo $sql . "<br />";
+		db_query($sql);      
+	}
+	*/
+}
+if(isset($action) && $action == "delete"){
+	$sql = "SELECT rgt FROM gui_treegde WHERE lft =". $left." AND fkey_gui_id = '".$guiList."'";
+	$res = db_query($sql);
+	$right = db_result($res,0,"rgt");
+	$sql = "DELETE FROM gui_treegde WHERE lft BETWEEN ".$left." and ".$right." AND fkey_gui_id = '".$guiList."'";
+	db_query($sql);
+	$sql = "UPDATE gui_treegde SET lft=lft-((".$right."-".$left."+1)) WHERE lft>".$right." AND fkey_gui_id = '".$guiList."'";
+	db_query($sql);
+	$sql = "UPDATE gui_treegde SET rgt=rgt-((".$right."-".$left."+1)) WHERE rgt>".$right." AND fkey_gui_id = '".$guiList."'";
+	db_query($sql);
+}
+if(isset($action) && $action == "update"){
+	$temp = explode("###", $layer);
+	$sql = "UPDATE gui_treegde SET ";
+	$sql .= "my_layer_title = '".$name."', ";
+	$sql .= "fkey_layer_id = '".$temp[0]."', ";
+	$sql .= "layer = '".$temp[1]."', ";
+	$sql .= "wms_id = '" . $wmsList."'";
+	$sql .= " WHERE lft = ".$left." AND fkey_gui_id = '".$guiList."'";
+	db_query($sql);
+}
+if(isset($action) && $action == "add"){
+	$temp = explode("###", $layer);
+	
+	$sql_val = "SELECT * FROM gui_treegde WHERE lft =". $left." AND fkey_gui_id = '".$guiList."'";
+	$res_val = db_query($sql_val);
+	
+	$sql = "UPDATE gui_treegde SET ";
+	
+	$sql .= "fkey_layer_id = ";
+	$sql .= "'";
+	if(db_result($res_val, 0, "fkey_layer_id") != ''){ $sql .= db_result($res_val, 0, "fkey_layer_id") . ","; }
+	$sql .=  $temp[0] . "', ";
+	
+	$sql .= "layer = ";
+	$sql .= "'";
+	if(db_result($res_val, 0, "layer") != ''){ $sql .= db_result($res_val, 0, "layer") . ","; }
+	$sql .= $temp[1] . "', ";
+	
+	$sql .= "wms_id = ";
+	$sql .= "'";
+	if(db_result($res_val, 0, "wms_id") != ''){ $sql .= db_result($res_val, 0, "wms_id") . ","; }
+	$sql .= $wmsList . "' ";
+	
+	$sql .= " WHERE lft = ".$left." AND fkey_gui_id = '".$guiList."'";
+	#echo $sql . "<br>";
+	db_query($sql);
+}
+?>
+<br />
+<b>Create your own tree for your GUI. Include the element treeconfGDE to see this tree</b><br />
+Detailed infos you will find in the mapbender wiki (<a href='http://www.mapbender.org' target='_blank'>http://www.mapbender.org</a>)<br />
+1. Select the GUI you want to create the new tree for <br />
+2. Select an element in the folder view<br />
+<br />
+<br />
+<!-- -->
+<?php
+if(isset($guiList) && $guiList != ""){
+	echo "<iframe ID='foldertree' name='foldertree' height='400' width='300' src='mod_treefolderAdmin.php?guiList=".$guiList."' scrolling='auto' frameborder='1'></iframe>";
+}
+else{
+	echo "<iframe ID='foldertree' name='foldertree' height='400' width='300' src='../html/mod_blank.html' scrolling='auto' frameborder='1'></iframe>";
+}
+?>
+
+<div style='position:absolute;top:50px;left:350px'>
+<form action='<?php $PHP_SELF ?>' method='POST'>
+<br><br>
+<table >
+<tr><td></td><td></td></tr>
+<?php
+require_once("../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"]);
+
+$sql = "SELECT * FROM gui WHERE gui_id IN ("; for($i=0; 
+$i<count($ownguis); $i++){
+				if($i>0){ $sql .= ",";}
+				$sql .= "'".$ownguis[$i]."'";
+				}
+$sql .= ") ORDER BY gui_name";
+
+$res = db_query($sql);
+$cnt = 0;
+echo "<select class='guiList' size='10' name='guiList' class='guiList'  onchange='document.forms[0].submit()'>";
+echo "<option value=''>GUI ...</option>";
+while($row = db_fetch_array($res)){
+   echo "<option value='".$row["gui_id"]."' ";
+   if(isset($guiList) && $guiList == $row["gui_id"]){
+   	echo "selected";
+   }
+   echo ">".$row["gui_name"]."</option>";
+   $cnt++;
+}
+echo "</select><br>";
+
+
+echo "<tr>";
+   #echo "<td>Beschriftung:</td>";
+   echo "<td>Labeling:</td>";
+   echo "<td><input type='text' size='16' name='name' value='";
+   echo $name;
+   echo "'></td>";
+echo "</tr>";
+?>
+<tr>
+<td>WMS: </td>
+<td>
+	<select name='wmsList' onchange='document.forms[0].submit()'>
+	<option value=''>WMS ...</option>
+	<?php
+	if(isset($guiList) && $guiList != ""){
+		$sql = "SELECT gui_wms.fkey_wms_id, wms.wms_title FROM gui_wms ";
+		$sql .= "INNER JOIN wms ON gui_wms.fkey_wms_id = wms.wms_id  ";
+		$sql .= "WHERE gui_wms.fkey_gui_id = '" . $guiList . "' ";
+		$sql .= "ORDER BY wms.wms_title";
+		$res = db_query($sql);
+		
+		$cnt = 0;
+		while($row = db_fetch_array($res)){
+			echo "<option value='".$row["fkey_wms_id"]."' ";
+			if($wmsList == $row["fkey_wms_id"]){
+				echo "selected";
+			}
+			echo ">";
+			echo $row["wms_title"];
+			echo "</option>";
+			$cnt++;
+		}
+	}
+	
+	else{echo "<option value=''>no gui selected</option>";}
+
+	echo"</select>";
+	echo"</td>   </tr><tr>";
+	#echo"<td>Ordner oder Ebene: </td>";
+	echo"<td>Folder or Layer: </td>";
+	
+	echo"<td>";
+	echo"<select name='layer' onchange='rmWMS(this)'>";
+ 	
+	#echo"<option value=''>Ordner</option>";
+	echo"<option value=''>Folder</option>";
+
+	if(isset($wmsList) && $wmsList != ""){
+		$sql_l = "SELECT gui_layer.fkey_layer_id, layer.layer_name, layer.layer_title FROM gui_layer ";
+		$sql_l .= "LEFT JOIN layer ON gui_layer.fkey_layer_id = layer.layer_id ";
+		$sql_l .= "WHERE gui_layer.gui_layer_wms_id = " . $wmsList . " AND layer.layer_parent = '0' AND gui_layer.fkey_gui_id = '".$guiList."'";
+		$sql_l .= " ORDER BY layer.layer_title";
+		$res_l = db_query($sql_l);
+
+		$cnt = 0;
+		while($row = db_fetch_array($res_l)){
+			echo "<option value='".$row["fkey_layer_id"]."###".$row["layer_name"]."'>";
+			echo $row["layer_title"];
+			echo "</option>";
+			$cnt++;
+		}
+	}
+	?>
+	</select>
+</td>   
+</tr>
+<tr>
+   <td>Position: </td>
+   <td>
+   <select name='pos'>
+<?php
+   #echo "<option value='hinter'>hinter</option>";
+   echo "<option value='hinter'>behind</option>";
+   
+   echo "<option value='in' ";
+   if($pos == 'in'){
+   	echo "selected";
+   }
+   echo ">in</option>";
+
+   echo"</select>      </td>   </tr><tr>";
+   #echo"<td>Hinter bzw. in Element Nr.:</td>";
+   echo"<td>Insert behind or <br>in element with number:</td>";
+
+   echo "<td><input type='text' size='1' name='left' ";
+   if($left)
+   { 
+   	echo "value='".$left."'"; 
+   }
+   echo "></td>";
+?>
+</tr>
+<tr>
+   <td>
+   <!--<input class='abutton' type='button' name="insert" value='einf&uuml;gen' onclick="validate('insert')"></td>
+   -->
+   <input class='abutton' type='button' name="insert" value='create new element' onclick="validate('insert')"></td>
+   <td></td>
+</tr>
+<tr>
+   <td>
+   <!--
+   <input class='abutton' type='button' name="delete" value='l&ouml;schen' onclick="validate('delete')"></td>
+   -->
+   <input class='abutton' type='button' name="delete" value='delete element' onclick="validate('delete')"></td>
+   
+   <td></td>
+</tr>
+<tr>
+   <td>
+   <!--
+   <input class='abutton' type='button' name="update" value='&amlndern' onclick="validate('update')"></td>
+   -->
+   <input class='abutton' type='button' name="update" value='change element' onclick="validate('update')"></td>
+   <td></td>
+</tr>
+<tr>
+   <td>
+   <!--
+   <input class='abutton' type='button' name="update" value='Ebene verbinden' onclick="validate('add')"></td>
+   -->
+   <input class='abutton' type='button' name="update" value='join layer' onclick="validate('add')"></td>
+   <td></td>
+</tr>
+<input type='hidden' name="action">
+</table>
+</form>
+</div>
+</body>
+</html>




More information about the Mapbender_commits mailing list