[Mapbender-commits] r7722 - in branches/marc_dev: . conf http/classes http/css http/extensions http/extensions/FirePHP-0.3 http/geoportal http/img/button_blue_red http/javascripts http/php http/plugins http/print http/print/classes owsproxy/http resources/db resources/db/pgsql/UTF-8/update resources/locale/de_DE/LC_MESSAGES tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Mar 28 15:16:52 EDT 2011


Author: marc
Date: 2011-03-28 12:16:52 -0700 (Mon, 28 Mar 2011)
New Revision: 7722

Added:
   branches/marc_dev/http/css/metadataNew.css
   branches/marc_dev/http/geoportal/geoportal_logo.png
   branches/marc_dev/http/geoportal/geoportal_splash.php
   branches/marc_dev/http/php/mod_group_user_role.php
   branches/marc_dev/http/print/A0_landscape_template.json
   branches/marc_dev/http/print/A0_landscape_template.odg
   branches/marc_dev/http/print/A0_landscape_template.pdf
   branches/marc_dev/http/print/A1_landscape_template.json
   branches/marc_dev/http/print/A1_landscape_template.odg
   branches/marc_dev/http/print/A1_landscape_template.pdf
   branches/marc_dev/resources/db/new_role_concept.sql
   branches/marc_dev/tools/build_dist.sh
Modified:
   branches/marc_dev/
   branches/marc_dev/conf/digitize_default.conf
   branches/marc_dev/conf/wfs_default.conf
   branches/marc_dev/http/classes/class_rss.php
   branches/marc_dev/http/classes/class_user.php
   branches/marc_dev/http/classes/class_wfsToDb.php
   branches/marc_dev/http/classes/class_wfs_1_0_factory.php
   branches/marc_dev/http/classes/class_wfs_factory.php
   branches/marc_dev/http/classes/class_wms.php
   branches/marc_dev/http/extensions/FirePHP-0.3/FirePHP.class.php
   branches/marc_dev/http/extensions/FirePHP-0.3/fb.php
   branches/marc_dev/http/extensions/jqjson.min.js
   branches/marc_dev/http/geoportal/gaz_geom.php
   branches/marc_dev/http/geoportal/mod_initialStartWmc.php
   branches/marc_dev/http/img/button_blue_red/add_filtered_list_off.png
   branches/marc_dev/http/javascripts/mod_coordsLookup.php
   branches/marc_dev/http/javascripts/mod_deleteWfsConf_client.html
   branches/marc_dev/http/javascripts/mod_digitize_tab.php
   branches/marc_dev/http/javascripts/mod_legend.php
   branches/marc_dev/http/javascripts/mod_sandclock.js
   branches/marc_dev/http/javascripts/mod_savewmc.js
   branches/marc_dev/http/javascripts/mod_wfs_gazetteer_client.php
   branches/marc_dev/http/javascripts/wms.js
   branches/marc_dev/http/php/mod_callMetadata.php
   branches/marc_dev/http/php/mod_editGuiWms.php
   branches/marc_dev/http/php/mod_filteredGroup_User.php
   branches/marc_dev/http/php/mod_filteredGroup_filteredUser.php
   branches/marc_dev/http/php/mod_filteredUser_Group.php
   branches/marc_dev/http/php/mod_filteredUser_filteredGroup.php
   branches/marc_dev/http/php/mod_getServiceDisclaimer.php
   branches/marc_dev/http/php/mod_getWmcDisclaimer.php
   branches/marc_dev/http/php/mod_group_filteredUser.php
   branches/marc_dev/http/php/mod_group_user.php
   branches/marc_dev/http/php/mod_layerISOMetadata.php
   branches/marc_dev/http/php/mod_savewmc_server.php
   branches/marc_dev/http/php/mod_showMetadata.php
   branches/marc_dev/http/php/mod_user_filteredGroup.php
   branches/marc_dev/http/php/mod_user_group.php
   branches/marc_dev/http/php/mod_wmc2ol.php
   branches/marc_dev/http/php/tagCloud.php
   branches/marc_dev/http/plugins/mb_metadata_edit.js
   branches/marc_dev/http/plugins/mb_metadata_edit.php
   branches/marc_dev/http/plugins/mb_metadata_layerPreview.php
   branches/marc_dev/http/plugins/mb_metadata_server.php
   branches/marc_dev/http/plugins/mb_metadata_wfs_edit.js
   branches/marc_dev/http/plugins/mb_metadata_wfs_edit.php
   branches/marc_dev/http/plugins/mb_metadata_wfs_server.php
   branches/marc_dev/http/plugins/mb_print.php
   branches/marc_dev/http/plugins/mb_sessionWmc.js
   branches/marc_dev/http/print/classes/mbMapDecorator.php
   branches/marc_dev/http/print/mapbender_template.json
   branches/marc_dev/owsproxy/http/index.php
   branches/marc_dev/resources/db/pgsql/UTF-8/update/update_2.6rc1_to_2.6_pgsql_UTF-8.sql
   branches/marc_dev/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql
   branches/marc_dev/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
   branches/marc_dev/tools/mod_mailAbo.php
Log:
update branch from trunk


Property changes on: branches/marc_dev
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/kmq_dev:4021-4487
   + /branches/kmq_dev:4021-4487,7677
/trunk/mapbender:7674-7721

Modified: branches/marc_dev/conf/digitize_default.conf
===================================================================
--- branches/marc_dev/conf/digitize_default.conf	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/conf/digitize_default.conf	2011-03-28 19:16:52 UTC (rev 7722)
@@ -33,7 +33,7 @@
 
 var geomHighlightColour = "#ff0000";
 
-var snappingHighlightZIndex = 85;
+var snappingHighlightZIndex = 75;
 var digitizeTransactionalZIndex = 80;
 var digitizeNonTransactionalZIndex = 20;
 // see also "generalHighlightZIndex" in wfs_default.conf

Modified: branches/marc_dev/conf/wfs_default.conf
===================================================================
--- branches/marc_dev/conf/wfs_default.conf	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/conf/wfs_default.conf	2011-03-28 19:16:52 UTC (rev 7722)
@@ -69,7 +69,7 @@
 /**
  * z-Index of the highlighted geometries
  */
-var generalHighlightZIndex = 80;
+var generalHighlightZIndex = 70;
 
 /**
  * Line width of the highlighted geometries in pixel

Modified: branches/marc_dev/http/classes/class_rss.php
===================================================================
--- branches/marc_dev/http/classes/class_rss.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/classes/class_rss.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -23,10 +23,14 @@
     var $channel_creator;
     var $channel_subject;   
     var $image_url;
+    //var $maxEntries;
+
+    //$this->maxEntries = 10;
+
     protected $items = array();
     protected $nritems;
 	
-	const MAX_ENTRIES = 10;
+	//const MAX_ENTRIES = 10;
 	
 	protected function createItem () {
 		return new RssItem();
@@ -41,6 +45,7 @@
 		};
 		$this->items[]= $item;
 		$this->nritems++;
+		$this->deleteLast(15+3);//offset of 3 for channel: title/link/description
 		return $item;
 	}
 	//function to append item at the top of the item list - maybe most recent !
@@ -53,8 +58,21 @@
 		}
 		array_unshift($this->items, $item);
 		$this->nritems++;
+		$this->deleteLast(15+3);
 		return $item;
 	}
+
+	public function deleteLast ($maxEntries) {
+		for ($k=$maxEntries-1; $k<$this->nritems; $k++){
+			$this->items[$k] = null;
+			$e = new mb_notice("delete georss items: items[".$k."]=null");
+		}
+		if ($this->nritems > ($maxEntries-3)){
+			//reduce to maxEntries-3
+			$this->nritems = $maxEntries-3;
+		}
+		return true;
+	}
 	
 	public function saveAsFile() {
 		if (func_num_args() === 1) {
@@ -70,6 +88,8 @@
 				return false;
 			}
 		}
+		//delete all entries which are more than MAX_ENTRIES from RSS!
+		
 		return administration::saveFile($pathAndFilename, $this->__toString());
 	}	
 	

Modified: branches/marc_dev/http/classes/class_user.php
===================================================================
--- branches/marc_dev/http/classes/class_user.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/classes/class_user.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -508,7 +508,12 @@
 		$mb_user_id = $this->id;
 		$arrayGuis = array();
 		$mb_user_groups = array();
-		$sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 ";
+		//exchange for the new role system - there are roles which don't include permissions explicitly
+		$sql_groups = "SELECT fkey_mb_group_id FROM ";
+		$sql_groups .= "(SELECT * from mb_user_mb_group left join mb_role on ";
+		$sql_groups .= " mb_user_mb_group.mb_user_mb_group_type = mb_role.role_id ";
+		$sql_groups .= " WHERE mb_role.role_exclude_auth != 1)  AS mb_user_mb_group WHERE fkey_mb_user_id = $1 ";
+		//$sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 ";
 		$v = array($mb_user_id);
 		$t = array("i");
 		$res_groups = db_prep_query($sql_groups,$v,$t);

Modified: branches/marc_dev/http/classes/class_wfsToDb.php
===================================================================
--- branches/marc_dev/http/classes/class_wfsToDb.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/classes/class_wfsToDb.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -113,8 +113,8 @@
 		$sql .= "city = $16, deliverypoint = $17, administrativearea = $18, ";
 		$sql .= "postalcode = $19, voice = $20, facsimile = $21, ";
 		$sql .= "electronicmailaddress = $22, country = $23, ";
-		$sql .= "wfs_timestamp = $24 ";
-		$sql .= "WHERE wfs_id = $25";
+		$sql .= "wfs_timestamp = $24, wfs_network_access = $25, fkey_mb_group_id = $26 ";
+		$sql .= "WHERE wfs_id = $27";
 
 		$v = array(
 			$aWfs->getVersion(), 
@@ -140,11 +140,13 @@
 			$aWfs->facsimile,
 			$aWfs->electronicMailAddress,
 			$aWfs->country, 
-			strtotime("now"), 
+			strtotime("now"),
+			$aWfs->network_access,
+			$aWfs->fkey_mb_group_id,
 			$aWfs->id
 		);
 			
-		$t = array('s', 's', 's', 's', 's', 's', 's', 's' ,'s' ,'s' ,'s' ,'s','s' ,'s','s','s','s','s','s','s','s','s','s','i' ,'i');
+		$t = array('s', 's', 's', 's', 's', 's', 's', 's' ,'s' ,'s' ,'s' ,'s','s' ,'s','s','s','s','s','s','s','s','s','s','i','i','i','i');
 		$e = new mb_exception("UPDATING WFS " . $aWfs->id);
 		$res = db_prep_query($sql, $v, $t);
 		if (!$res) {

Modified: branches/marc_dev/http/classes/class_wfs_1_0_factory.php
===================================================================
--- branches/marc_dev/http/classes/class_wfs_1_0_factory.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/classes/class_wfs_1_0_factory.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -38,10 +38,10 @@
 			"&REQUEST=DescribeFeatureType&TYPENAME=" . $featureTypeName;
 		
 		$xml = $this->get($url);
-		return $this->createFeatureTypeFromXml ($xml, $aWfs);
+		return $this->createFeatureTypeFromXml ($xml, $aWfs,$featureTypeName);
 	}
 		
-	protected function createFeatureTypeFromXml ($xml, $myWfs) {
+	protected function createFeatureTypeFromXml ($xml, $myWfs,$featureTypeName) {
 		$newFeatureType = new WfsFeatureType($myWfs);
 
 		$doc = new DOMDocument();
@@ -88,7 +88,6 @@
 			// Just querying for complexTypes containing a Sequence - good enough for Simple Features
 			$query = sprintf("//xs:complexType[@name='%s']//xs:element",$elementTypeLocalname);
 			$subElementList = $xpath->query($query);
-			$e = new mb_exception("NNN sub $query $subElementList->length");
 			foreach($subElementList as $subElement){
 				$newFeatureType->addElement($subElement->getAttribute('name'), $subElement->getAttribute('type'));
 			}

Modified: branches/marc_dev/http/classes/class_wfs_factory.php
===================================================================
--- branches/marc_dev/http/classes/class_wfs_factory.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/classes/class_wfs_factory.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -59,7 +59,7 @@
 	 * @param $id Integer
 	 * @param $aWfs Wfs is being created by the subclass
 	 */
-	public function createFromDb ($id) {
+	public function createFromDb ($id, $withProxyUrls = true) {
 		if (func_num_args() == 2) {
 			$aWfs = func_get_arg(1);
 		}
@@ -90,14 +90,14 @@
 			$aWfs->getCapabilitiesDoc = db_result($res, $cnt, "wfs_getcapabilities_doc");
 			$aWfs->uploadUrl = db_result($res, $cnt, "wfs_upload_url");
 			$aWfs->describeFeatureType = db_result($res, $cnt, "wfs_describefeaturetype");			
-			if(!$hasOwsproxyUrl){
+			if(!$hasOwsproxyUrl || !$withProxyUrls){
 				$aWfs->getFeature = db_result($res, $cnt, "wfs_getfeature");
 			}
 			else{
 				$aWfs->getFeature = $owsproxyUrl;
 			}
 			new mb_notice("class_wfs_factory.getFeature.url: ".$aWfs->getFeature);
-			if(!$hasOwsproxyUrl){
+			if(!$hasOwsproxyUrl || !$withProxyUrls){
 				$aWfs->transaction = db_result($res, $cnt, "wfs_transaction");
 			}
 			else{
@@ -108,7 +108,10 @@
 			$aWfs->accessconstraints = db_result($res, $cnt, "accessconstraints");
 			$aWfs->owner = db_result($res, $cnt, "wfs_owner");
 			$aWfs->timestamp = db_result($res, $cnt, "wfs_timestamp");
-			
+			$aWfs->timestamp_create = db_result($res, $cnt, "wfs_timestamp_create");
+			$aWfs->network_access = db_result($res, $cnt, "wfs_network_access");
+			$aWfs->fkey_mb_group_id = db_result($res, $cnt, "fkey_mb_group_id");
+			$aWfs->uuid = db_result($res, $cnt, "uuid");
 			// Featuretypes
 			$sql_fe = "SELECT * FROM wfs_featuretype WHERE fkey_wfs_id = $1 ORDER BY featuretype_id";
 			$v = array($aWfs->id);
@@ -124,6 +127,7 @@
 				$ft->title = db_result($res_fe, $cnt_fe, "featuretype_title");
 				$ft->summary = db_result($res_fe, $cnt_fe, "featuretype_abstract");
 				$ft->srs = db_result($res_fe, $cnt_fe, "featuretype_srs");
+				$ft->uuid = db_result($res_fe, $cnt_fe, "uuid");
 				
 				// Elements
 				$sql_el = "SELECT * FROM wfs_element WHERE fkey_featuretype_id = $1 ORDER BY element_id";

Modified: branches/marc_dev/http/classes/class_wms.php
===================================================================
--- branches/marc_dev/http/classes/class_wms.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/classes/class_wms.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -1743,6 +1743,8 @@
 				$this->objLayer[$i]->layer_abstract, $l_id		
 			);
 		$t = array('i','s','s','i','i','i','s','s','i', 's','i');
+		$e = new mb_notice("class_wms.php: update layer sql:".$sql);
+		$e = new mb_notice("class_wms.php: layerid: ".$l_id." layersearchable: ".$this->objLayer[$i]->layer_searchable);
 		$res = db_prep_query($sql,$v,$t);
 		if($this->overwrite == true){
 			$sql = "UPDATE layer SET ";
@@ -2156,14 +2158,16 @@
 		$sql .= "wms_userlayer = $11, ";
 		$sql .= "wms_userstyle = $12, ";
 		$sql .= "wms_remotewfs = $13, ";
-		$sql .= "wms_network_access = $14 ";
-		$sql .= " WHERE wms_id = $15";
+		$sql .= "wms_network_access = $14, ";
+		$sql .= "fkey_mb_group_id = $15, ";
+		$sql .= "uuid = $16 ";
+		$sql .= " WHERE wms_id = $17";
 	
 		$v = array($this->wms_version,$this->wms_getcapabilities,
 			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,
 			$admin->char_encode($this->wms_getcapabilities_doc),$this->wms_upload_url,Mapbender::session()->get("mb_user_id"),strtotime("now"),
-			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$this->wms_network_access, $myWMS);
-		$t = array('s','s','s','s','s','s','s','i','i','s','s','s','s','i','i');
+			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$this->wms_network_access, $this->fkey_mb_group_id ,$this->uuid ,$myWMS);
+		$t = array('s','s','s','s','s','s','s','i','i','s','s','s','s','i','i','s','i');
 	
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
@@ -2187,14 +2191,16 @@
 			$sql .= "contactvoicetelephone = $13, ";
 			$sql .= "contactfacsimiletelephone = $14, ";
 			$sql .= "contactelectronicmailaddress = $15, ";
-			$sql .= "wms_network_access = $16 ";
-			$sql .= " WHERE wms_id = $17";
+			$sql .= "wms_network_access = $16, ";
+			$sql .= "fkey_mb_group_id = $17, ";
+			$sql .= "uuid = $18 ";
+			$sql .= " WHERE wms_id = $19";
 		
 			$v = array($this->wms_title,$this->wms_abstract,$this->fees,$this->accessconstraints,
 				$this->contactperson,$this->contactposition,$this->contactorganization,$this->address,
 				$this->city,$this->stateorprovince,$this->postcode,$this->country,$this->contactvoicetelephone,
-				$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,$this->wms_network_access,$myWMS);
-			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i');
+				$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,$this->wms_network_access, $this->fkey_mb_group_id ,$this->uuid, $myWMS);
+			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','s','i');
 			$res = db_prep_query($sql,$v,$t);
 			if(!$res){
 				db_rollback();	
@@ -2747,7 +2753,7 @@
 	* creatObjfromDBNoGui
 	*
 	*/ 
-	  function createObjFromDBNoGui($wms_id){
+	  function createObjFromDBNoGui($wms_id, $withProxyUrls = true){
 	   	$sql = "Select * from wms where wms_id = $1 ";
 		$v = array($wms_id);
 		$t = array('i');
@@ -2760,7 +2766,8 @@
 			$this->wms_abstract = administration::convertIncomingString($this->stripEndlineAndCarriageReturn($row2["wms_abstract"]));
 			$wmsowsproxy = $row2["wms_owsproxy"];
 			#$wmsowsproxy = "test";
-			if($wmsowsproxy != ""){
+			//exchange the method urls with owsproxy urls if needed - default is to do it, but sometimes this is not usefull!
+			if($wmsowsproxy != "" && $withProxyUrls){
 				$owsproxyurl = OWSPROXY."/".session_id()."/".$wmsowsproxy."?";
 				$this->wms_getmap = $owsproxyurl;
 				$this->wms_getcapabilities =  $owsproxyurl;
@@ -2777,6 +2784,7 @@
 			// be encoded to the original encoding
 			// if different from the database encoding
 			$this->wms_getcapabilities_doc = $row2["wms_getcapabilities_doc"];
+			$this->wms_upload_url = $row2["wms_upload_url"];
 			$this->wms_filter = $row2["wms_filter"];
 			$this->wms_supportsld = $row2["wms_supportsld"];
 			$this->wms_userlayer = $row2["wms_userlayer"];
@@ -2798,6 +2806,8 @@
 			$this->country = $row2["country"];
 			$this->contactelectronicmailaddress = $row2["contactelectronicmailaddress"];
 			$this->wms_network_access = $row2["wms_network_access"];
+			$this->fkey_mb_group_id = $row2["fkey_mb_group_id"];
+			$this->uuid = $row2["uuid"];
 			
 			#some default
 			$this->gui_wms_visible = 1;
@@ -2853,6 +2863,7 @@
 			$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_queryable"];
 			$this->objLayer[$layer_cnt]->layer_minscale =$row2["layer_minscale"];
 			$this->objLayer[$layer_cnt]->layer_maxscale = $row2["layer_maxscale"];
+			$this->objLayer[$layer_cnt]->uuid = $row2["uuid"];
 			
 			if($this->objLayer[$layer_cnt]->layer_minscale == ""){
 				$this->objLayer[$layer_cnt]->layer_minscale = 0;

Copied: branches/marc_dev/http/css/metadataNew.css (from rev 7721, trunk/mapbender/http/css/metadataNew.css)
===================================================================
--- branches/marc_dev/http/css/metadataNew.css	                        (rev 0)
+++ branches/marc_dev/http/css/metadataNew.css	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,69 @@
+/*body,td, form, input, select{
+	font-size: 12px;
+	line-height: 16px;
+	font-family: "Verdana","Arial",sans-serif;
+	color: black;
+}
+
+select{
+	color:black;
+	width:300px;
+}
+
+.sbutton{
+	width:100px;
+	height:40px;
+}
+
+
+table{
+	font-size: 12px;
+	border: 1px;
+	margin-right: 4px;
+	margin-left: 6px;
+	text-align: left;	
+}
+
+
+.table_top{
+	color:black;
+	font-size: 12px;
+	margin-right: 2px;
+	text-align: right;	
+}
+
+.table_layer{
+	border:1px;
+	font-size: 12px;
+	border: 1px;
+	margin-right: 2px;
+	text-align: left;	
+}
+
+a {
+  text-decoration:none;
+  color:black;
+	text-decoration: underline;
+}
+
+a:active {
+	color: red;
+}
+a:hover {
+	color: blue;
+	text-decoration: underline;
+}
+div{
+	font-weight: bold;
+	text-decoration: underline;
+	color: Red;
+	margin-left: 2px;
+	background-color:#FFEDED;
+}*/
+table{
+	font-size: 12px;
+	border: 1px;
+	margin-right: 4px;
+	margin-left: 6px;
+	text-align: left;	
+}


Property changes on: branches/marc_dev/http/extensions/FirePHP-0.3/FirePHP.class.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/kmq_dev/http/extensions/FirePHP.class.php:4021-4487
   + /branches/kmq_dev/http/extensions/FirePHP-0.3/FirePHP.class.php:7677
/branches/kmq_dev/http/extensions/FirePHP.class.php:4021-4487
/trunk/mapbender/http/extensions/FirePHP-0.3/FirePHP.class.php:7674-7721


Property changes on: branches/marc_dev/http/extensions/FirePHP-0.3/fb.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/kmq_dev/http/extensions/fb.php:4021-4487
   + /branches/kmq_dev/http/extensions/FirePHP-0.3/fb.php:7677
/branches/kmq_dev/http/extensions/fb.php:4021-4487
/trunk/mapbender/http/extensions/FirePHP-0.3/fb.php:7674-7721


Property changes on: branches/marc_dev/http/extensions/jqjson.min.js
___________________________________________________________________
Modified: svn:mergeinfo
   - 
   + /branches/kmq_dev/http/extensions/jqjson.min.js:7677
/trunk/mapbender/http/extensions/jqjson.min.js:7674-7721

Modified: branches/marc_dev/http/geoportal/gaz_geom.php
===================================================================
--- branches/marc_dev/http/geoportal/gaz_geom.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/geoportal/gaz_geom.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -293,7 +293,8 @@
 				if($row["zusatz"] != 'null'){
 				#	$show .= $row["zusatz"];
 				
-$show = $row["name"]." ".$row["hausnummer"].$row["zusatz"];
+$show = utf8_decode($row["name"])." ".$row["hausnummer"].$row["zusatz"];
+//$show = $row["name"]." ".$row["hausnummer"].$row["zusatz"]; TODO: exchange this, when the hauskoordinaten table is delivered in a homogenous encoding! 
 }
 	else
 {$show = $row["name"]." ".$row["hausnummer"];}	
@@ -340,7 +341,8 @@
 		$res = db_prep_query($sql,$v,$t);
 		while($row = db_fetch_array($res)){
 			
-			$show = $row["name"]." ".$row["hausnummer"];
+			$show = utf8_encode($row["name"])." ".$row["hausnummer"];
+			//$show = $row["name"]." ".$row["hausnummer"]; TODO: see above
 			if($row["zusatz"] != null){
 				$show .= $row["zusatz"];	
 			}

Copied: branches/marc_dev/http/geoportal/geoportal_logo.png (from rev 7721, trunk/mapbender/http/geoportal/geoportal_logo.png)
===================================================================
(Binary files differ)

Copied: branches/marc_dev/http/geoportal/geoportal_splash.php (from rev 7721, trunk/mapbender/http/geoportal/geoportal_splash.php)
===================================================================
--- branches/marc_dev/http/geoportal/geoportal_splash.php	                        (rev 0)
+++ branches/marc_dev/http/geoportal/geoportal_splash.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,3 @@
+<?php
+echo "<table width='100%' style='background-color:#FFFFFF'><tr align='center'><td><br><br><br><br><img alt='ajax-loader' src='../img/ajax-loader.gif'>"."&nbsp&nbsp&nbsp&nbsp"."<img alt='logo'src='../geoportal/geoportal_logo.png'>"."&nbsp&nbsp&nbsp&nbsp"."<img alt='ajax-loader' src='../img/ajax-loader.gif'></td></tr><tr align='center'><td><br><strong>"._mb('please wait ... ')."</strong></td></tr>"."<tr  align='center'><td><br>"._mb('Loading application: ')."" . $this->guiId . "</td></tr></table>";	
+?>

Modified: branches/marc_dev/http/geoportal/mod_initialStartWmc.php
===================================================================
--- branches/marc_dev/http/geoportal/mod_initialStartWmc.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/geoportal/mod_initialStartWmc.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -46,10 +46,14 @@
 if (isset($_REQUEST["hostName"]) & $_REQUEST["hostName"] != "") {
 	//validate to some hosts
 	$testMatch = $_REQUEST["hostName"];	
- 	if (!($testMatch == 'www.geoportal.rlp' or $testMatch == 'www.geoportal.rlp.de' or  $testMatch == 'www.gdi-rp-dienste3.rlp.de' or  $testMatch == '10.7.101.151' or  $testMatch == '10.7.101.165')){ 
-		echo 'hostName: <b>'.$testMatch.'</b> is not a valid server of gdi-rp.<br/>'; 
-		die(); 		
- 	}
+	//look for whitelist in mapbender.conf
+	$HOSTNAME_WHITELIST_array = explode(",",HOSTNAME_WHITELIST);
+	if (!in_array($testMatch,$HOSTNAME_WHITELIST_array)) {
+		echo "Requested hostname <b>".$testMatch."</b> not whitelist! Please control your mapbender.conf.";
+		$e = new mb_notice("Whitelist: ".HOSTNAME_WHITELIST);
+		$e = new mb_notice($testMatch." not found in whitelist!");
+		die(); 	
+	}
 	$hostName = $testMatch;
 	$testMatch = NULL;
 }
@@ -61,7 +65,6 @@
 }
 /*
 //define sql for selecting informations from database:
-
 $sql = "";
 $sql .= "SELECT search_wmc_view.wmc_serial_id,search_wmc_view.wmc_title,search_wmc_view.wmc_abstract, custom_category.custom_category_code_".$languageCode. ", search_wmc_view.load_count ";
 $sql .= "FROM search_wmc_view INNER JOIN wmc_custom_category ON "; 
@@ -73,22 +76,16 @@
 $sql = "";
 $sql .= "SELECT search_wmc_view.wmc_serial_id,search_wmc_view.wmc_title,search_wmc_view.wmc_abstract, search_wmc_view.load_count ";
 $sql .= "FROM search_wmc_view ORDER BY search_wmc_view.load_count DESC LIMIT $1 ";
-
-
-
 $v = array($maxObjects);
 $t = array('i');
 $res = db_prep_query($sql,$v,$t);
-
 $initialWmc = array();
 $i = 0;
 while($row = db_fetch_array($res)){
 	$initialWmc[$i] = array('id'  =>$row['wmc_serial_id'], 'title' =>$row['wmc_title'], 'abstract' =>$row['wmc_abstract'],'loadUrl'=>'http://'.$hostName.$pathToLoadScript.$row['wmc_serial_id'],'metadataUrl'=>'http://'.$hostName.$pathToMetadata."languageCode=".$languageCode."&resource=wmc&id=".$row['wmc_serial_id'], 'previewUrl'=>'http://'.$hostName.$pathToPreview."resource=wmc&id=".$row['wmc_serial_id']);
 	$i++;
 }
-
 if ($outputFormat == 'html'){
-	
 	echo "<html>";
 	echo "<title>Mapbender Initial WMC</title>";
 	echo "<body>";
@@ -105,7 +102,6 @@
 	echo "</body>";
 	echo "</html>";
 }
-
 if ($outputFormat == 'json'){
 	$wmcJSON = new stdClass;
 	$wmcJSON->initialWmcDocs = array();
@@ -121,11 +117,4 @@
 	$wmcJSON = $classJSON->encode($wmcJSON);
 	echo $wmcJSON;
 }
-
-
-
-
-
-
-
 ?>

Modified: branches/marc_dev/http/img/button_blue_red/add_filtered_list_off.png
===================================================================
(Binary files differ)

Modified: branches/marc_dev/http/javascripts/mod_coordsLookup.php
===================================================================
--- branches/marc_dev/http/javascripts/mod_coordsLookup.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/mod_coordsLookup.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -118,7 +118,7 @@
 		for(var i = 0; i < options.perimeters.length; i++) {
 			var optionValue = options.perimeters[i] + '';
 			
-			optionValue = (optionValue.length < 4) ? (optionValue + ' m') : optionValue.replace(/(\d+)(\d{3})/, '$1' + '.' + '$2' + ' m');
+			optionValue = (optionValue.length < 4) ? (optionValue + ' m') : optionValue.replace(/(\d+)(\d{3})/, '$1' + '$2' + ' m');
 			
 			$(this.perimeterSelect).append('<option value=' + optionValue + ' >' + optionValue + '</option>');
 		}

Modified: branches/marc_dev/http/javascripts/mod_deleteWfsConf_client.html
===================================================================
--- branches/marc_dev/http/javascripts/mod_deleteWfsConf_client.html	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/mod_deleteWfsConf_client.html	2011-03-28 19:16:52 UTC (rev 7722)
@@ -99,10 +99,16 @@
 	var obj2json = parent.$.toJSON(obj);
 	parent.mb_ajax_post("../php/mod_deleteWfsConf_server.php",{"obj":obj2json}, function (json,status){
 		if(status == 'success'){
-			var dsJson = eval('(' + json + ')');
+			var dsJson = json;
 			switch(obj['action']){
 				case "getServices":
-					appendServices(dsJson);
+					services['services'] = dsJson.services;
+					var wfsServices = services['services'];
+					if (dsJson.services.id.length > 0) {
+						appendServices(dsJson);
+					} else {
+						alert("You have no WFS registrated till now.....");
+					}
 				break;
 				case "getWfsConfData":
 					appendWfsConfData(dsJson);					
@@ -216,4 +222,4 @@
 </form>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/marc_dev/http/javascripts/mod_digitize_tab.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/mod_digitize_tab.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -2087,7 +2087,7 @@
 // --- wfs window form check (end) -----------------------------------------------------------------------------------------
 // -----------------------------------------------------------------------------------------------------------
 
-function getAvailableWfsForGeom(geom, wfsConf) {
+function getAvailableWfsForGeom(geom, wfsConf) {	
 	var wfsConfIndices = [];
 	
 	for (var attr in wfsConf) {
@@ -2095,13 +2095,14 @@
 		if (!isTrans) {
 			continue;
 		}
+		/*
 		if (isValidWfsConfIndex(wfsConf, parseInt(geom.wfs_conf))) {
-			
-//			if (parseInt(geom.wfs_conf) == parseInt(attr)) {
+			if (parseInt(geom.wfs_conf) == parseInt(attr)) {
 				wfsConfIndices.push(attr);
-//			}
+			}
 		}
 		else {
+		*/
 			for (var elementIndex = 0; elementIndex < wfsConf[attr]['element'].length ; elementIndex++) {
 				var isGeomColumn = (parseInt(wfsConf[attr]['element'][elementIndex]['f_geom']) == 1); 
 				if (isGeomColumn) {
@@ -2148,7 +2149,7 @@
 					}
 				}
 			}
-		}	
+		//}	
 	}
 	return wfsConfIndices;
 }
@@ -2334,13 +2335,13 @@
 	var selected = false;
 	// set the current wfs_conf as the selected
 	// if wfs_conf is not yet set (for example when creating a new feature, just select the first one)
-	var selectedIndex = d.get(geometryIndex).wfs_conf || 0;
+	var selectedIndex = d.get(geometryIndex).wfs_conf || wfsConfIndices[0];
 	for (var i = 0; i < wfsConfIndices.length ; i++) {
 		for (var j in wfsConf[i].element){
 
 		}
 		str += "<option value='" + wfsConfIndices[i] + "'";
-		if (i == selectedIndex ) {
+		if (wfsConfIndices[i] == selectedIndex ) {
 			str += " selected";
 			selected = true;
 			defaultIndex = parseInt(wfsConfIndices[i]);
@@ -2882,7 +2883,42 @@
 				return;
 			}
 		}
+		
+		// Extract the current, possibly new WfsConf
+                var newWfsConfId = d.get(m).wfs_conf
+		if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
+                    newWfsConfId = parseInt(wfsWindow.document.getElementById('wfs').wfs.value, 10);
+		}
+		var newWfsConf = wfsConf[newWfsConfId];
+		newWfsConfId = newWfsConf['wfs_conf_id'];
 
+		// Check each feature attribute if it is part of the WfsConf element type. If not, delete.
+		var e = d.get(m).e;
+		var elementsToDelete = [];
+		for(var i in e.name) {
+			// Never delete fid attribute
+                        if(e.name[i] === "fid") {
+                            continue;
+                        }
+                        
+                        var validElement = false;
+			for(var j in newWfsConf.element) {
+				if(e.name[i] == newWfsConf.element[j]['element_name']) {
+					validElement = true;
+					break;
+				}
+			}
+			if(!validElement) {
+				elementsToDelete.push(i);
+			}
+		}
+		
+		// Delete. As the arrays shrink, the indices into the arrays are shrunk, too
+		for(var i in elementsToDelete) {
+			e.name.splice(elementsToDelete[i] - i, 1);
+			e.value.splice(elementsToDelete[i] - i, 1);
+		}
+		
 		var geoJson = d.featureToString(m);
 
 		parent.mb_ajax_post(
@@ -2890,7 +2926,7 @@
 			{
 				'geoJson' : geoJson,
 				'method' : type,
-				'wfs_conf_id' : wfsConf[d.get(m).wfs_conf]['wfs_conf_id']
+				'wfs_conf_id' : newWfsConfId
 			}, 
 			function(json,status){
 				var result = typeof(json) == 'object' ? json :  eval('('+json+')');

Modified: branches/marc_dev/http/javascripts/mod_legend.php
===================================================================
--- branches/marc_dev/http/javascripts/mod_legend.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/mod_legend.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -95,7 +95,9 @@
 					var layerStyle = parent.mb_mapObj[ind].wms[i].getCurrentStyleByLayerName(layerNames[j]);
 					var legendUrl = false;
 					if(layerStyle == false){
-						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],"");	
+						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],"");
+						
+						//alert("mapObj ind: "+ind+" wms index: "+i+"layer name: "+layerNames[j]+" : LegendUrl (style false): "+legendUrl);	
 					}
 					else{
 						legendUrl = parent.mb_mapObj[ind].wms[i].getLegendUrlByGuiLayerStyle(layerNames[j],layerStyle);
@@ -111,6 +113,7 @@
 		                    if(legendlink == 'true'){
 		                    	str_tmp += "<a href='../php/result.php?lingo=deutsch&layer="+layerNames[j]+"' class='link_metadata' title='Zeigt Liste zum Thema: "+layerTitle+"' target='result'>";
 		                    }
+				
 		                    str_tmp += "<img border=0 src = '";			
 							str_tmp += legendUrl;
 							str_tmp += "'></img>";


Property changes on: branches/marc_dev/http/javascripts/mod_sandclock.js
___________________________________________________________________
Modified: svn:mergeinfo
   - 
   + /branches/kmq_dev/http/javascripts/mod_sandclock.js:7677
/trunk/mapbender/http/javascripts/mod_sandclock.js:7674-7721

Modified: branches/marc_dev/http/javascripts/mod_savewmc.js
===================================================================
--- branches/marc_dev/http/javascripts/mod_savewmc.js	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/mod_savewmc.js	2011-03-28 19:16:52 UTC (rev 7722)
@@ -86,7 +86,7 @@
 	browserCompatibilityMode = 1;
 }
 //for all save by afterMapRequest
-//browserCompatibilityMode = 1;
+browserCompatibilityMode = 1;
 
 
 function pausecomp(millis) { //http://www.sean.co.uk/a/webdesign/javascriptdelay.shtm

Modified: branches/marc_dev/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/marc_dev/http/javascripts/mod_wfs_gazetteer_client.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/mod_wfs_gazetteer_client.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -292,7 +292,7 @@
 
 
 		// creates a Highlight object for the request geometry
-		var styleProperties = {"position":"absolute", "top":"0px", "left":"0px", "z-index":80};
+		var styleProperties = {"position":"absolute", "top":"0px", "left":"0px", "z-index":70};
 		requestGeometryHighlight = new parent.Highlight(targetArray, "requestGeometryHighlight", styleProperties, 2);
 		parent.mb_registerSubFunctions("window.frames['" + frameName +"'].requestGeometryHighlight.paint()");
 
@@ -1390,4 +1390,4 @@
 <div id="uploader"></div>
 <div class='resultDiv' name='res' id='res'></div>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/javascripts/wms.js
===================================================================
--- branches/marc_dev/http/javascripts/wms.js	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/javascripts/wms.js	2011-03-28 19:16:52 UTC (rev 7722)
@@ -728,7 +728,12 @@
 	wms[wms.length-1].gui_maxy[wms[wms.length-1].gui_maxy.length] = maxy;
 }
 function wms_addLayerStyle(styleName, styleTitle, count, layerCount, styleLegendUrl, styleLegendUrlFormat){
+	//TODO for debug purposes:	
+	//alert(styleName+":"+styleTitle+":"+count+":"+layerCount+":"+styleLegendUrl+":"+styleLegendUrlFormat);
+	//var test = wms.length-1;
+	//alert("add layer style["+count+"] for layer["+layerCount+"] for wms["+test+"]:"+styleLegendUrl);
 	var currentLayer = wms[wms.length-1].objLayer[layerCount]; 
+
 	if (currentLayer) {
 		currentLayer.layer_style[count] = {};
 		currentLayer.layer_style[count].name = styleName;

Modified: branches/marc_dev/http/php/mod_callMetadata.php
===================================================================
--- branches/marc_dev/http/php/mod_callMetadata.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_callMetadata.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -239,11 +239,16 @@
 	$testMatch = NULL;
 }
 if (isset($_REQUEST["hostName"]) & $_REQUEST["hostName"] != "") {
+	//validate to some hosts
 	$testMatch = $_REQUEST["hostName"];	
- 	if (!($testMatch == 'www.geoportal.rlp' or $testMatch == 'www.geoportal.rlp.de' or $testMatch == 'geoportal.rlp' or $testMatch == '10.7.101.151' or $testMatch == 'localhost:16580' or $testMatch == 'localhost' or $testMatch == 'www.gdi-rp-dienste3.rlp.de' or $testMatch == '10.7.101.252' )){ 
-		echo 'hostName: <b>'.$testMatch.'</b> is not valid.<br/>'; 
-		die(); 		
- 	}
+	//look for whitelist in mapbender.conf
+	$HOSTNAME_WHITELIST_array = explode(",",HOSTNAME_WHITELIST);
+	if (!in_array($testMatch,$HOSTNAME_WHITELIST_array)) {
+		echo "Requested hostname <b>".$testMatch."</b> not whitelist! Please control your mapbender.conf.";
+		$e = new mb_notice("Whitelist: ".HOSTNAME_WHITELIST);
+		$e = new mb_notice($testMatch." not found in whitelist!");
+		die(); 	
+	}
 	$hostName = $testMatch;
 	$testMatch = NULL;
 }

Modified: branches/marc_dev/http/php/mod_editGuiWms.php
===================================================================
--- branches/marc_dev/http/php/mod_editGuiWms.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_editGuiWms.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -505,7 +505,7 @@
 $count_wms = 0;
 
 # WMS select box on right side
-echo "<select size='8' name='wmsList' style='width:600px' onchange='submit()'>";
+echo "<select size='8' name='wmsList' style='width:300px' onchange='submit()'>";
 
 while ($row = db_fetch_array($res)) {
 	echo "<option title='" . htmlentities($row["wms_abstract"], ENT_QUOTES, "UTF-8") . "'  value='" . $row["wms_id"] . "' ";

Modified: branches/marc_dev/http/php/mod_filteredGroup_User.php
===================================================================
--- branches/marc_dev/http/php/mod_filteredGroup_User.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_filteredGroup_User.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -139,7 +139,7 @@
 	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 = $1 and fkey_mb_user_id = $2 ";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL) ";
 			$v = array($selected_group,$selected_user[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -156,7 +156,7 @@
 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 = $1 and fkey_mb_group_id = $2 ";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_user[$i],$selected_group);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -192,7 +192,7 @@
 if(count($group_id)>0){
 	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, 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 = $1 ";
+	$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id = $1  AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL) ";
 	$sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
 	
 	if(!$selected_group){$v = array($group_id[0]);}
@@ -281,4 +281,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_filteredGroup_filteredUser.php
===================================================================
--- branches/marc_dev/http/php/mod_filteredGroup_filteredUser.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_filteredGroup_filteredUser.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -146,7 +146,7 @@
 	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 = $1 and fkey_mb_user_id = $2 ";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL) ";
 			$v = array($selected_group,$selected_user[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -163,7 +163,7 @@
 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 = $1 and fkey_mb_group_id = $2 ";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 and fkey_mb_group_id = $2  AND fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_user[$i],$selected_group);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -202,7 +202,7 @@
 	$t = array();
 	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, 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 = $1 ";	
+	$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id = $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL) ";	
 	if(!$selected_group){array_push($v,$group_id[0]); array_push($t,'i');}
 	if($selected_group){array_push($v,$selected_group); array_push($t,'i');}
 	$sql_mb_user_mb_group .= " AND  mb_user.mb_user_owner = $2 ";
@@ -290,4 +290,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_filteredUser_Group.php
===================================================================
--- branches/marc_dev/http/php/mod_filteredUser_Group.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_filteredUser_Group.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -141,7 +141,7 @@
 	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 = $1 and fkey_mb_group_id = $2";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL) ";
 			$v = array($selected_user,$selected_group[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -158,7 +158,7 @@
 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 = $1 and fkey_mb_user_id = $2";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_group[$i],$selected_user);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -194,7 +194,7 @@
 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 = $1 ";
+	$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id = $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL) ";
 	$sql_user_mb_group .= "ORDER BY mb_group.mb_group_name";
 	if(!$selected_user){$v = array($user_id[0]);}
 	if($selected_user){$v = array($selected_user);}
@@ -270,4 +270,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_filteredUser_filteredGroup.php
===================================================================
--- branches/marc_dev/http/php/mod_filteredUser_filteredGroup.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_filteredUser_filteredGroup.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -141,7 +141,7 @@
 	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 = $1 and fkey_mb_group_id = $2";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL) ";
 			$v = array($selected_user,$selected_group[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -158,7 +158,7 @@
 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 = $1 and fkey_mb_user_id = $2";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_group[$i],$selected_user);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -195,7 +195,7 @@
 if (count($user_id) == 0 AND count($group_id) == 0){ die("There is no group or user available for this 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 = $1 ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id = $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL) ";
 if(!$selected_user){$v = array($user_id[0]);}
 if($selected_user){$v = array($selected_user);}
 $t = array('i');
@@ -274,4 +274,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_getServiceDisclaimer.php
===================================================================
--- branches/marc_dev/http/php/mod_getServiceDisclaimer.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_getServiceDisclaimer.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -178,7 +178,7 @@
 	$sql .= " (wms_termsofuse.fkey_termsofuse_id=termsofuse.termsofuse_id) where wms.wms_id = $1";
 }
 if ($type == "wfs") {
-	$sql = "SELECT wms_id, accessconstraints, fees, wfs_network_access , termsofuse.name,";
+	$sql = "SELECT wfs_id, accessconstraints, fees, wfs_network_access , termsofuse.name,";
 	$sql .= " termsofuse.termsofuse_id ,termsofuse.symbollink, termsofuse.description,termsofuse.descriptionlink from wfs LEFT OUTER JOIN";
 	$sql .= "  wfs_termsofuse ON  (wfs.wfs_id = wfs_termsofuse.fkey_wfs_id) LEFT OUTER JOIN termsofuse ON";
 	$sql .= " (wfs_termsofuse.fkey_termsofuse_id=termsofuse.termsofuse_id) where wfs.wfs_id = $1";	

Modified: branches/marc_dev/http/php/mod_getWmcDisclaimer.php
===================================================================
--- branches/marc_dev/http/php/mod_getWmcDisclaimer.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_getWmcDisclaimer.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -34,15 +34,20 @@
 }
 //TODO give requesting hostname to this script
 if (isset($_REQUEST["hostName"]) & $_REQUEST["hostName"] != "") {
+	//validate to some hosts
 	$testMatch = $_REQUEST["hostName"];	
- 	if (!($testMatch == 'www.geoportal.rlp' or $testMatch == 'www.geoportal.rlp.de' or $testMatch == 'geoportal.rlp' or $testMatch == '10.7.101.165' or $testMatch == '10.7.101.151' or $testMatch == 'localhost' or $testMatch == 'www.gdi-rp-dienste3.rlp.de'  or $testMatch == '10.7.101.252' )){ 
-		echo 'hostName: <b>'.$testMatch.'</b> is not valid.<br/>'; 
-		die(); 		
- 	}
+	//look for whitelist in mapbender.conf
+	$HOSTNAME_WHITELIST_array = explode(",",HOSTNAME_WHITELIST);
+	if (!in_array($testMatch,$HOSTNAME_WHITELIST_array)) {
+		echo "Requested hostname <b>".$testMatch."</b> not whitelist! Please control your mapbender.conf.";
+		$e = new mb_notice("Whitelist: ".HOSTNAME_WHITELIST);
+		$e = new mb_notice($testMatch." not found in whitelist!");
+		die(); 	
+	}
 	$hostName = $testMatch;
 	$testMatch = NULL;
 }
-$e = new mb_exception("mod_getWmcDisclaimer.php: requested wmc id: ".$_REQUEST["id"]);
+$e = new mb_notice("mod_getWmcDisclaimer.php: requested wmc id: ".$_REQUEST["id"]);
 //
 //
 if (isset($_REQUEST["languageCode"]) & $_REQUEST["languageCode"] != "") {

Modified: branches/marc_dev/http/php/mod_group_filteredUser.php
===================================================================
--- branches/marc_dev/http/php/mod_group_filteredUser.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_group_filteredUser.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -139,7 +139,7 @@
 	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 = $1 and fkey_mb_user_id = $2";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($selected_group,$selected_user[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -156,7 +156,7 @@
 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 = $1 and fkey_mb_group_id = $2";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 AND fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_user[$i],$selected_group);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -189,7 +189,7 @@
 /*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_user_email, 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 = $1 ";
+$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id = $1  AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL)";
 if(!$selected_group){$v = array($group_id[0]);}
 if($selected_group){$v = array($selected_group);}
 $t = array('i');
@@ -274,4 +274,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_group_user.php
===================================================================
--- branches/marc_dev/http/php/mod_group_user.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_group_user.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -136,7 +136,7 @@
 	if(count($selected_user)>0){
 		for($i=0; $i<count($selected_user); $i++){
 			$exists = false;
-			$sql = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2";
+			$sql = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($selected_group,$selected_user[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql,$v,$t);
@@ -155,7 +155,7 @@
 	if(count($remove_user)>0){
 		for($i=0; $i<count($remove_user); $i++){
 			$sql_remove = "DELETE FROM mb_user_mb_group WHERE ";
-			$sql_remove .= "fkey_mb_user_id = $1 and fkey_mb_group_id = $2";
+			$sql_remove .= "fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_user[$i],$selected_group);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -186,7 +186,7 @@
 /*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_user_email, 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= $1 ";
+$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL)";
 $sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
 
 if(!$selected_group){$v = array($group_id[0]);}
@@ -272,4 +272,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Copied: branches/marc_dev/http/php/mod_group_user_role.php (from rev 7721, trunk/mapbender/http/php/mod_group_user_role.php)
===================================================================
--- branches/marc_dev/http/php/mod_group_user_role.php	                        (rev 0)
+++ branches/marc_dev/http/php/mod_group_user_role.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,373 @@
+<?php
+# $Id: mod_group_user.php 7276 2010-12-12 10:36:40Z apour $
+# http://www.mapbender.org/index.php/Administration
+# 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.
+
+$e_id="Group_User_Role";
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
+//require_once(dirname(__FILE__)."/../core/globalSettings.php");
+/*
+ * @security_patch irv done
+ */
+//security_patch_log(__FILE__,__LINE__);
+//import_request_variables("PG");
+
+$postvars = explode(",", "selected_group,filter2,insert,remove,filter3,remove_user,selected_user,select_role,alterrole");
+foreach ($postvars as $value) {
+   $$value = $_POST[$value];
+}
+
+?>
+<!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();
+		}
+		if(wert == "showrole"){
+			document.forms[0]["select_role"].disabled=false;
+			var removeUser = document.forms[0]["remove_user[]"].value;
+			var removeUserArray = removeUser.split("+");
+			//alert(removeUserArray[1]);
+			for(index = 0; index < document.forms[0]["select_role"].length; index++) {
+   				if(document.forms[0]["select_role"][index].value == removeUserArray[1]) {
+     					document.forms[0]["select_role[]"].selectedIndex = index;
+   				}
+			}
+		}
+		if(wert == "changerole"){
+			document.form1.alterrole.value = 'true';
+			document.form1.submit();
+		}
+	}
+}
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
+function showAvailableRoles(){
+	
+}
+function selectRole(){
+
+}
+
+</script>
+
+</head>
+<body>
+<?php
+
+$fieldHeight = 20;
+
+$cnt_group = 0;
+$cnt_user = 0;
+$cnt_group = 0;
+$cnt_group_user = 0;
+$cnt_group_group = 0;
+$cnt_role = 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;
+			//check if a user is already in this group a standard role
+			$sql = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 and mb_user_mb_group_type = $3";
+			$v = array($selected_group,$selected_user[$i],1);
+			$t = array('i','i','i');
+			$res_insert = db_prep_query($sql,$v,$t);
+			while(db_fetch_row($res_insert)){$exists = true;}
+			if($exists == false){
+				//add a user without any special role to the selected group
+				$sql = "INSERT INTO mb_user_mb_group(fkey_mb_group_id, fkey_mb_user_id) ";
+				$sql .= "VALUES($1, $2);";
+				$v = array($selected_group,$selected_user[$i]);
+				$t = array('i','i');
+				$res = db_prep_query($sql,$v,$t);
+			}
+		}
+	}
+}
+if($remove){
+	if(count($remove_user)>0){
+		for($i=0; $i<count($remove_user); $i++){
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE ";
+			$sql_remove .= "fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND mb_user_mb_group_type = $3";
+			//explode identifier for selected user option 
+			$remove_user_explode = explode('+',$remove_user[$i]);
+			$v = array($remove_user_explode[0],$selected_group,$remove_user_explode[1]);
+			$t = array('i','i','i');
+			db_prep_query($sql_remove,$v,$t);
+		}
+	}
+}
+if($alterrole){
+	$e = new mb_exception("alterrole send");
+	if(count($remove_user)==1){
+		$e = new mb_exception("only one user selected");
+		//update role of the selected user-role combination - if it doesn't exists at all!
+		//check if combi exists
+		$exists = false;
+		//check if a user is already in this group without that role
+		$sql = "SELECT * from mb_user_mb_group where fkey_mb_group_id = $1 and fkey_mb_user_id = $2 and mb_user_mb_group_type = $3";
+		//explode user-role combi to single elements userId and roleId
+		$remove_user_explode = explode('+',$remove_user[0]);
+		$v = array($selected_group,$remove_user_explode[0],$select_role[0]);
+		$t = array('i','i','i');
+		$res_insert = db_prep_query($sql,$v,$t);
+		while(db_fetch_row($res_insert)){$exists = true;}
+		if($exists == false){
+			//the given one will be updated
+			$e = new mb_exception("Requested combination user_group_role does not exist in database - update will be performed");
+			//change this role
+			$sql_alterrole = "UPDATE mb_user_mb_group SET mb_user_mb_group_type = $1 WHERE ";
+			$sql_alterrole .= "fkey_mb_user_id = $2 and fkey_mb_group_id = $3 AND mb_user_mb_group_type = $4";
+			$e = new mb_exception("select_row: ".$select_row);
+			$v = array($select_role[0],$remove_user_explode[0],$selected_group,$remove_user_explode[1]);
+			$t = array('i','i','i','i');
+			db_prep_query($sql_alterrole,$v,$t);
+		} else {
+			$e = new mb_exception("Combi user_group_role does already exist in the database - it need not to be added again!");
+		}
+	}
+}
+
+/*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"];
+	$user_email[$cnt_user] = $row["mb_user_email"];	
+	$cnt_user++;
+}
+/*get all roles **********************************************************************************************/
+$sql_role = "SELECT * FROM mb_role ORDER BY role_name";
+$res_role = db_query($sql_role);
+while($row = db_fetch_array($res_role)){
+	$role_id[$cnt_role] = $row["role_id"];
+	$role_name[$cnt_role] =  $row["role_name"];
+	$role_description[$cnt_role] = $row["role_description"];
+	$role_exclude_auth[$cnt_role] = $row["role_exclude_auth"];
+	$cnt_role++;
+}
+/*get all user from selected group******************************************************************************/
+$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, "; $sql_mb_user_mb_group .= "mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id, "; $sql_mb_user_mb_group .= "mb_user_mb_group.mb_user_mb_group_type, "; $sql_mb_user_mb_group .= "mb_user_mb_group.role_exclude_auth ";
+$sql_mb_user_mb_group .= "FROM (select * from mb_user_mb_group left join mb_role on "; $sql_mb_user_mb_group .= "mb_user_mb_group.mb_user_mb_group_type = mb_role.role_id ) as "; $sql_mb_user_mb_group .= "mb_user_mb_group INNER JOIN mb_user ON  ";
+$sql_mb_user_mb_group .= "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= $1 ";
+$sql_mb_user_mb_group .= "ORDER BY mb_user.mb_user_name ";
+
+
+
+/*$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id, mb_user_mb_group.mb_user_mb_group_type 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= $1 ";
+$sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
+*/
+if(!$selected_group){$v = array($group_id[0]);}
+if($selected_group){$v = array($selected_group);}
+$t = array('i');
+
+$res_mb_user_mb_group = db_prep_query($sql_mb_user_mb_group,$v,$t);
+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"];
+	$user_email_group[$cnt_group_user] =  $row["mb_user_email"];
+	$user_group_type_group[$cnt_group_user] =  $row["mb_user_mb_group_type"];
+	$user_role_exclude_auth_group[$cnt_group_user] =  $row["role_exclude_auth"];
+	$cnt_group_user++;
+}
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $self . "' 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>";
+
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all profiles in selectbox*****************************************************************/
+echo "<div class='text2'>USER:</div>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$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'>";
+echo "<input type='hidden' name='alterrole'>";
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),groupuser,this.value);'/>";
+/*insert container_profile_dependence and container_group_dependence in selectbox******************/
+echo "<div class='text3'>SELECTED USER:</div>";
+echo "<select style='background:#ffffff' onchange='validate(\"showrole\")' class='select3' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
+for($i=0; $i<$cnt_group_user; $i++){
+	if ($user_role_exclude_auth_group[$i] == 1) {
+		echo "<option value='".$user_id_group[$i]."+".$user_group_type_group[$i]."' title='".$user_email_group[$i]."' style='background-color: Red;'>" . $user_name_group[$i]  . " - " .$user_group_type_group[$i]. "</option>";
+	} else {
+		echo "<option value='".$user_id_group[$i]."+".$user_group_type_group[$i]."' title='".$user_email_group[$i]."'>" . $user_name_group[$i]  . " - " .$user_group_type_group[$i]. "</option>";
+	}
+}
+echo "</select>";
+echo "<div class='roleHeader'>SELECTED ROLE:</div>";
+echo "<select style='background:#ffffff' onchange='validate(\"changerole\")' class='selectRole' name='select_role[]' id='select_role' size='1' disabled='true'>";
+//echo "<option value='0' title='no role defined'>no special role defined yet!</option>";
+for($i=0; $i<$cnt_role; $i++){
+	echo "<option value='" . $role_id[$i]  . "' title='".$role_id[$i]." - ".$role_description[$i]."'>".$role_id[$i]." - ". $role_name[$i]  . "</option>";
+}
+echo "</select>";
+echo "<table><tr><td bgcolor=\"#FF0000\">Role has no influence on authorization!</td></tr></table>";
+echo "</form>";
+
+?>
+<script type="text/javascript">
+<!--
+document.forms[0].selected_group.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var groupuser=[];
+<?php
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "groupuser[".$i."]=[];\n";
+	echo "groupuser[".$i."]['id']='" . $user_id_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['name']='" . $user_name_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['email']='" . $user_email_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['group_type']='" . $user_group_type_group[$i]  . "';\n";
+}
+?>
+var groupuserrole=[];
+<?php
+for($i=0; $i<$cnt_role; $i++){
+	echo "groupuserrole[".$i."]=[];\n";
+	echo "groupuserrole[".$i."]['id']='" . $role_id[$i]  . "';\n";
+	echo "groupuserrole[".$i."]['name']='" . $role_name[$i]  . "';\n";
+	echo "groupuserrole[".$i."]['description']='" . $role_description[$i]  . "';\n";
+}
+?>
+// -->
+</script>
+</body>
+</html>

Modified: branches/marc_dev/http/php/mod_layerISOMetadata.php
===================================================================
--- branches/marc_dev/http/php/mod_layerISOMetadata.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_layerISOMetadata.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -18,19 +18,20 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-
 require_once(dirname(__FILE__) . "/../../core/globalSettings.php");
 require_once(dirname(__FILE__) . "/../classes/class_connector.php");
+require_once(dirname(__FILE__) . "/../classes/class_administration.php");
 
 $con = db_connect(DBSERVER,OWNER,PW);
 db_select_db(DB,$con);
 
-//define the view or table to use as input for metadata generation
+$admin = new administration();
+
+//define the view or table to use as input for metadata generation if this is wished. If not the data will be directly read from the database tables
 $wmsView = "wms_search_table";
 $wmsView = '';
 //parse request parameter
 //make all parameters available as upper case
-
 foreach($_REQUEST as $key => $val) {
 	$_REQUEST[strtoupper($key)] = $val;
 }
@@ -63,9 +64,9 @@
 	die();
 }
 //some needfull functions to pull metadata out of the database!
-
 function fillISO19139($iso19139, $recordId) {
         global $wmsView;
+	global $admin;
 	//read out relevant information from mapbender database:
 	if ($wmsView != '') {
 		$sql = "SELECT * ";
@@ -74,11 +75,11 @@
 	else {
 	//next function is for normal mapbender installations and read the info directly from the wms and layer tables
 		$sql = "SELECT ";
-		$sql .= "layer.layer_id,layer.layer_name, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, layer.layer_minscale, layer.layer_maxscale, ";
+		$sql .= "layer.layer_id,layer.layer_name, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, layer.layer_minscale, layer.layer_maxscale, layer.uuid,";
 		$sql .= "wms.wms_title, wms.wms_abstract, wms.wms_id, wms.fees, wms.accessconstraints, wms.contactperson, ";
 		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp, wms_owner, ";
 		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, wms.wms_owsproxy,";
-		$sql .= "wms.contactelectronicmailaddress, wms.country , ";
+		$sql .= "wms.contactelectronicmailaddress, wms.country, wms.fkey_mb_group_id, ";
 		$sql .= "layer_epsg.minx || ',' || layer_epsg.miny || ',' || layer_epsg.maxx || ',' || layer_epsg.maxy  as bbox ";
 		$sql .= "FROM wms, layer, layer_epsg WHERE layer_id = $1 and layer.fkey_wms_id = wms.wms_id";
 		$sql .= " and layer_epsg.fkey_layer_id=layer.layer_id and layer_epsg.epsg='EPSG:4326'";
@@ -87,21 +88,34 @@
 	$t = array('i');
 	$res = db_prep_query($sql,$v,$t);
 	$mapbenderMetadata = db_fetch_array($res);
-	//Get other needed information out of mapbender database:
+	
+	//Get other needed information out of mapbender database (if not already defined in the view):
 	//service data
-	$sql = "SELECT contactorganization, contactelectronicmailaddress ";
-	$sql .= "FROM wms WHERE wms_id = $1";
-	$v = array((integer)$mapbenderMetadata['wms_id']);
-	$t = array('i');
-	$res = db_prep_query($sql,$v,$t);
-	$serviceMetadata = db_fetch_array($res);
-	//infos about the registrating department 
-	$sql = "SELECT mb_group_name ";
-	$sql .= "FROM mb_group WHERE mb_group_id = $1";
-	$v = array((integer)$mapbenderMetadata['department']);
-	$t = array('i');
-	$res = db_prep_query($sql,$v,$t);
-	$departmentMetadata = db_fetch_array($res);
+	if ($wmsView != '') {
+		$sql = "SELECT contactorganization, contactelectronicmailaddress ";
+		$sql .= "FROM wms WHERE wms_id = $1";
+		$v = array((integer)$mapbenderMetadata['wms_id']);
+		$t = array('i');
+		$res = db_prep_query($sql,$v,$t);
+		$serviceMetadata = db_fetch_array($res);
+	}
+	//infos about the registrating department, check first if a special metadata point of contact is defined in the service table - function from mod_showMetadata - TODO: should be defined in admin class
+	if (!isset($mapbenderMetadata['fkey_mb_group_id']) or is_null($mapbenderMetadata['fkey_mb_group_id']) or $mapbenderMetadata['fkey_mb_group_id'] == 0){
+		$e = new mb_exception("mod_layerISOMetadata.php: fkey_mb_group_id not found!");
+		//Get information about owning user of the relation mb_user_mb_group - alternatively the defined fkey_mb_group_id from the service must be used!
+		$sqlDep = "SELECT mb_group_name, mb_group_title, mb_group_id, mb_group_logo_path, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
+		$vDep = array($mapbenderMetadata['wms_owner']);
+		$tDep = array('i');
+		$resDep = db_prep_query($sqlDep, $vDep, $tDep);
+		$departmentMetadata = db_fetch_array($resDep);
+	} else {
+		$e = new mb_exception("mod_layerISOMetadata.php: fkey_mb_group_id found!");
+		$sqlDep = "SELECT mb_group_name , mb_group_title, mb_group_id, mb_group_logo_path , mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
+		$vDep = array($mapbenderMetadata['fkey_mb_group_id']);
+		$tDep = array('i');
+		$resDep = db_prep_query($sqlDep, $vDep, $tDep);
+		$departmentMetadata = db_fetch_array($resDep);
+	}
 	//infos about the owner of the service - he is the man who administrate the metadata - register the service
 	$sql = "SELECT mb_user_email ";
 	$sql .= "FROM mb_user WHERE mb_user_id = $1";
@@ -110,7 +124,7 @@
 	$res = db_prep_query($sql,$v,$t);
 	$userMetadata = db_fetch_array($res);
 	//check if resource is freely available to anonymous user - which are all users who search thru metadata catalogues:
-	$hasPermission=getLayerPermission($mapbenderMetadata['wms_id'],$mapbenderMetadata['layer_id'],ANONYMOUS_USER);
+	$hasPermission=$admin->getLayerPermission($mapbenderMetadata['wms_id'],$mapbenderMetadata['layer_name'],ANONYMOUS_USER);
 	//Creating the "MD_Metadata" node
 	$MD_Metadata = $iso19139->createElementNS('http://www.isotc211.org/2005/gmd', 'gmd:MD_Metadata');
 	//$MD_Metadata=$iso19139->registerNamespace('srv','http://www.iso211.org/2005/srv');
@@ -125,8 +139,8 @@
 	//generate identifier part 
 	$identifier = $iso19139->createElement("gmd:fileIdentifier");
 	$identifierString = $iso19139->createElement("gco:CharacterString");
-	if (isset($mapbenderMetadata['layer_id'])) {
-		$identifierText = $iso19139->createTextNode($mapbenderMetadata['layer_id']);//TODO: generate an uuid?
+	if (isset($mapbenderMetadata['uuid'])) {
+		$identifierText = $iso19139->createTextNode($mapbenderMetadata['uuid']);//TODO: generate an uuid?
 	}
 	else {
 		$identifierText = $iso19139->createTextNode("no id found");
@@ -357,7 +371,7 @@
 	$abstract_cs->appendChild($abstractText);
 	$abstract->appendChild($abstract_cs);
 	$SV_ServiceIdentification->appendChild($abstract);
-	#Create part for point of contact
+	#Create part for point of contact for service identification
 	#Define relevant objects
 	$pointOfContact=$iso19139->createElement("gmd:pointOfContact");
 	$CI_ResponsibleParty=$iso19139->createElement("gmd:CI_ResponsibleParty");
@@ -373,14 +387,14 @@
 	$CI_RoleCode=$iso19139->createElement("gmd:CI_RoleCode");
 	$CI_RoleCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_RoleCode");
 	$CI_RoleCode->setAttribute("codeListValue", "publisher");
-	if (isset($serviceMetadata['contactorganization'])) {
-		$resOrgaText = $iso19139->createTextNode($serviceMetadata['contactorganization']);
+	if (isset($mapbenderMetadata['contactorganization'])) {
+		$resOrgaText = $iso19139->createTextNode($mapbenderMetadata['contactorganization']);
 	}
 	else {
 		$resOrgaText= $iso19139->createTextNode("not yet defined");
 	}
-	if (isset($serviceMetadata['contactelectronicmailaddress'])) {
-		$resMailText = $iso19139->createTextNode($serviceMetadata['contactelectronicmailaddress']);
+	if (isset($mapbenderMetadata['contactelectronicmailaddress'])) {
+		$resMailText = $iso19139->createTextNode($mapbenderMetadata['contactelectronicmailaddress']);
 	}
 	else {
 		$resMailText = $iso19139->createTextNode("kontakt at geoportal.rlp.de");
@@ -422,12 +436,12 @@
 	}
 */	
 	#version of bavaria
-	if (isset($row['layer_map_preview_filename']) & $row['layer_map_preview_filename'] != '') {
+	if (file_exists(PREVIEW_DIR."/".$mapbenderMetadata['layer_id']."_layer_map_preview.jpg")) {	//TODO
 		$graphicOverview=$iso19139->createElement("gmd:graphicOverview");
 		$MD_BrowseGraphic=$iso19139->createElement("gmd:MD_BrowseGraphic");
 		$fileName=$iso19139->createElement("gmd:fileName");
 		$fileName_cs=$iso19139->createElement("gco:CharacterString");
-		$previewFilenameText = $iso19139->createTextNode("http://www.gdi-rp-dienste3.rlp.de/mapbender/geoportal/preview/".$row['layer_map_preview_filename']);
+		$previewFilenameText = $iso19139->createTextNode("http://www.geoportal.rlp.de/mapbender/geoportal/preview/".$mapbenderMetadata['layer_id']."_layer_map_preview.jpg");
 		$fileName_cs->appendChild($previewFilenameText);
 		$fileName->appendChild($fileName_cs);
 
@@ -441,7 +455,7 @@
 
 		$fileType=$iso19139->createElement("gmd:fileType");
 		$fileType_cs=$iso19139->createElement("gco:CharacterString");
-		$fileType_text=$iso19139->createTextNode("PNG");
+		$fileType_text=$iso19139->createTextNode("JPEG");
 
 		$fileType_cs->appendChild($fileType_text);
 		$fileType->appendChild($fileType_cs);
@@ -582,7 +596,7 @@
 		#$language->appendChild($LanguageCode);
 		#$SV_ServiceIdentification->appendChild($language);
 	#}
-	#Topic Category B 2.1
+	#Topic Category B 2.1 - not needed for services
 	#if(isset($detail_array['t011_obj_geo_topic_cat.topic_category'])){
 		#$topicCategory=$iso19139->createElement("gmd:topicCategory");
 		#$MD_TopicCategoryCode=$iso19139->createElement("gmd:MD_TopicCategoryCode");
@@ -896,88 +910,6 @@
 		die();
 	}
 
-	function user_authorization($wms_id,$layer_name,$user_id){
-		$n = new administration();
-		$this->n = $n; 
-		$permission=$this->n->getLayerPermission($wms_id, $layer_name, $user_id);
-		return $permission;
-	}
-
-//functions necessary to decide if service url should be displayed
-	function getLayerPermission($wms_id, $layer_id, $user_id){
-		//$layer_id = $this->getLayerIdByLayerName($wms_id,$layer_name);
-		$array_guis = getGuisByPermission($user_id,true);
-		$v = array();
-		$t = array();
-		$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id IN (";
-		$c = 1;
-		//generate guilist assigned to specific user
-		for($i=0; $i<count($array_guis); $i++){
-			if($i>0){ $sql .= ",";}
-			$sql .= "$".$c;
-			$c++;
-			array_push($v, $array_guis[$i]);
-			array_push($t, 's');
-		}
-		$sql .= ") AND fkey_layer_id = $".$c." AND gui_layer_status = 1"; //Status must be 1
-		array_push($v,$layer_id);
-		array_push($t,'i');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			return true;
-		}
-		else{
-			return false;
-		}
-	}
-	function getGuisByPermission($mb_user_id,$ignoreublic){
-		$arrayGuis = array();
-		$mb_user_groups = array();
-		$sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 ";
-		$v = array($mb_user_id);
-		$t = array("i");
-		$res_groups = db_prep_query($sql_groups,$v,$t);
-		$cnt_groups = 0;
-		while($row = db_fetch_array($res_groups)){
-			$mb_user_groups[$cnt_groups] = $row["fkey_mb_group_id"];
-			$cnt_groups++;
-		}
-		if($cnt_groups > 0){
-			$v = array();
-			$t = array();
-			$sql_g = "SELECT 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 .= "$".strval($i+1);
-				array_push($v,$mb_user_groups[$i]);
-				array_push($t,"i");
-			}
-			$sql_g .= ") GROUP BY gui.gui_id";
-			$res_g = db_prep_query($sql_g,$v,$t);
-			while($row = db_fetch_array($res_g)){
-				array_push($arrayGuis,$row["gui_id"]);
-			}
-		}
-		$sql_guis = "SELECT gui.gui_id FROM gui JOIN gui_mb_user ON gui.gui_id = gui_mb_user.fkey_gui_id";
-		$sql_guis .= " WHERE (gui_mb_user.fkey_mb_user_id = $1) ";
-		if (!isset($ignore_public) OR $ignore_public== false){
-			$sql_guis .= " AND gui.gui_public = 1 ";
-		}
-		$sql_guis .= " GROUP BY gui.gui_id";
-		$v = array($mb_user_id);
-		$t = array("i");
-		$res_guis = db_prep_query($sql_guis,$v,$t);
-		$guis = array();
-		while($row = db_fetch_array($res_guis)){
-			if(!in_array($row['gui_id'],$arrayGuis)){
-				array_push($arrayGuis,$row["gui_id"]);
-			}
-		}
-		return $arrayGuis;
-	}
-
-
 function getEpsgByLayerId ($layer_id) { // from merge_layer.php
 	$epsg_list = "";
 	$sql = "SELECT DISTINCT epsg FROM layer_epsg WHERE fkey_layer_id = $1";

Modified: branches/marc_dev/http/php/mod_savewmc_server.php
===================================================================
--- branches/marc_dev/http/php/mod_savewmc_server.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_savewmc_server.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -134,7 +134,7 @@
 
 	if ($result["success"]) {
 		$ajaxResponse->setSuccess(true);
-		$ajaxResponse->setMessage(_mb("WMC %s has been saved.", "'" . $attributes->title . "'"));
+		$ajaxResponse->setMessage(_mb("WMC")." ".$attributes->title." "._mb("has been saved."));
 	} else {
 		$ajaxResponse->setSuccess($result["success"]);
 		$ajaxResponse->setMessage($result["message"]);

Modified: branches/marc_dev/http/php/mod_showMetadata.php
===================================================================
--- branches/marc_dev/http/php/mod_showMetadata.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_showMetadata.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -134,8 +134,8 @@
 		$translation['layer'] = 'Kartenebene';
 		$translation['featuretype'] = 'Objektart';
 		$translation['geomtype'] = 'Geometrietyp';
-		$translation['contentId'] = 'Resourcenidentifikator';
-		$translation['contentName'] = 'Name der Ressouce';
+		$translation['contentId'] = 'Ressourcenidentifikator';
+		$translation['contentName'] = 'Name der Ressource';
 		$translation['serviceId'] = 'Informationen zum Dienst';
 		$translation['preview'] = 'Voransicht';
 		$translation['extent'] = 'Ausdehnung';
@@ -179,7 +179,7 @@
 		$translation['statusProblem'] = 'Problem bei letzter Kontrolle';
 		$translation['contactTelephone'] = 'Telefon';
 		$translation['wmc'] = 'Web Map Context Dokument';
-		$translation['graphicUnavailable'] = 'Grahische Übersicht nicht aktiviert';
+		$translation['graphicUnavailable'] = 'Graphische Übersicht nicht aktiviert';
 		$translation['notMonitored'] = 'Informationen über die Qualität sind nur verfügbar, wenn das Service Monitoring aktiv ist!';
 		$translation['wmcQualityText'] = 'Für Web Map Context Dokumente entfällt die Angabe zur Qualität!';
 		$translation['noTouInformation'] = 'Es sind keine Informationen über Nutzungsbedingungen verfügbar!';
@@ -454,19 +454,19 @@
 
 
 //$e = new mb_exception("mod_showMetadata: fkey_mb_group_id from wms or wfs table: ".$resourceMetadata['fkey_mb_group_id']);
-if (!isset($resourceMetadata['fkey_mb_group_id']) or isnull($resourceMetadata['fkey_mb_group_id'])){
+if (!isset($resourceMetadata['fkey_mb_group_id']) or is_null($resourceMetadata['fkey_mb_group_id']) or $resourceMetadata['fkey_mb_group_id'] == 0){
 	$e = new mb_notice("mod_showMetadata: fkey_mb_group_id not found!");
 	//Get information about owning user of the relation mb_user_mb_group - alternatively the defined fkey_mb_group_id from the service must be used!
-	$sqlDep = "SELECT mb_group_name as metdatapointofcontactorgname, mb_group_title as metdatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metdatapointofcontactorglogo, mb_group_address as metdatapointofcontactorgaddress, mb_group_email as metdatapointofcontactorgemail, mb_group_postcode as metdatapointofcontactorgpostcode, mb_group_city as metdatapointofcontactorgcity, mb_group_voicetelephone as metdatapointofcontactorgtelephone, mb_group_facsimiletelephone as metdatapointofcontactorgfax FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND b.mb_user_department = a.mb_group_description LIMIT 1";
+	$sqlDep = "SELECT mb_group_name as metadatapointofcontactorgname, mb_group_title as metadatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metadatapointofcontactorglogo, mb_group_address as metadatapointofcontactorgaddress, mb_group_email as metadatapointofcontactorgemail, mb_group_postcode as metadatapointofcontactorgpostcode, mb_group_city as metadatapointofcontactorgcity, mb_group_voicetelephone as metadatapointofcontactorgtelephone, mb_group_facsimiletelephone as metadatapointofcontactorgfax FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
 	$vDep = array($resourceMetadata['owner']);
 	$tDep = array('i');
 	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
 	$metadataContactGroup = db_fetch_array($resDep);
 	$e = new mb_notice("mod_showMetadata: mb_group_id: ".$metadataContactGroup['mb_group_id']);
-	$e = new mb_notice("mod_showMetadata: mb_group_logo_path: ".$metadataContactGroup['metdatapointofcontactorglogo']);
+	$e = new mb_notice("mod_showMetadata: mb_group_logo_path: ".$metadataContactGroup['metadatapointofcontactorglogo']);
 } else {
 	$e = new mb_notice("mod_showMetadata: fkey_mb_group_id found!");
-	$sqlDep = "SELECT mb_group_name as metdatapointofcontactorgname, mb_group_title as metdatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metdatapointofcontactorglogo, mb_group_address as metdatapointofcontactorgaddress, mb_group_email as metdatapointofcontactorgemail, mb_group_postcode as metdatapointofcontactorgpostcode, mb_group_city as metdatapointofcontactorgcity, mb_group_voicetelephone as metdatapointofcontactorgtelephone, mb_group_facsimiletelephone as metdatapointofcontactorgfax FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
+	$sqlDep = "SELECT mb_group_name as metadatapointofcontactorgname, mb_group_title as metadatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metadatapointofcontactorglogo, mb_group_address as metadatapointofcontactorgaddress, mb_group_email as metadatapointofcontactorgemail, mb_group_postcode as metadatapointofcontactorgpostcode, mb_group_city as metadatapointofcontactorgcity, mb_group_voicetelephone as metadatapointofcontactorgtelephone, mb_group_facsimiletelephone as metadatapointofcontactorgfax FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
 	$vDep = array($resourceMetadata['fkey_mb_group_id']);
 	$tDep = array('i');
 	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
@@ -487,18 +487,18 @@
 $e = new mb_notice("mod_showMetadata: mb_group_name: ".$metadataContactGroup['mb_group_name']);
 //db select for layer previews
 if ($resource == 'wms' or $resource == 'layer') {
-	$sqlP = "SELECT * FROM layer_preview WHERE fkey_layer_id = $1 LIMIT 1";
-	$vP = array($layerId);
-	$tP = array('i');
-	$resP = db_prep_query($sqlP, $vP, $tP);
-	$rowP = db_fetch_array($resP);
-	if ($rowP['layer_map_preview_filename'] != "") {
+	//$sqlP = "SELECT * FROM layer_preview WHERE fkey_layer_id = $1 LIMIT 1";
+	//$vP = array($layerId);
+	//$tP = array('i');
+	//$resP = db_prep_query($sqlP, $vP, $tP);
+	//$rowP = db_fetch_array($resP);
+	//if ($rowP['layer_map_preview_filename'] != "") {
 		$resourceMetadata['preview'] = "<img src = '../geoportal/mod_showPreview.php?resource=layer&id=".$layerId."'>";
 
-	}
-	if ($rowP['layer_legend_preview_filename'] != "") {
+	//}
+	//if ($rowP['layer_legend_preview_filename'] != "") {
 		$resourceMetadata['legend'] .= "<img src = '../geoportal/mod_showPreview.php?resource=layerlegend&id=".$layerId."'>";
-	}
+	//}
 /*	if ($rowP['layer_extent_preview_filename'] != "") {
 		$resourceMetadata['extent'] .= "<img src = '../geoportal/layer_preview/".$rowP['layer_extent_preview_filename']."'>";
 	}*/
@@ -572,8 +572,8 @@
 	$html .= '<script type="text/javascript" src="../extensions/jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js"></script>';
 
 
-/*if ($metadataContactGroup['metdatapointofcontactorglogo'] != '') {
-	$html .= "<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>";
+/*if ($metadataContactGroup['metadatapointofcontactorglogo'] != '') {
+	$html .= "<img src='".$metadataContactGroup['metadatapointofcontactorglogo']."'  height='30'>";
 }
 //TODO use right name
 $html .= displayText($resourceMetadata['contactorganization']);
@@ -692,8 +692,8 @@
 
 
 
-if ($metadataContactGroup['metdatapointofcontactorglogo'] != '') {
-	$html .= $t_a.$translation['contactOrganization'].$t_b."<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>";
+if ($metadataContactGroup['metadatapointofcontactorglogo'] != '') {
+	$html .= $t_a.$translation['contactOrganization'].$t_b."<img src='".$metadataContactGroup['metadatapointofcontactorglogo']."'  height='30'>";
 }
 $html .= displayText($metadataContactGroup['metadatacontactorganization']).$t_c;
 if ($resourceMetadata['contentabstract'] != '') {
@@ -868,13 +868,13 @@
 $html .= '<h4>'.$translation['metadataProvider'].'</h4>';
 
 $html .= $tableBegin;
-if ($metadataContactGroup['metdatapointofcontactorglogo'] != '') {
-	$html .= $t_a.$translation['logo'].$t_b."<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>".$t_c;
+if ($metadataContactGroup['metadatapointofcontactorglogo'] != '') {
+	$html .= $t_a.$translation['logo'].$t_b."<img src='".$metadataContactGroup['metadatapointofcontactorglogo']."'  height='30'>".$t_c;
 }
-$html .= $t_a.$translation['contactOrganization'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgtitle']).$t_c;
-$html .= $t_a.$translation['contactAddress'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgaddress']).$t_c;
-$html .= $t_a.$translation['city'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgpostcode'].' '.$metadataContactGroup['metdatapointofcontactorgcity']).$t_c;
-$html .= $t_a.$translation['email'].$t_b.displayText($metadataContactGroup['metdatapointofcontactorgemail']).$t_c;
+$html .= $t_a.$translation['contactOrganization'].$t_b.displayText($metadataContactGroup['metadatapointofcontactorgtitle']).$t_c;
+$html .= $t_a.$translation['contactAddress'].$t_b.displayText($metadataContactGroup['metadatapointofcontactorgaddress']).$t_c;
+$html .= $t_a.$translation['city'].$t_b.displayText($metadataContactGroup['metadatapointofcontactorgpostcode'].' '.$metadataContactGroup['metadatapointofcontactorgcity']).$t_c;
+$html .= $t_a.$translation['email'].$t_b.displayText($metadataContactGroup['metadatapointofcontactorgemail']).$t_c;
 $html .= $tableEnd;
 
 $html .= '<h4>'.$translation['serviceProvider'].'</h4>';

Modified: branches/marc_dev/http/php/mod_user_filteredGroup.php
===================================================================
--- branches/marc_dev/http/php/mod_user_filteredGroup.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_user_filteredGroup.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -139,7 +139,7 @@
 	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 = $1 and fkey_mb_group_id = $2 ";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($selected_user,$selected_group[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -156,7 +156,7 @@
 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 = $1 and fkey_mb_user_id = $2";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_group[$i],$selected_user);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -190,7 +190,7 @@
 $t = array();
 $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 = $1 ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id = $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL)";
 if(!$selected_user){array_push($v,$user_id[0]);}
 if($selected_user){array_push($v,$selected_user);}
 array_push($t,'i');
@@ -266,4 +266,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_user_group.php
===================================================================
--- branches/marc_dev/http/php/mod_user_group.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_user_group.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -136,7 +136,7 @@
 	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 = $1 and fkey_mb_group_id = $2 ";
+			$sql_insert = "SELECT * from mb_user_mb_group where fkey_mb_user_id = $1 and fkey_mb_group_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($selected_user,$selected_group[$i]);
 			$t = array('i','i');
 			$res_insert = db_prep_query($sql_insert,$v,$t);
@@ -153,7 +153,7 @@
 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 = $1 and fkey_mb_user_id = $2";
+			$sql_remove = "DELETE FROM mb_user_mb_group WHERE fkey_mb_group_id = $1 and fkey_mb_user_id = $2 AND (mb_user_mb_group_type = 1 or mb_user_mb_group_type IS NULL)";
 			$v = array($remove_group[$i],$selected_user);
 			$t = array('i','i');
 			db_prep_query($sql_remove,$v,$t);
@@ -183,7 +183,7 @@
 /*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 = $1 ";
+$sql_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_user_id = $1 AND (mb_user_mb_group.mb_user_mb_group_type = 1 or mb_user_mb_group.mb_user_mb_group_type IS NULL)";
 $sql_user_mb_group .= " ORDER BY mb_group.mb_group_name";
 
 if(!$selected_user){$v = array($user_id[0]);}
@@ -258,4 +258,4 @@
 // -->
 </script>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/marc_dev/http/php/mod_wmc2ol.php
===================================================================
--- branches/marc_dev/http/php/mod_wmc2ol.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/mod_wmc2ol.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -16,9 +16,12 @@
 #http://www.geoportal.rlp.de/mapbender/php/mod_wmc2ol.php?wmc_id=45_1291218568&GEORSS=1&LayerSwitcher=1
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+require_once(dirname(__FILE__)."/../classes/class_user.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
 
-$userId = Mapbender::session()->get("mb_user_id");
-
+$user = new User();
+$admin = new administration();
+$userId = $user->id;
 //check for parameter wmc_id
 if(!isset($_GET["wmc_id"])){
 	echo 'Error: wmc_id not requested<br>';
@@ -93,102 +96,44 @@
 	$testMatch = NULL;
 }
 
-
-
-
-
-
-//the next functions should come from class administration, but they are not included as they are needed
-//TODO
-function getLayerPermission($wms_id, $layer_id, $user_id){
-		//$layer_id = $this->getLayerIdByLayerName($wms_id,$layer_name);
-		$array_guis = getGuisByPermission($user_id,true);
-		$v = array();
-		$t = array();
-		$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id IN (";
-		$c = 1;
-		//generate guilist assigned to specific user
-		for($i=0; $i<count($array_guis); $i++){
-			if($i>0){ $sql .= ",";}
-			$sql .= "$".$c;
-			$c++;
-			array_push($v, $array_guis[$i]);
-			array_push($t, 's');
-		}
-		$sql .= ") AND fkey_layer_id = $".$c." AND gui_layer_status = 1"; //status 1 must be
-		array_push($v,$layer_id);
-		array_push($t,'i');
-		$res = db_prep_query($sql,$v,$t);
-		if($row = db_fetch_array($res)){
-			return true;
-		}
-		else{
-			return false;
-		}
-	}
-function getGuisByPermission($mb_user_id,$ignoreublic){
-	$arrayGuis = array();
-	$mb_user_groups = array();
-	$sql_groups = "SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 ";
-	$v = array($mb_user_id);
+//**************************************************************************
+//functions which may be integrated from class_administration
+function getWmsGetMapUrl($wmsId){
+	$sql = "SELECT wms_getmap FROM wms WHERE wms_id =$1";
+	$v = array($wmsId);
 	$t = array("i");
-	$res_groups = db_prep_query($sql_groups,$v,$t);
-	$cnt_groups = 0;
-	while($row = db_fetch_array($res_groups)){
-		$mb_user_groups[$cnt_groups] = $row["fkey_mb_group_id"];
-		$cnt_groups++;
+	$res = db_prep_query($sql,$v,$t);
+	if ($row = db_fetch_array($res)){
+		return $row['wms_getmap'];
+	} else {
+		return false;
 	}
-	if($cnt_groups > 0){
-		$v = array();
-		$t = array();
-		$sql_g = "SELECT 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 .= "$".strval($i+1);
-			array_push($v,$mb_user_groups[$i]);
-			array_push($t,"i");
-		}
-		$sql_g .= ") GROUP BY gui.gui_id";
-		$res_g = db_prep_query($sql_g,$v,$t);
-		while($row = db_fetch_array($res_g)){
-			array_push($arrayGuis,$row["gui_id"]);
-		}
-	}
-	$sql_guis = "SELECT gui.gui_id FROM gui JOIN gui_mb_user ON gui.gui_id = gui_mb_user.fkey_gui_id";
-	$sql_guis .= " WHERE (gui_mb_user.fkey_mb_user_id = $1) ";
-	if (!isset($ignore_public) OR $ignore_public== false){
-		$sql_guis .= " AND gui.gui_public = 1 ";
-	}
-	$sql_guis .= " GROUP BY gui.gui_id";
-	$v = array($mb_user_id);
-	$t = array("i");
-	$res_guis = db_prep_query($sql_guis,$v,$t);
-	$guis = array();
-	while($row = db_fetch_array($res_guis)){
-		if(!in_array($row['gui_id'],$arrayGuis)){
-			array_push($arrayGuis,$row["gui_id"]);
-		}
-	}
-	return $arrayGuis;
 }
-//end of functions which m,ay be included from class_administration in next versions
-#**************************************************************************
+//end of functions which may be included from class_administration in next versions
+//**************************************************************************
 //Function to create an OpenLayers Javascript from a mapbender wmc document
 function createOlFromWMC_id($wmc_id, $pointRadius, $fillColor){
+	//$myWmc = new wmc();
+	global $user;
 	global $userId;
+	global $admin;
 	//Get WMC out of mb Database
-	$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_serial_id = $1";
+	$sql = "SELECT wmc, wmc_serial_id FROM mb_user_wmc WHERE wmc_serial_id = $1";
 	$res = db_prep_query($sql, array($wmc_id), array("s"));
 	$wmc = db_fetch_row($res);
 	//control if wmc was found else use old wmc_id
 	if (!$wmc[0]) {
-		$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_id = $1";
+		$sql = "SELECT wmc, wmc_serial_id FROM mb_user_wmc WHERE wmc_id = $1";
 		$res = db_prep_query($sql, array($wmc_id), array("s"));
 		$wmc = db_fetch_row($res);
 		//echo "Wmc with this id was not found in Database!<br>";
 		//die;
 	}
+	//generate wmc object and update urls of services in this object:
+	$wmcId = $wmc[1];
+	//$myWmc->createFromDb($wmcId);
+	//$updatedWmc = $myWmc->updateUrlsFromDb();//TODO: check why this functions need a session??
+	
 	//Read out WMC into XML object
 	$xml=simplexml_load_string($wmc[0], "SimpleXMLElement", LIBXML_NOBLANKS);
 	if ($_REQUEST['withoutBody'] == '1') { 
@@ -231,12 +176,12 @@
 	if(isset($_REQUEST["withDigitize"]) or isset($_REQUEST["GEORSS"])){
 		if(($_REQUEST["withDigitize"]=='1') or ($_REQUEST["GEORSS"]!='')){
 			#$html.="<script src='http://".$_SERVER['HTTP_HOST']."/mapbender/extensions/OpenLayers-2.8/OpenLayers.js'></script>\n";
-			$html.="<script src='../extensions/OpenLayers-2.8/OpenLayers.js'></script>\n";
+			$html.="<script src='../extensions/OpenLayers-2.9.1/OpenLayers.js'></script>\n";
 		}
 	} else {
 		//use the minimized version
 		//$html.="<script src='../../openlayers/build/geoportal_ol_geoportal.js'></script>\n";
-		$html.="<script src='../extensions/OpenLayers-2.8/OpenLayers.js'></script>\n"; //TODO minimize this or use other lib
+		$html.="<script src='../extensions/OpenLayers-2.9.1/OpenLayers.js'></script>\n"; //TODO minimize this or use other lib
 	}
 	//begin part for javascript code
 	$html.="<script type='text/javascript'>\n";
@@ -258,11 +203,13 @@
 	$someLayerQueryable=false;
 	for ($i=0; $i<count($layer_array); $i++) {
 		$html.="var layer".$i.";\n";
-		$mb_extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org');
+		$mb_extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org/context');
 		$layer_array_queryable[$i]=$mb_extensions->querylayer;
-		if (($layer_array_queryable[$i]=='1') and ($xml->LayerList->Layer[$i]->attributes()->hidden=='0')){
+		if (($layer_array_queryable[$i]=='1') and ($xml->LayerList->Layer[$i]->attributes()->hidden=='0') and ($mb_extensions->layer_parent!='')){
 			$someLayerQueryable=true;
-		}	
+		} else {
+			$layer_array_queryable[$i]=0;
+		}
 	}
 	//define special BBOX
 	$out_box=0.3;
@@ -372,15 +319,28 @@
 	$html.="	var bounds = new OpenLayers.Bounds(".$minx.",".$miny.",".$maxx.",".$maxy.");\n";
 	//if some layer defined, create base layer -> first layer in the wmc document
 	if (count($layer_array) != 0){
-		$i=0;
+		//get layer id for the base layer - this should be the first layer which is not hidden - in the wmc this should be visible (active)!!
+		//first get this id:
+		for ($i=0; $i<count($layer_array); $i++) {
+			if ($xml->LayerList->Layer[$i]->attributes()->hidden=='0'){ 
+				$firstLayerId = $i;
+				break;
+			}
+		}
+		$i = $firstLayerId;
 		$html.="	layer0 = new OpenLayers.Layer.WMS( \"".$xml->LayerList->Layer[$i]->Title."\",\n";
-		$extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org');
+		$extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org/context');
 		$layer_id=dom_import_simplexml($extensions->layer_id)->nodeValue;
-		$wms_id=$extensions->wms_id;
-		$has_permission=getLayerPermission($wms_id,$layer_id,$userId);//problem: guest user must have fix id
-		//echo $layer_id."<br>";
+		$layer_name=$xml->LayerList->Layer[$i]->Name;
+		$wms_id=dom_import_simplexml($extensions->wms_id)->nodeValue;
+		$has_permission=$admin->getLayerPermission($wms_id, $layer_name, $userId);
 		if ($has_permission || $layer_id==''){
-			$html.="		\"".$xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href."\",\n";
+			$getMapUrl = $xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href;
+			if (getWmsGetMapUrl($wms_id) != false) {
+				$e = new mb_notice("mod_wmc2ol.php: update GetMap found in database - change url to :".$getMapUrl);
+				$getMapUrl = getWmsGetMapUrl($wms_id);
+			}
+			$html.="		\"".$getMapUrl."\",\n";
 			$html.="		{\n";
 			$html.="		layers: \"".$xml->LayerList->Layer[$i]->Name."\",\n";
 			//get FormatList and the current active format -> TODO: make a function for getting actual format for request
@@ -403,7 +363,7 @@
 			$html.="		numZoomLevels: ".$numberZoomLevels.",\n";
 			$minScale=dom_import_simplexml($extensions->gui_minscale)->nodeValue;
 			$maxScale=dom_import_simplexml($extensions->gui_maxscale)->nodeValue;
-			$maxScale=$extensions->guiScaleHint->attributes()->max;
+			$maxScale=$extensions->guiScaleHint->attributes()->max;//this set the maxscale to unknown - for the baselayer
 			if (!$maxScale){
 				$maxScale='10000000';
 			}
@@ -421,17 +381,24 @@
 		}
 	}
 	//create the overlay layers for which the user guest has permissions
-	for ($i=1; $i<count($layer_array); $i++) {
-		$extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org');
+	$startLayerId = $firstLayerId+1;
+	for ($i=$startLayerId; $i<count($layer_array); $i++) {
+		$extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org/context');
 		#$layer_id=$extensions->layer_id;
 		$wms_id=$extensions->wms_id;
 		$layer_id=dom_import_simplexml($extensions->layer_id)->nodeValue;
-
-		$has_permission=getLayerPermission($wms_id,$layer_id,$userId);//problem: guest user must have fix id TODO
-		if (($xml->LayerList->Layer[$i]->attributes()->hidden=='0' && $has_permission) ||
+		$layer_name=$xml->LayerList->Layer[$i]->Name;
+		$wms_id=dom_import_simplexml($extensions->wms_id)->nodeValue;
+		$has_permission=$admin->getLayerPermission($wms_id, $layer_name, $userId);
+		if (($xml->LayerList->Layer[$i]->attributes()->hidden=='0' && $has_permission && $extensions->layer_parent != '') ||
 			($layer_id=='' && $xml->LayerList->Layer[$i]->attributes()->hidden=='0')){
 			$html.="	layer".$i." = new OpenLayers.Layer.WMS( \"".$xml->LayerList->Layer[$i]->Title."\",\n";
-			$html.="		\"".$xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href."\",\n";
+			$getMapUrl = $xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href;
+			if (getWmsGetMapUrl($wms_id) != false) {
+				$e = new mb_notice("mod_wmc2ol.php: update GetMap found in database - change url to :".$getMapUrl);
+				$getMapUrl = getWmsGetMapUrl($wms_id);
+			}
+			$html.="		\"".$getMapUrl."\",\n";
 			$html.="		{\n";
 			$html.="		layers: \"".$xml->LayerList->Layer[$i]->Name."\",\n";
 			//Get FormatList and the current active format
@@ -452,7 +419,7 @@
 			$html.="		units: \"m\",\n"; 
 			$html.="		singleTile: true,\n";
 			$html.="		numZoomLevels: ".$numberZoomLevels.",\n";
-			//$extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org');
+			//$extensions=$xml->LayerList->Layer[$i]->Extension->children('http://www.mapbender.org/context');
 			$minScale=dom_import_simplexml($extensions->gui_minscale)->nodeValue;
 			$maxScale=dom_import_simplexml($extensions->gui_maxscale)->nodeValue;
 			if (!$maxScale){
@@ -578,7 +545,7 @@
 	//end of click function for digitizing	
 
 	$html.="}\n";//End of central function initGeoportal()
-
+//\"<div class='georsstitle'>\" + feature.attributes['title'] +\"</div><br/>\"+\"<div class='georssdescription'>\" +feature.attributes['description']+\"</div><br/><div class='georsslink'><a href='\"+feature.attributes['link']+\"' target='_blank'>Weitere Informationen</a></div>\",
 	//functions only needed, if georss objects are given - for generating popups - after initGeoportal()!
 	if(isset($_REQUEST["GEORSS"])){
 		if($_REQUEST["GEORSS"]!=''){	
@@ -591,7 +558,7 @@
 			$html.="	popup = new OpenLayers.Popup.FramedCloud(\"chicken\", \n";
 			$html.="	feature.geometry.getBounds().getCenterLonLat(),
 					null,
-					\"<div class='georsstitle'>\" + feature.attributes['title'] +\"</div><br/>\"+\"<div class='georssdescription'>\" +feature.attributes['description']+\"</div><br/><div class='georsslink'><a href='\"+feature.attributes['link']+\"' target='_blank'>Weitere Informationen</a></div>\",
+					'<div class=\"georsstitle\">' + feature.attributes['title'] +'</div><br/>'+'<div class=\"georssdescription\">' +feature.attributes['description']+'</div><br/><div class=\"georsslink\"><a href=\"'+feature.attributes['link']+'\" target=\"_blank\">Weitere Informationen</a></div>',
 					null, true, onPopupClose);\n";
 			$html.="	feature.popup = popup;\n";
 			$html.="	map.addPopup(popup);\n";

Modified: branches/marc_dev/http/php/tagCloud.php
===================================================================
--- branches/marc_dev/http/php/tagCloud.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/php/tagCloud.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -69,7 +69,7 @@
 	$testMatch = NULL;
 }
 
-//
+/*
 if (isset($_REQUEST["hostName"]) & $_REQUEST["hostName"] != "") {
 	//validate to some hosts
 	$testMatch = $_REQUEST["hostName"];	
@@ -80,10 +80,23 @@
 	$hostName = $testMatch;
 	$testMatch = NULL;
 }
+*/
+if (isset($_REQUEST["hostName"]) & $_REQUEST["hostName"] != "") {
+	//validate to some hosts
+	$testMatch = $_REQUEST["hostName"];	
+	//look for whitelist in mapbender.conf
+	$HOSTNAME_WHITELIST_array = explode(",",HOSTNAME_WHITELIST);
+	if (!in_array($testMatch,$HOSTNAME_WHITELIST_array)) {
+		echo "Requested hostname <b>".$testMatch."</b> not whitelist! Please control your mapbender.conf.";
+		$e = new mb_notice("Whitelist: ".HOSTNAME_WHITELIST);
+		$e = new mb_notice($testMatch." not found in whitelist!");
+		die(); 	
+	}
+	$hostName = $testMatch;
+	$testMatch = NULL;
+}
 
 
-
-
 if ($outputFormat == 'json'){
 	$classJSON = new Mapbender_JSON;
 }

Modified: branches/marc_dev/http/plugins/mb_metadata_edit.js
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_edit.js	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_edit.js	2011-03-28 19:16:52 UTC (rev 7722)
@@ -83,6 +83,29 @@
 		req.send();		
 	};
 
+	this.fillMdContact = function(obj) {
+		// get mdContact from server per fkey_mb_group_id
+		var req = new Mapbender.Ajax.Request({
+			url: "../plugins/mb_metadata_server.php",
+			method: "getContactMetadata",
+			parameters: {
+				"id": obj
+			},
+			callback: function (obj, result, message) {
+				if (!result) {
+					return;
+				}
+				//fill form on a not so easy way ;-)
+				for (var key in obj) {
+					if (key == 'mb_group_title' || key == 'mb_group_address' || key == 'mb_group_postcode' || key == 'mb_group_city' || key == 'mb_group_logo_path' || key == 'mb_group_email' || key == 'mb_group_voicetelephone'){
+						document.getElementById(key).value = obj[key];
+					}
+				}
+			}
+		});
+		req.send();
+	}	
+
 	this.fill = function (obj) {
 		$metadataForm.easyform("fill", obj);
 	};

Modified: branches/marc_dev/http/plugins/mb_metadata_edit.php
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_edit.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_edit.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -1,5 +1,6 @@
 <?php
 	require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+	require_once dirname(__FILE__) . "/../classes/class_user.php";
 ?>
 
 <fieldset>
@@ -14,27 +15,28 @@
 	<p>
 		<label for="wms_title"><?php echo _mb("WMS Title (OWS)");?>:</label>
 		<input name="wms_title" id="wms_title" class="required"/>
-		<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+		<img class="metadata_img" title="<?php echo _mb("INSPIRE 1.1: resource title");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
     	<label for="wms_abstract"><?php echo _mb("WMS Abstract (OWS)");?>:</label>
     	<input name="wms_abstract" id="wms_abstract"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 1.2: resource abstract");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+	<img class="help-dialog" title="<?php echo _mb("Help for INSPIRE Abstract");?>" help="{text:'<?php echo _mb("INSPIRE demands some information about the spatial resolution in the abstract tag of the capabilities document. Please insert some words about it.");?>'}" src="../img/questionmark.png" alt="" />
 	</p>
 	<p>
 		<label for="wms_keywords"><?php echo _mb("WMS Keywords (OWS)");?>:</label>
     	<input readonly="readonly" name="wms_keywords" id="wms_keywords"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 3: keyword");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="fees"><?php echo _mb("WMS Fees (OWS)");?>:</label>
     	<input name="fees" id="fees"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 8.1: conditions applying to access and use");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="accessconstraints"><?php echo _mb("WMS AccessConstraints (OWS)");?>:</label>
 		<input name="accessconstraints" id="accessconstraints"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 8.2: limitations on public access");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 <?php
 	$sql = "SELECT termsofuse_id, name FROM termsofuse";
@@ -82,7 +84,7 @@
 	<p>
 		<label for="contactorganization"><?php echo _mb("Contact Organisation (WMS)");?>:</label>
     	<input name="contactorganization" id="contactorganization"/>
-    	<img  class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img  class="metadata_img" title="<?php echo _mb("INSPIRE 9.1: responsible party name");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="address"><?php echo _mb("Contact Address (WMS)");?>:</label>
@@ -107,16 +109,78 @@
 	<p>
 	  	<label for="contactelectronicmailaddress"><?php echo _mb("Contact Electronic Mail Address (WMS)");?>:</label>
       	<input name="contactelectronicmailaddress" id="contactelectronicmailaddress" class="required email"/>
-     	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+     	<img class="metadata_img" title="<?php echo _mb("INSPIRE 9.1: responsible party email");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 	  	<label for="wms_timestamp_create"><?php echo _mb("Date of first registration (Registry)");?>:</label>
       	<input readonly="readonly" name="wms_timestamp_create" id="wms_timestamp_create"/>
-      	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+      	<img class="metadata_img" title="<?php echo _mb("INSPIRE 5.2: date of publication");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 	  	<label for="wms_timestamp"><?php echo _mb("Date of last revision (Registry)");?>:</label>
       	<td><input readonly="readonly" name="wms_timestamp" id="wms_timestamp"/>
-      	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+      	<img class="metadata_img" title="<?php echo _mb("INSPIRE 10.2: metadata date");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 </fieldset>
+<fieldset>
+	<legend><?php echo _mb("Metadata Point of contact (registry)");?>: <img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Information about the organization which is responsible for contributing the metadata. The information will be automaticcaly generated from the mapbender database mb_group object. The information came from the primary group of the service owner or from a group which has authorized the owner to publish metadata in their name.");?>'}" src="../img/questionmark.png" alt="" /></legend>
+
+<?php
+//selectbox for organizationswhich allows the publishing of metadatasets for the specific user
+	$sql = "SELECT fkey_mb_group_id, mb_group_name FROM (SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 AND (mb_user_mb_group_type = 3 OR mb_user_mb_group_type = 2)) AS a LEFT JOIN mb_group ON a.fkey_mb_group_id = mb_group.mb_group_id";
+	$user = new User();
+	$userId = $user->id;
+	$v = array($userId);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	$metadataGroup = array();
+	while ($row = db_fetch_assoc($res)) {
+		$metadataGroup[$row["fkey_mb_group_id"]] = $row["mb_group_name"];
+	}
+?>
+	<p>
+		<label for="mb_group_name"><?php echo _mb("Organization responsible for metadata");?>:</label>
+    	<select name="fkey_mb_group_id" id="fkey_mb_group_id" onChange="var chosenoption=this.options[this.selectedIndex];$('#mb_md_edit').mapbender().fillMdContact(chosenoption.value);">
+			<option value="0">...</option>
+<?php
+	foreach ($metadataGroup as $key => $value) {
+		echo "<option value='" . $key . "'>" . htmlentities($value, ENT_QUOTES, CHARSET) . "</option>";
+	}
+?>
+		</select>
+    	<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Selection of different organizations which authorized you to publish metadata in their name.");?>'}" src="../img/questionmark.png" alt="" />
+	</p>
+<!-- end of selection for the different organizations -->
+
+	<p>
+		<label for="mb_group_title"><?php echo _mb("Title");?>:</label>
+		<input readonly="readonly" name="mb_group_title" id="mb_group_title"/>
+		<img class="metadata_img" title="<?php echo _mb("INSPIRE 10.1: metadata point of contact name");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+	</p>
+	<p>
+		<label for="mb_group_address"><?php echo _mb("Address");?>:</label>
+		<input readonly="readonly" name="mb_group_address" id="mb_group_address"/>
+	</p>
+	<p>
+		<label for="mb_group_postcode"><?php echo _mb("Postcode");?>:</label>
+		<input readonly="readonly" name="mb_group_postcode" id="mb_group_postcode"/>
+	</p>
+	<p>
+		<label for="mb_group_city"><?php echo _mb("City");?>:</label>
+		<input readonly="readonly" name="mb_group_city" id="mb_group_city"/>
+	</p>
+	<p>
+		<label for="mb_group_voicetelephone"><?php echo _mb("Telephone");?>:</label>
+		<input readonly="readonly" name="mb_group_voicetelephone" id="mb_group_voicetelephone"/>
+	</p>
+	<p>
+		<label for="mb_group_email"><?php echo _mb("Email");?>:</label>
+		<input readonly="readonly" name="mb_group_email" id="mb_group_email"/>
+		<img class="metadata_img" title="<?php echo _mb("INSPIRE 10.1: metadata point of contact email");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+	</p>
+	<p>
+		<label for="mb_group_logo_path"><?php echo _mb("Logo url");?>:</label>
+		<input readonly="readonly" name="mb_group_logo_path" id="mb_group_logo_path"/>
+	</p>
+
+</fieldset>

Modified: branches/marc_dev/http/plugins/mb_metadata_layerPreview.php
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_layerPreview.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_layerPreview.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -52,20 +52,14 @@
 			$ajaxResponse->setMessage('Map preview could not be created');
 			$ajaxResponse->send();
 		} 
-		else {
-			$ajaxResponse->setSuccess(true);
-			$ajaxResponse->setMessage('Preview saved as '.$layerPreviewMapFileName);
-			$ajaxResponse->send();
-		}
-		
 		if ($legendUrl) {
 			$legendImg = new weldMaps2JPEG($legendUrl, $layerPreviewLegendFileName);
-			/*if(!$legendImg) {
+			if(!$legendImg) {
 				$ajaxResponse->setSuccess(false);
 				$ajaxResponse->setMessage('Legend preview could not be created');
 				$ajaxResponse->send();
 			} 
-			else {
+			/*else {
 				$ajaxResponse->setSuccess(true);
 				$ajaxResponse->setMessage('Preview saved');
 				$ajaxResponse->send();
@@ -74,10 +68,10 @@
 		else {
 			$legendUrl = null;
 		}
-
-		
-		break;
-
+		$ajaxResponse->setSuccess(true);
+		$ajaxResponse->setMessage('Preview saved');
+		$ajaxResponse->send();
+/*
 		$updateSQL = <<<SQL
 
 UPDATE layer_preview SET 
@@ -118,7 +112,7 @@
 			new mb_exception("could not insert/update layerPreview into db");
 			$ajaxResponse->setSuccess(false);
 			$ajaxResponse->setMessage("could not insert/Update layerPreview into db: ". pg_last_error());
-		}
+		}*/
 		break;
 
 	default:

Modified: branches/marc_dev/http/plugins/mb_metadata_server.php
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_server.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_server.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -16,9 +16,7 @@
 function getWms ($wmsId = null) {
 	$user = new User(Mapbender::session()->get("mb_user_id"));
 	$wmsIdArray = $user->getOwnedWms();
-	if (!is_array($wmsIdArray) || count($wmsIdArray) === 0) {
-		abort(_mb("No metadata sets available."));
-	}
+
 	if (!is_null($wmsId) && !in_array($wmsId, $wmsIdArray)) {
 		abort(_mb("You are not allowed to access this WMS."));
 	}
@@ -79,7 +77,7 @@
 		getWms($wmsId);
 
 		$wms = new wms();
-		$wms->createObjFromDBNoGui($wmsId);
+		$wms->createObjFromDBNoGui($wmsId);//here the owsproxyurls will be read out - to make previews with proxy urls
 
 		$fields = array(
 			"wms_id", 
@@ -100,19 +98,22 @@
 			"contactelectronicmailaddress",
 			"wms_timestamp", 
 			"wms_timestamp_create",
-			"wms_network_access"
+			"wms_network_access",
+			"fkey_mb_group_id"
 		);
 
 		$resultObj = array();
 		foreach ($fields as $field) {
 			if ($field == "wms_timestamp" || $field == "wms_timestamp_create") {
 				if ($wms->$field != "") {
+	
 					$resultObj[$field] = date('d.m.Y', $wms->$field);
 					
 				}
 			}
 			else {
-				$resultObj[$field] = $wms->$field;	
+				$resultObj[$field] = $wms->$field;
+				//$e = new mb_exception("mb_metadata_server: resultObject[".$field."]=".$wms->$field);	
 			}
 		}
 		
@@ -156,6 +157,60 @@
 		}
 		
 		$resultObj['wms_network_access'] = $resultObj['wms_network_access'] == 1 ? true : false;
+		
+		//get contact information from group relation
+		//check if fkey_mb_group_id has been defined before - in service table
+		if ($resultObj["fkey_mb_group_id"] == "" || !isset($resultObj["fkey_mb_group_id"])){
+			$e = new mb_notice("fkey_mb_group_id is null or empty");
+			//check if primary group is set 
+			$user = new User;
+			$userId = $user->id;
+			$e = new mb_exception("user id:".$userId);
+			$sql = <<<SQL
+	
+SELECT fkey_mb_group_id, mb_group_name, mb_group_title, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_logo_path, mb_group_voicetelephone FROM (SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 AND mb_user_mb_group_type = 2) AS a LEFT JOIN mb_group ON a.fkey_mb_group_id = mb_group.mb_group_id
+
+SQL;
+			$v = array($userId);
+			$t = array('i');
+			$res = db_prep_query($sql,$v,$t);
+			$row = array();
+			if ($res) {
+				$row = db_fetch_assoc($res);
+				$resultObj["fkey_mb_group_id"] = $row["fkey_mb_group_id"];
+				$resultObj["mb_group_title"] = $row["mb_group_title"];
+				$resultObj["mb_group_address"] = $row["mb_group_address"];
+				$resultObj["mb_group_email"] = $row["mb_group_email"];
+				$resultObj["mb_group_postcode"] = $row["mb_group_postcode"];
+				$resultObj["mb_group_city"] = $row["mb_group_city"];
+				$resultObj["mb_group_logo_path"] = $row["mb_group_logo_path"];
+				$resultObj["mb_group_voicetelephone"] = $row["mb_group_voicetelephone"];
+			}
+		} else {
+			//get current fkey_mb_group_id and the corresponding data
+			$sql = <<<SQL
+	
+SELECT mb_group_name, mb_group_title, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_logo_path, mb_group_voicetelephone FROM mb_group WHERE mb_group_id = $1
+
+SQL;
+			$v = array($resultObj["fkey_mb_group_id"]);
+			$t = array('i');
+			$res = db_prep_query($sql,$v,$t);
+			$row = array();
+			if ($res) {
+				$row = db_fetch_assoc($res);
+				$resultObj["mb_group_title"] = $row["mb_group_title"];
+				$resultObj["mb_group_address"] = $row["mb_group_address"];
+				$resultObj["mb_group_email"] = $row["mb_group_email"];
+				$resultObj["mb_group_postcode"] = $row["mb_group_postcode"];
+				$resultObj["mb_group_city"] = $row["mb_group_city"];
+				$resultObj["mb_group_logo_path"] = $row["mb_group_logo_path"];
+				$resultObj["mb_group_voicetelephone"] = $row["mb_group_voicetelephone"];
+			}
+			else {
+				$resultObj["fkey_mb_group_id"] = null;
+			}
+		}
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setSuccess(true);
 
@@ -326,7 +381,7 @@
 		getWms($wmsId);
 		
 		$wms = new wms();
-		$wms->createObjFromDBNoGui($wmsId);
+		$wms->createObjFromDBNoGui($wmsId,false);//here the original urls will be used - cause the object will used to update the wms table
 		
 		$columns = array(
 			"wms_abstract", 
@@ -345,7 +400,8 @@
 			"country", 
 			"contactelectronicmailaddress",
 			"wms_termsofuse",
-			"wms_network_access"
+			"wms_network_access",
+			"fkey_mb_group_id"
 		);
 		foreach ($columns as $c) {
 			$value = $data->wms->$c;
@@ -356,16 +412,22 @@
 
 		if (is_array($data->wms->layer_searchable)) {
 			foreach ($wms->objLayer as &$layer) {
-				$layer->layer_searchable = 0;
+				$layer->layer_searchable = 0;//why
+				$e = new mb_notice("mb_metadata_server.php: Check layer with id ".$layer->layer_uid." to be searchable");
 				for ($i = 0; $i < count($data->wms->layer_searchable); $i++) {
+					//$e = new mb_exception("mb_metadata_server.php: Layer with id ".$id." found to be searchable");
 					$id = $data->wms->layer_searchable[$i];
-					if ($id !== intval($layer->layer_uid)) {
-						continue;						
+					$e = new mb_notice("mb_metadata_server.php: Layer with id ".$id." found to be searchable");
+					if ($id == intval($layer->layer_uid)) {
+						$e = new mb_notice("mb_metadata_server.php: Layer identical - update it in wms object");
+						$layer->layer_searchable = 1;					
+					} else {
+						continue; //with next 
 					}
-					$layer->layer_searchable = 1;
-					break;
+					unset($id);
+					//$layer->layer_searchable = 1;
+					//break;
 				}
-				unset($id);
 			}
 		}
 
@@ -379,7 +441,7 @@
 		}
 		
 		if ($layerId) {
-			$e = new mb_exception("Got following layer id from wms metadata editor client: ".$layerId);
+			$e = new mb_notice("Got following layer id from wms metadata editor client: ".$layerId);
 			try {
 				$layer = &$wms->getLayerReferenceById($layerId);
 			}
@@ -399,7 +461,7 @@
 
 			foreach ($columns as $c) {
 				$value = $data->layer->$c;
-				$e = new mb_exception("plugins/mb_metadata_server.php: layer entry for ".$c.": ".$data->layer->$c);
+				$e = new mb_notice("plugins/mb_metadata_server.php: layer entry for ".$c.": ".$data->layer->$c);
 				if ($c === "layer_keyword") {
 					$layer->$c = explode(",", $value);
 					foreach ($layer->$c as &$val) {
@@ -443,6 +505,33 @@
 		$ajaxResponse->setSuccess(true);		
 		
 		break;
+	case "getContactMetadata" :
+		$mbGroupId = $ajaxResponse->getParameter("id");
+		$sql = <<<SQL
+	
+SELECT mb_group_name, mb_group_title, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_logo_path, mb_group_voicetelephone FROM mb_group WHERE mb_group_id = $1
+
+SQL;
+		$v = array($mbGroupId);
+		$t = array('i');
+		$res = db_prep_query($sql,$v,$t);
+		$row = array();
+		if ($res) {
+			$row = db_fetch_assoc($res);
+			$resultObj["fkey_mb_group_id"] = $mbGroupId;
+			$resultObj["mb_group_name"] = $row["mb_group_name"];
+			$resultObj["mb_group_title"] = $row["mb_group_title"];
+			$resultObj["mb_group_address"] = $row["mb_group_address"];
+			$resultObj["mb_group_email"] = $row["mb_group_email"];
+			$resultObj["mb_group_postcode"] = $row["mb_group_postcode"];
+			$resultObj["mb_group_city"] = $row["mb_group_city"];
+			$resultObj["mb_group_logo_path"] = $row["mb_group_logo_path"];
+			$resultObj["mb_group_voicetelephone"] = $row["mb_group_voicetelephone"];	
+		}
+		$ajaxResponse->setResult($resultObj);
+		$ajaxResponse->setSuccess(true);
+		break;
+
 	default: 
 		$ajaxResponse->setSuccess(false);
 		$ajaxResponse->setMessage(_mb("An unknown error occured."));

Modified: branches/marc_dev/http/plugins/mb_metadata_wfs_edit.js
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_wfs_edit.js	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_wfs_edit.js	2011-03-28 19:16:52 UTC (rev 7722)
@@ -84,6 +84,29 @@
 		req.send();		
 	};
 
+	this.fillMdContact = function(obj) {
+		// get mdContact from server per fkey_mb_group_id
+		var req = new Mapbender.Ajax.Request({
+			url: "../plugins/mb_metadata_server.php",
+			method: "getContactMetadata",
+			parameters: {
+				"id": obj
+			},
+			callback: function (obj, result, message) {
+				if (!result) {
+					return;
+				}
+				//fill form on a not so easy way ;-)
+				for (var key in obj) {
+					if (key == 'mb_group_title' || key == 'mb_group_address' || key == 'mb_group_postcode' || key == 'mb_group_city' || key == 'mb_group_logo_path' || key == 'mb_group_email' || key == 'mb_group_voicetelephone'){
+						document.getElementById(key).value = obj[key];
+					}
+				}
+			}
+		});
+		req.send();
+	}	
+
 	this.fill = function (obj) {
 		$metadataForm.easyform("fill", obj);
 	};

Modified: branches/marc_dev/http/plugins/mb_metadata_wfs_edit.php
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_wfs_edit.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_wfs_edit.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -1,5 +1,6 @@
 <?php
 	require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+	require_once dirname(__FILE__) . "/../classes/class_user.php";
 ?>
 
 <fieldset>
@@ -14,27 +15,27 @@
 	<p>
 		<label for="title"><?php echo _mb("WFS Title (OWS)");?>:</label>
 		<input name="title" id="title" class="required"/>
-		<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+		<img class="metadata_img" title="<?php echo _mb("INSPIRE 1.1: resource title");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
     	<label for="summary"><?php echo _mb("WFS Abstract (OWS)");?>:</label>
     	<input name="summary" id="summary"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 1.2: resource abstract");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="wfs_keywords"><?php echo _mb("WFS Keywords (OWS)");?>:</label>
     	<input readonly="readonly" name="wfs_keywords" id="wfs_keywords"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 3: keyword");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="fees"><?php echo _mb("WFS Fees (OWS)");?>:</label>
     	<input name="fees" id="fees"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 8.1: conditions applying to access and use");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="accessconstraints"><?php echo _mb("WFS AccessConstraints (OWS)");?>:</label>
 		<input name="accessconstraints" id="accessconstraints"/>
-    	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img class="metadata_img" title="<?php echo _mb("INSPIRE 8.2: limitations on public access");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 <?php
 	$sql = "SELECT termsofuse_id, name FROM termsofuse";
@@ -54,8 +55,12 @@
 	}
 ?>
 		</select>
-    	<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Auswahl von vordefinierten Lizenzen hinsichtlich Gebühren und Zugriffsbeschränkungen.");?>'}" src="../img/questionmark.png" alt="" />
+    	<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Selection of predefined licences.");?>'}" src="../img/questionmark.png" alt="" />
 	</p>
+	<p>
+	  	<label for="network_access"><?php echo _mb("Restricted Network Access (Registry)");?>:</label>
+      		<input name="network_access" id="network_access" type="checkbox"/>
+	</p>
 </fieldset>
 <fieldset>
 	<legend><?php echo _mb("WFS Provider Section (OWS)");?></legend>
@@ -78,7 +83,7 @@
 	<p>
 		<label for="providerName"><?php echo _mb("Contact Organisation (WFS)");?>:</label>
     	<input name="providerName" id="providerName"/>
-    	<img  class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+    	<img  class="metadata_img" title="<?php echo _mb("INSPIRE 9.1: responsible party name");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 		<label for="deliveryPoint"><?php echo _mb("Contact Address (WFS)");?>:</label>
@@ -103,20 +108,78 @@
 	<p>
 	  	<label for="electronicMailAddress"><?php echo _mb("Contact Electronic Mail Address (WFS)");?>:</label>
       	<input name="electronicMailAddress" id="electronicMailAddress" class="required email"/>
-     	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+     	<img class="metadata_img" title="<?php echo _mb("INSPIRE 9.1: responsible party email");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 	  	<label for="wfs_timestamp_create"><?php echo _mb("Date of first registration (Registry)");?>:</label>
       	<input readonly="readonly" name="wfs_timestamp_create" id="wfs_timestamp_create"/>
-      	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+      	<img class="metadata_img" title="<?php echo _mb("INSPIRE 5.2: date of publication");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
 	<p>
 	  	<label for="wfs_timestamp"><?php echo _mb("Date of last revision (Registry)");?>:</label>
       	<td><input readonly="readonly" name="wfs_timestamp" id="wfs_timestamp"/>
-      	<img class="metadata_img" title="<?php echo _mb("Inspire");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+      	<img class="metadata_img" title="<?php echo _mb("INSPIRE 10.2: metadata date");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
 	</p>
-<p>
-	  	<label for="wfs_network_access"><?php echo _mb("Restricted Network Access (Registry)");?>:</label>
-      	<input name="wfs_network_access" id="wfs_network_access" type="checkbox"/>
+</fieldset>
+<fieldset>
+	<legend><?php echo _mb("Metadata Point of contact (registry)");?>: <img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Information about the organization which is responsible for contributing the metadata. The information will be automaticcaly generated from the mapbender database mb_group object. The information came from the primary group of the service owner or from a group which has authorized the owner to publish metadata in their name.");?>'}" src="../img/questionmark.png" alt="" /></legend>
+
+<?php
+//selectbox for organizationswhich allows the publishing of metadatasets for the specific user
+	$sql = "SELECT fkey_mb_group_id, mb_group_name FROM (SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 AND (mb_user_mb_group_type = 3 OR mb_user_mb_group_type = 2)) AS a LEFT JOIN mb_group ON a.fkey_mb_group_id = mb_group.mb_group_id";
+	$user = new User();
+	$userId = $user->id;
+	$v = array($userId);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	$metadataGroup = array();
+	while ($row = db_fetch_assoc($res)) {
+		$metadataGroup[$row["fkey_mb_group_id"]] = $row["mb_group_name"];
+	}
+?>
+	<p>
+		<label for="mb_group_name"><?php echo _mb("Organization responsible for metadata");?>:</label>
+    	<select name="fkey_mb_group_id" id="fkey_mb_group_id" onChange="var chosenoption=this.options[this.selectedIndex];$('#mb_md_wfs_edit').mapbender().fillMdContact(chosenoption.value);">
+			<option value="0">...</option>
+<?php
+	foreach ($metadataGroup as $key => $value) {
+		echo "<option value='" . $key . "'>" . htmlentities($value, ENT_QUOTES, CHARSET) . "</option>";
+	}
+?>
+		</select>
+    	<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Selection of different organizations which authorized you to publish metadata in their name.");?>'}" src="../img/questionmark.png" alt="" />
 	</p>
+<!-- end of selection for the different organizations -->
+
+	<p>
+		<label for="mb_group_title"><?php echo _mb("Title");?>:</label>
+		<input readonly="readonly" name="mb_group_title" id="mb_group_title"/>
+		<img class="metadata_img" title="<?php echo _mb("INSPIRE 10.1: metadata point of contact name");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+	</p>
+	<p>
+		<label for="mb_group_address"><?php echo _mb("Address");?>:</label>
+		<input readonly="readonly" name="mb_group_address" id="mb_group_address"/>
+	</p>
+	<p>
+		<label for="mb_group_postcode"><?php echo _mb("Postcode");?>:</label>
+		<input readonly="readonly" name="mb_group_postcode" id="mb_group_postcode"/>
+	</p>
+	<p>
+		<label for="mb_group_city"><?php echo _mb("City");?>:</label>
+		<input readonly="readonly" name="mb_group_city" id="mb_group_city"/>
+	</p>
+	<p>
+		<label for="mb_group_voicetelephone"><?php echo _mb("Telephone");?>:</label>
+		<input readonly="readonly" name="mb_group_voicetelephone" id="mb_group_voicetelephone"/>
+	</p>
+	<p>
+		<label for="mb_group_email"><?php echo _mb("Email");?>:</label>
+		<input readonly="readonly" name="mb_group_email" id="mb_group_email"/>
+		<img class="metadata_img" title="<?php echo _mb("INSPIRE 10.1: metadata point of contact email");?>" src="../img/misc/inspire_eu_klein.png" alt="" />
+	</p>
+	<p>
+		<label for="mb_group_logo_path"><?php echo _mb("Logo url");?>:</label>
+		<input readonly="readonly" name="mb_group_logo_path" id="mb_group_logo_path"/>
+	</p>
+
 </fieldset>

Modified: branches/marc_dev/http/plugins/mb_metadata_wfs_server.php
===================================================================
--- branches/marc_dev/http/plugins/mb_metadata_wfs_server.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_metadata_wfs_server.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -17,9 +17,7 @@
 function getWfs ($wfsId = null) {
 	$user = new User(Mapbender::session()->get("mb_user_id"));
 	$wfsIdArray = $user->getOwnedWfs();
-	if (!is_array($wfsIdArray) || count($wfsIdArray) === 0) {
-		abort(_mb("No metadata sets available."));
-	}
+
 	if (!is_null($wfsId) && !in_array($wfsId, $wfsIdArray)) {
 		abort(_mb("You are not allowed to access this WFS."));
 	}
@@ -81,7 +79,7 @@
 individualname, positionname, providername, voice, 
 facsimile, deliverypoint, city, 
 administrativearea, postalcode, country, electronicmailaddress,
-wfs_timestamp, wfs_timestamp_create 
+wfs_timestamp, wfs_timestamp_create, wfs_network_access, fkey_mb_group_id 
 FROM wfs WHERE wfs_id = $wfsId;
 
 SQL;
@@ -106,9 +104,11 @@
 		$resultObj['postalCode'] = $row['postalcode'];
 		$resultObj['country'] = $row['country'];
 		$resultObj['electronicMailAddress'] = $row['electronicmailaddress'];
-		$resultObj['wfs_timestamp'] = $row['wfs_timestamp'] != "" ? date('d.m.Y', $row['wfs_timestamp']) : "";
-		$resultObj['wfs_timestamp_create'] = $row['wfs_timestamp_create'] != "" ? date('d.m.Y', $row['wfs_timestamp_create']) : "";
-		
+		$resultObj['timestamp'] = $row['wfs_timestamp'] != "" ? date('d.m.Y', $row['wfs_timestamp']) : "";
+		$resultObj['timestamp_create'] = $row['wfs_timestamp_create'] != "" ? date('d.m.Y', $row['wfs_timestamp_create']) : "";
+		$resultObj['network_access'] = $row['wfs_network_access'];
+		$resultObj['fkey_mb_group_id'] = $row['fkey_mb_group_id'];
+
 		$keywordSql = <<<SQL
 	
 SELECT DISTINCT keyword FROM keyword, wfs_featuretype_keyword 
@@ -139,8 +139,64 @@
 		else {
 			$resultObj["wfs_termsofuse"] = null;
 		}
-		
 
+		$resultObj['wfs_network_access'] = $resultObj['wfs_network_access'] == 1 ? true : false;
+
+		//get contact information from group relation
+		//check if fkey_mb_group_id has been defined before - in service table
+		if ($resultObj["fkey_mb_group_id"] == "" || !isset($resultObj["fkey_mb_group_id"])){
+			$e = new mb_notice("fkey_mb_group_id is null or empty");
+			//check if primary group is set 
+			$user = new User;
+			$userId = $user->id;
+			$e = new mb_exception("user id:".$userId);
+			$sql = <<<SQL
+	
+SELECT fkey_mb_group_id, mb_group_name, mb_group_title, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_logo_path, mb_group_voicetelephone FROM (SELECT fkey_mb_group_id FROM mb_user_mb_group WHERE fkey_mb_user_id = $1 AND mb_user_mb_group_type = 2) AS a LEFT JOIN mb_group ON a.fkey_mb_group_id = mb_group.mb_group_id
+
+SQL;
+			$v = array($userId);
+			$t = array('i');
+			$res = db_prep_query($sql,$v,$t);
+			$row = array();
+			if ($res) {
+				$row = db_fetch_assoc($res);
+				$resultObj["fkey_mb_group_id"] = $row["fkey_mb_group_id"];
+				$resultObj["mb_group_title"] = $row["mb_group_title"];
+				$resultObj["mb_group_address"] = $row["mb_group_address"];
+				$resultObj["mb_group_email"] = $row["mb_group_email"];
+				$resultObj["mb_group_postcode"] = $row["mb_group_postcode"];
+				$resultObj["mb_group_city"] = $row["mb_group_city"];
+				$resultObj["mb_group_logo_path"] = $row["mb_group_logo_path"];
+				$resultObj["mb_group_voicetelephone"] = $row["mb_group_voicetelephone"];
+			}
+		} else {
+			//get current fkey_mb_group_id and the corresponding data
+			$sql = <<<SQL
+	
+SELECT mb_group_name, mb_group_title, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_logo_path, mb_group_voicetelephone FROM mb_group WHERE mb_group_id = $1
+
+SQL;
+			$v = array($resultObj["fkey_mb_group_id"]);
+			$t = array('i');
+			$res = db_prep_query($sql,$v,$t);
+			$row = array();
+			if ($res) {
+				$row = db_fetch_assoc($res);
+				$resultObj["mb_group_title"] = $row["mb_group_title"];
+				$resultObj["mb_group_address"] = $row["mb_group_address"];
+				$resultObj["mb_group_email"] = $row["mb_group_email"];
+				$resultObj["mb_group_postcode"] = $row["mb_group_postcode"];
+				$resultObj["mb_group_city"] = $row["mb_group_city"];
+				$resultObj["mb_group_logo_path"] = $row["mb_group_logo_path"];
+				$resultObj["mb_group_voicetelephone"] = $row["mb_group_voicetelephone"];
+			}
+			else {
+				$resultObj["fkey_mb_group_id"] = null;
+			}
+		}
+
+
 		$ajaxResponse->setResult($resultObj);
 		$ajaxResponse->setSuccess(true);
 
@@ -289,7 +345,7 @@
 		getWfs($wfsId);
 		
 		$wfsFactory = new UniversalWfsFactory();
-		$wfs = $wfsFactory->createFromDb($wfsId);
+		$wfs = $wfsFactory->createFromDb($wfsId, false);
 		if (is_null($wfs)) {
 			$ajaxResponse->setSuccess(false);
 			$ajaxResponse->setMessage(_mb("Invalid WFS ID."));
@@ -312,7 +368,12 @@
 			"postalCode", 
 			"country", 
 			"electronicMailAddress",
-			"wfs_termsofuse"
+			"wfs_termsofuse",
+			"timestamp",
+			"timestamp_create",
+			"network_access",
+			"fkey_mb_group_id",
+			"uuid"
 		);
 		foreach ($columns as $c) {
 			$value = $data->wfs->$c;
@@ -375,7 +436,11 @@
 				}
 			}
 		}
-
+		if ($wfs->network_access == "on") {
+			$wfs->network_access = intval('1');
+		} else {
+			$wfs->network_access = intval('0');
+		}
 		$wfs->update();
 
 		
@@ -390,4 +455,4 @@
 }
 
 $ajaxResponse->send();
-?>
\ No newline at end of file
+?>

Modified: branches/marc_dev/http/plugins/mb_print.php
===================================================================
--- branches/marc_dev/http/plugins/mb_print.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_print.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -209,6 +209,8 @@
 		buildConfigSelector();	
 		/* second we'd need to read the json configuration */
 		that.loadConfig(mbPrintConfigFilenames[0]);
+		/* than we need the translation of the print button */
+		$("#submit").val("<?php echo htmlentities(_mb("print"), ENT_QUOTES, "UTF-8");?>");
 	};
 
 	/**

Modified: branches/marc_dev/http/plugins/mb_sessionWmc.js
===================================================================
--- branches/marc_dev/http/plugins/mb_sessionWmc.js	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/plugins/mb_sessionWmc.js	2011-03-28 19:16:52 UTC (rev 7722)
@@ -111,9 +111,10 @@
 			},
 			callback: function (obj, result, message) {
 				window.resetSession = true;
-				//alert(message);
-				location.reload();
-				//mapbender reload!
+				//unset the get api params cause they will load the old state!
+				var currentURL = location;
+				var newHref = currentURL.protocol+'//'+currentURL.host+currentURL.pathname;
+				window.location.href = newHref;
 			}
 		});
 		req.send();

Copied: branches/marc_dev/http/print/A0_landscape_template.json (from rev 7721, trunk/mapbender/http/print/A0_landscape_template.json)
===================================================================
--- branches/marc_dev/http/print/A0_landscape_template.json	                        (rev 0)
+++ branches/marc_dev/http/print/A0_landscape_template.json	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,160 @@
+{
+    "type" : "templatePDF",
+    "orientation" : "L",
+    "units" : "mm",
+    "format" : "a0",
+    "controls" : [
+    	{
+    		"id" : "title",
+    		"label" : "Titel",
+    		"type" : "text",
+    		"size" : 20,
+    		"pageElementsLink" : {
+    			"titel" : "value"
+    		}
+    	},
+    	{
+    		"id" : "dpi",
+    		"label" : "DPI",
+    		"type" : "select",
+    		"size" : 20,
+    		"pageElementsLink" : {
+    			"karte" : "res_dpi"
+    		},
+    		"options" : [
+				{
+    			"value" : "72",
+    			"label" : "normal (72 dpi)"
+    			},{
+    			"value" : "288",
+    			"label" : "hoch (288 dpi)"
+    			}	
+    		]
+    	},
+    	{
+    		"id" : "comment1",
+    		"label" : "Kommentar 1 (30 Zeichen)",
+    		"type" : "textarea",
+    		"size" : 5,
+    		"pageElementsLink" : {
+    			"kommentar1" : "value"
+    		}
+    	},
+    	{
+    		"id" : "comment2",
+    		"label" : "Kommentar 2 (30 Zeichen)",
+    		"type" : "textarea",
+    		"size" : 5,
+    		"pageElementsLink" : {
+    			"kommentar2" : "value"
+    		}
+    	},
+    	{
+    		"id" : "angle",
+    		"label" : "Winkel",
+    		"type" : "text",
+    		"pageElementsLink" : {
+    			"nordpfeil" : "angle",
+    			"karte" : "angle",
+    			"minikarte" : "angle"
+    		}
+    	},
+    	{
+    		"id" : "coordinates",
+    		"type" : "hidden"
+    	},
+    	{
+    		"id" : "scale",
+    		"label" : "Maßstab",
+    		"type" : "text",
+    		"pageElementsLink" : {
+    			"scale" : "value"
+    		}
+    	}
+    ],
+    "pages" : [
+    	{
+    	 "tpl" : "../print/A0_landscape_template.pdf",
+    	 "useTplPage" : 1,
+    	 "elements" : {
+	    	 "karte" : {
+    			"type" : "map",
+    			"res_dpi" : 72,
+    			"x_ul" : 22.2,
+	    		"y_ul" : 15.2,
+	    		"width" : 1061.6,
+    			"height" : 809.6,
+    			"coords" : 1,
+    			"coords_font_family" : "Arial",
+    			"coords_font_size" : 7
+	   			},
+	   		"minikarte" : {
+    			"type" : "overview",
+    			"res_dpi" : 72,
+    			"x_ul" : 1091,
+	    		"y_ul" : 677,
+	    		"width" : 86,
+    			"height" : 86
+	   			},
+	   		"titel" : {
+    			"type" : "text",
+    			"x_ul" : 1123.7,
+	    		"y_ul" : 798,
+	    		"font_family" : "Arial",
+	    		"font_size" : 14
+	   			},
+	   		"scale" : {
+    			"type" : "text",
+    			"x_ul" : 1103,
+	    		"y_ul" : 789.6,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+				"value" : "scale"
+	   		},
+	   		"date" : {
+    			"type" : "text",
+    			"x_ul" : 1146,
+	    		"y_ul" : 789.6,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+				"value" : "date"
+	   		},
+	   		"nordpfeil" : {
+    			"type" : "image",
+    			"x_ul" : 1099.1,
+	    		"y_ul" : 775,
+	    		"width" : 6,
+	    		"height" : 12,
+	    		"angle" : 0,
+				"filename" : "../print/img/northarrow_simple.png"
+	   		},
+	   		"kommentar1" : {
+    			"type" : "para",
+    			"x_ul" : 1089.6,
+	    		"y_ul" : 801.8,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+	    		"width" : 45,
+	    		"height" : 4,
+	    		"align" : "L",
+	    		"border" : 0,
+	    		"fill" : 1,
+	    		"border_width" : 0.5
+	   			},
+	   		"kommentar2" : {
+    			"type" : "para",
+    			"x_ul" : 1089.6,
+	    		"y_ul" : 808.8,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+	    		"width" : 45,
+	    		"height" : 4,
+	    		"align" : "L",
+	    		"border" : 0,
+	    		"fill" : 1,
+	    		"border_width" : 0.5
+	   			}
+	   		}
+	   	}
+	]
+}
\ No newline at end of file

Copied: branches/marc_dev/http/print/A0_landscape_template.odg (from rev 7721, trunk/mapbender/http/print/A0_landscape_template.odg)
===================================================================
(Binary files differ)

Copied: branches/marc_dev/http/print/A0_landscape_template.pdf (from rev 7721, trunk/mapbender/http/print/A0_landscape_template.pdf)
===================================================================
(Binary files differ)

Copied: branches/marc_dev/http/print/A1_landscape_template.json (from rev 7721, trunk/mapbender/http/print/A1_landscape_template.json)
===================================================================
--- branches/marc_dev/http/print/A1_landscape_template.json	                        (rev 0)
+++ branches/marc_dev/http/print/A1_landscape_template.json	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,160 @@
+{
+    "type" : "templatePDF",
+    "orientation" : "L",
+    "units" : "mm",
+    "format" : "a1",
+    "controls" : [
+    	{
+    		"id" : "title",
+    		"label" : "Titel",
+    		"type" : "text",
+    		"size" : 20,
+    		"pageElementsLink" : {
+    			"titel" : "value"
+    		}
+    	},
+    	{
+    		"id" : "dpi",
+    		"label" : "DPI",
+    		"type" : "select",
+    		"size" : 20,
+    		"pageElementsLink" : {
+    			"karte" : "res_dpi"
+    		},
+    		"options" : [
+				{
+    			"value" : "72",
+    			"label" : "normal (72 dpi)"
+    			},{
+    			"value" : "288",
+    			"label" : "hoch (288 dpi)"
+    			}
+    		]
+    	},
+    	{
+    		"id" : "comment1",
+    		"label" : "Kommentar 1 (30 Zeichen)",
+    		"type" : "textarea",
+    		"size" : 5,
+    		"pageElementsLink" : {
+    			"kommentar1" : "value"
+    		}
+    	},
+    	{
+    		"id" : "comment2",
+    		"label" : "Kommentar 2 (30 Zeichen)",
+    		"type" : "textarea",
+    		"size" : 5,
+    		"pageElementsLink" : {
+    			"kommentar2" : "value"
+    		}
+    	},
+    	{
+    		"id" : "angle",
+    		"label" : "Winkel",
+    		"type" : "text",
+    		"pageElementsLink" : {
+    			"nordpfeil" : "angle",
+    			"karte" : "angle",
+    			"minikarte" : "angle"
+    		}
+    	},
+    	{
+    		"id" : "coordinates",
+    		"type" : "hidden"
+    	},
+    	{
+    		"id" : "scale",
+    		"label" : "Maßstab",
+    		"type" : "text",
+    		"pageElementsLink" : {
+    			"scale" : "value"
+    		}
+    	}
+    ],
+    "pages" : [
+    	{
+    	 "tpl" : "../print/A1_landscape_template.pdf",
+    	 "useTplPage" : 1,
+    	 "elements" : {
+	    	 "karte" : {
+    			"type" : "map",
+    			"res_dpi" : 72,
+    			"x_ul" : 22.2,
+	    		"y_ul" : 15.2,
+	    		"width" : 713.6,
+    			"height" : 563.6,
+    			"coords" : 1,
+    			"coords_font_family" : "Arial",
+    			"coords_font_size" : 7
+	   			},
+	   		"minikarte" : {
+    			"type" : "overview",
+    			"res_dpi" : 72,
+    			"x_ul" : 743,
+	    		"y_ul" : 431,
+	    		"width" : 86,
+    			"height" : 85.6
+	   			},
+	   		"titel" : {
+    			"type" : "text",
+    			"x_ul" : 775.7,
+	    		"y_ul" : 552,
+	    		"font_family" : "Arial",
+	    		"font_size" : 14
+	   			},
+	   		"scale" : {
+    			"type" : "text",
+    			"x_ul" : 755,
+	    		"y_ul" : 543.6,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+				"value" : "scale"
+	   		},
+	   		"date" : {
+    			"type" : "text",
+    			"x_ul" : 798,
+	    		"y_ul" : 543.6,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+				"value" : "date"
+	   		},
+	   		"nordpfeil" : {
+    			"type" : "image",
+    			"x_ul" : 751.1,
+	    		"y_ul" : 529,
+	    		"width" : 6,
+	    		"height" : 12,
+	    		"angle" : 0,
+				"filename" : "../print/img/northarrow_simple.png"
+	   		},
+	   		"kommentar1" : {
+    			"type" : "para",
+    			"x_ul" : 741.6,
+	    		"y_ul" : 555.8,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+	    		"width" : 45,
+	    		"height" : 4,
+	    		"align" : "L",
+	    		"border" : 0,
+	    		"fill" : 1,
+	    		"border_width" : 0.5
+	   			},
+	   		"kommentar2" : {
+    			"type" : "para",
+    			"x_ul" : 741.6,
+	    		"y_ul" : 562.8,
+	    		"font_family" : "Arial",
+	    		"font_size" : 12,
+	    		"width" : 45,
+	    		"height" : 4,
+	    		"align" : "L",
+	    		"border" : 0,
+	    		"fill" : 1,
+	    		"border_width" : 0.5
+	   			}
+	   		}
+	   	}
+	]
+}
\ No newline at end of file

Copied: branches/marc_dev/http/print/A1_landscape_template.odg (from rev 7721, trunk/mapbender/http/print/A1_landscape_template.odg)
===================================================================
(Binary files differ)

Copied: branches/marc_dev/http/print/A1_landscape_template.pdf (from rev 7721, trunk/mapbender/http/print/A1_landscape_template.pdf)
===================================================================
(Binary files differ)

Modified: branches/marc_dev/http/print/classes/mbMapDecorator.php
===================================================================
--- branches/marc_dev/http/print/classes/mbMapDecorator.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/http/print/classes/mbMapDecorator.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -68,7 +68,7 @@
 			}
 		}
 		$array_urls = $newArray_urls;
-		$e = new mb_exception("print/classes/mbMapDecorator.php: array_urls[0]: ".$array_urls[0]);
+		$e = new mb_notice("print/classes/mbMapDecorator.php: array_urls[0]: ".$array_urls[0]);
 		$width = $this->conf->width;
 		$height = $this->conf->height;
 		$res = $this->pdf->objPdf->k * ($this->res_dpi/72);


Property changes on: branches/marc_dev/http/print/mapbender_template.json
___________________________________________________________________
Modified: svn:mergeinfo
   - 
   + /branches/kmq_dev/http/print/mapbender_template.json:7677
/trunk/mapbender/http/print/mapbender_template.json:7674-7721

Modified: branches/marc_dev/owsproxy/http/index.php
===================================================================
--- branches/marc_dev/owsproxy/http/index.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/owsproxy/http/index.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -26,6 +26,8 @@
 
 /***** conf *****/
 $imageformats = array("image/png","image/gif","image/jpeg", "image/jpg");
+$width = 400;
+$height = 400;
 /***** conf *****/
 
 $con = db_connect(DBSERVER,OWNER,PW);
@@ -184,8 +186,12 @@
 	ImageFilledRectangle($image,0,0,$width,$height,$transparent);
 	imagecolortransparent($image, $transparent);
 	$text_color = ImageColorAllocate ($image, 233, 14, 91);
-	for($i=0; $i<count($e); $i++){
-		ImageString ($image, 3, 5, $i*20, $e[$i], $text_color);
+	if (count($e) > 1){
+		for($i=0; $i<count($e); $i++){
+			ImageString ($image, 3, 5, $i*20, $e[$i], $text_color);
+		}
+	} else {
+		ImageString ($image, 3, 5, $i*20, $e, $text_color);
 	}
 	responseImage($image);
 }
@@ -195,10 +201,11 @@
 function responseImage($im){
 	global $reqParams;
 	$format = $reqParams['format'];
+	$format="image/gif";
 	if($format == 'image/png'){header("Content-Type: image/png");}
 	if($format == 'image/jpeg' || $format == 'image/jpg'){header("Content-Type: image/jpeg");}
 	if($format == 'image/gif'){header("Content-Type: image/gif");}
-		 
+ 
 	if($format == 'image/png'){imagepng($im);}
 	if($format == 'image/jpeg' || $format == 'image/jpg'){imagejpeg($im);}
 	if($format == 'image/gif'){imagegif($im);}	
@@ -246,7 +253,7 @@
  */
 function getFeatureInfo($url){
 	global $info_format;
-	//$e = new mb_notice("owsproxy: Try to fetch FeatureInfoRequest: ".$url);
+	//$notice = new mb_notice("owsproxy: Try to fetch FeatureInfoRequest: ".$url);
 	header("Content-Type: ".$info_format);
 	
 	if (func_num_args() == 2) { //new for HTTP Authentication
@@ -391,11 +398,11 @@
 	preg_match_all($pattern,$content,$matches);
 	for($i=0; $i<count($matches[1]); $i++){
 		$req = $matches[1][$i];
-		$e = new mb_notice("owsproxy found URL ".$i.": ".$req);
+		$notice = new mb_notice("owsproxy found URL ".$i.": ".$req);
 		#$notice = new mb_notice("owsproxy id:".$req);
 		$id = registerURL($req);
 		$extReq = setExternalRequest($id);
-		$e = new mb_notice("MD5 URL ".$id." - external link: ".$extReq);
+		$notice = new mb_notice("MD5 URL ".$id." - external link: ".$extReq);
 		$content = str_replace($req,$extReq,$content);
 	}
 	return $content;

Copied: branches/marc_dev/resources/db/new_role_concept.sql (from rev 7721, trunk/mapbender/resources/db/new_role_concept.sql)
===================================================================
--- branches/marc_dev/resources/db/new_role_concept.sql	                        (rev 0)
+++ branches/marc_dev/resources/db/new_role_concept.sql	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,70 @@
+--UPDATE mb_user_mb_group set mb_user_mb_group_type = 2 where mb_user_mb_group_type = 1 ;
+UPDATE mb_user_mb_group set mb_user_mb_group_type = 1 where mb_user_mb_group_type IS NULL;
+--***** new role system - should not influence the normal behaviour 
+-- Table: mb_role
+
+-- DROP TABLE mb_role;
+
+CREATE TABLE mb_role
+(
+  role_id serial NOT NULL,
+  role_name character varying(50),
+  role_description character varying(255),
+  role_exclude_auth integer NOT NULL DEFAULT 0,
+  CONSTRAINT role_id PRIMARY KEY (role_id)
+)
+WITH (
+  OIDS=FALSE
+);
+ALTER TABLE mb_role OWNER TO postgres;
+
+
+--things to be done for mb_user_mb_group table:
+--drop old constraint
+--Allow to be member in a group with different roles
+ALTER TABLE mb_user_mb_group DROP CONSTRAINT pk_fkey_mb_user_mb_group_id;
+
+UPDATE mb_user_mb_group SET mb_user_mb_group_type = 1 WHERE mb_user_mb_group_type IS NULL OR mb_user_mb_group_type = 0;
+
+--default to standard role
+ALTER TABLE mb_user_mb_group ALTER COLUMN mb_user_mb_group_type SET DEFAULT 1;
+
+-- Constraint: pk_fkey_mb_user_mb_group_id
+
+-- ALTER TABLE mb_user_mb_group DROP CONSTRAINT pk_fkey_mb_user_mb_group_id;
+--create new constraint
+ALTER TABLE mb_user_mb_group
+  ADD CONSTRAINT pk_fkey_mb_user_mb_group_id PRIMARY KEY(fkey_mb_user_id, fkey_mb_group_id, mb_user_mb_group_type);
+
+
+
+--things for the role table
+--standard roles:
+INSERT INTO mb_role (role_name,role_description,role_exclude_auth) VALUES ('standard role','No special role - old behaviour.',0);
+
+INSERT INTO mb_role (role_name,role_description,role_exclude_auth) VALUES ('primary','Primary group for a mapbender user.',0);
+
+INSERT INTO mb_role (role_name,role_description,role_exclude_auth) VALUES ('metadata editor','Group for which the user can edit and publish metadata.',1);
+
+--constraint for new role system
+-- ALTER TABLE mb_user_mb_group DROP CONSTRAINT fkey_mb_user_mb_group_role_id;
+
+ALTER TABLE mb_user_mb_group
+  ADD CONSTRAINT fkey_mb_user_mb_group_role_id FOREIGN KEY (mb_user_mb_group_type)
+      REFERENCES mb_role (role_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;
+
+--link for admin1
+INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, 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, e_url) VALUES('admin1','Group_User_Role',2,1,'allocate groups to user and roles','','a','','href = "../php/mod_group_user_role.php?sessionID&e_id_css=Group_User_Role" target = "AdminFrame" ',10,1234,200,20,NULL ,'font-family: Arial, Helvetica, sans-serif; font-size : 12px; text-decoration : none;color: #808080;','GROUP -> USER -> ROLE','a','','','','AdminFrame','http://www.mapbender.org/index.php/user');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('admin1', 'Group_User_Role', 'file css', '../css/administration_alloc.css', 'file css' ,'file/css');
+
+--update the group for the decentral registrating institutions
+-- View: registrating_groups
+CREATE OR REPLACE VIEW registrating_groups AS 
+ SELECT f.fkey_mb_group_id, f.fkey_mb_user_id
+   FROM mb_user_mb_group f, mb_user_mb_group s
+  WHERE f.mb_user_mb_group_type = 2 AND s.fkey_mb_group_id = 36 AND f.fkey_mb_user_id = s.fkey_mb_user_id
+  ORDER BY f.fkey_mb_group_id, f.fkey_mb_user_id;
+--*****end of role concept****
+
+


Property changes on: branches/marc_dev/resources/db/pgsql/UTF-8/update/update_2.6rc1_to_2.6_pgsql_UTF-8.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/kmq_dev/resources/db/pgsql/UTF-8/update/update_2.6rc1_to_2.6rc2_pgsql_UTF-8.sql:4021-4487
   + /branches/kmq_dev/resources/db/pgsql/UTF-8/update/update_2.6rc1_to_2.6_pgsql_UTF-8.sql:7677
/branches/kmq_dev/resources/db/pgsql/UTF-8/update/update_2.6rc1_to_2.6rc2_pgsql_UTF-8.sql:4021-4487
/trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.6rc1_to_2.6_pgsql_UTF-8.sql:7674-7721

Modified: branches/marc_dev/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql
===================================================================
--- branches/marc_dev/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql	2011-03-28 19:16:52 UTC (rev 7722)
@@ -1704,8 +1704,81 @@
 
 INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, 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, e_url) VALUES('Administration','deleteCategory_icon',2,1,'icon','','img','../img/gnome/deleteCategories.png','',0,0,NULL ,NULL ,2,'','','','','','','','');
 
+--***** new role system - should not influence the normal behaviour 
+--UPDATE mb_user_mb_group set mb_user_mb_group_type = 2 where mb_user_mb_group_type = 1 ;
+UPDATE mb_user_mb_group set mb_user_mb_group_type = 1 where mb_user_mb_group_type IS NULL;
+
+-- Table: mb_role
+
+-- DROP TABLE mb_role;
+
+CREATE TABLE mb_role
+(
+  role_id serial NOT NULL,
+  role_name character varying(50),
+  role_description character varying(255),
+  role_exclude_auth integer NOT NULL DEFAULT 0,
+  CONSTRAINT role_id PRIMARY KEY (role_id)
+)
+WITH (
+  OIDS=FALSE
+);
+ALTER TABLE mb_role OWNER TO postgres;
+
+
+--things to be done for mb_user_mb_group table:
+--drop old constraint
+--Allow to be member in a group with different roles
+ALTER TABLE mb_user_mb_group DROP CONSTRAINT pk_fkey_mb_user_mb_group_id;
+
+UPDATE mb_user_mb_group SET mb_user_mb_group_type = 1 WHERE mb_user_mb_group_type IS NULL OR mb_user_mb_group_type = 0;
+
+--default to standard role
+ALTER TABLE mb_user_mb_group ALTER COLUMN mb_user_mb_group_type SET DEFAULT 1;
+
+-- Constraint: pk_fkey_mb_user_mb_group_id
+
+-- ALTER TABLE mb_user_mb_group DROP CONSTRAINT pk_fkey_mb_user_mb_group_id;
+--create new constraint
+ALTER TABLE mb_user_mb_group
+  ADD CONSTRAINT pk_fkey_mb_user_mb_group_id PRIMARY KEY(fkey_mb_user_id, fkey_mb_group_id, mb_user_mb_group_type);
+
+
+
+--things for the role table
+--standard roles:
+INSERT INTO mb_role (role_name,role_description,role_exclude_auth) VALUES ('standard role','No special role - old behaviour.',0);
+
+INSERT INTO mb_role (role_name,role_description,role_exclude_auth) VALUES ('primary','Primary group for a mapbender user.',0);
+
+INSERT INTO mb_role (role_name,role_description,role_exclude_auth) VALUES ('metadata editor','Group for which the user can edit and publish metadata.',1);
+
+--constraint for new role system
+-- ALTER TABLE mb_user_mb_group DROP CONSTRAINT fkey_mb_user_mb_group_role_id;
+
+ALTER TABLE mb_user_mb_group
+  ADD CONSTRAINT fkey_mb_user_mb_group_role_id FOREIGN KEY (mb_user_mb_group_type)
+      REFERENCES mb_role (role_id) MATCH SIMPLE
+      ON UPDATE CASCADE ON DELETE CASCADE;
+
+--link for admin1
+INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, 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, e_url) VALUES('admin1','Group_User_Role',2,1,'allocate groups to user and roles','','a','','href = "../php/mod_group_user_role.php?sessionID&e_id_css=Group_User_Role" target = "AdminFrame" ',10,1234,200,20,NULL ,'font-family: Arial, Helvetica, sans-serif; font-size : 12px; text-decoration : none;color: #808080;','GROUP -> USER -> ROLE','a','','','','AdminFrame','http://www.mapbender.org/index.php/user');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('admin1', 'Group_User_Role', 'file css', '../css/administration_alloc.css', 'file css' ,'file/css');
+
+--update the group for the decentral registrating institutions
+-- View: registrating_groups
+CREATE OR REPLACE VIEW registrating_groups AS 
+ SELECT f.fkey_mb_group_id, f.fkey_mb_user_id
+   FROM mb_user_mb_group f, mb_user_mb_group s
+  WHERE f.mb_user_mb_group_type = 2 AND s.fkey_mb_group_id = 36 AND f.fkey_mb_user_id = s.fkey_mb_user_id
+  ORDER BY f.fkey_mb_group_id, f.fkey_mb_user_id;
+--*****end of role concept****
+
 --
 -- Fix for ticket #795
 --
 UPDATE gui_element SET e_target = 'pan1' WHERE e_id = 'toggleModule';
 
+
+
+

Modified: branches/marc_dev/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- branches/marc_dev/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-03-28 19:16:52 UTC (rev 7722)
@@ -1763,7 +1763,7 @@
 
 #: ../http/php/mod_abo_show.php:41
 msgid "Confirmation of subscribers notification"
-msgstr "Bestätigung der Abonenntenbenachrichtigung"
+msgstr "Bestätigung der Abonnentenbenachrichtigung"
 
 #: ../http/php/mod_abo_show.php:43
 msgid "Mapbender monitoring subscriber"
@@ -1771,7 +1771,7 @@
 
 #: ../http/php/mod_abo_show.php:44
 msgid "Mapbender subscribers notification"
-msgstr "Abonenntenbenachrichtigung"
+msgstr "Abonnentenbenachrichtigung"
 
 #: ../http/php/mod_abo_show.php:45
 msgid "The following services are affected"
@@ -1779,11 +1779,11 @@
 
 #: ../http/php/mod_abo_show.php:46
 msgid "e-mail form for notifications to the subscribers of the following WMS"
-msgstr ""
+msgstr "EMail Formular für die Benachrichtigung der Abonnenten folgender WMS "
 
 #: ../http/php/mod_abo_show.php:47
 msgid "Subscriber notification for Mapbender service providers"
-msgstr ""
+msgstr "Abo Benachrichtigung für die Anbieter von OWS"
 
 #: ../http/php/mod_abo_show.php:48
 msgid "Notifications have been sent. You will receive a confirmation mail shortly."
@@ -1795,7 +1795,7 @@
 
 #: ../http/php/mod_abo_show.php:50
 msgid "The subscribers to these WMS have been notified"
-msgstr "Die Abonnenten folgender WMS wurde benachrichtigt"
+msgstr "Die Abonnenten folgender WMS wurden benachrichtigt"
 
 #: ../http/php/mod_abo_show.php:51
 msgid "For further inquiries contact"
@@ -1867,8 +1867,8 @@
 msgstr ""
 
 #: ../http/php/mod_customTree.php:220
-msgid "Konfigure tree"
-msgstr ""
+msgid "Configure tree"
+msgstr "Konfiguriere Layerbaum"
 
 #: ../http/php/mod_customTree.php:221
 msgid "Please select a gui which its tree should be configured."
@@ -1907,13 +1907,13 @@
 
 #: ../http/php/mod_loadwmc_server.php:50
 msgid "WMC could not be deleted."
-msgstr ""
+msgstr "WMC konnte nicht gelöscht werden."
 
 #: ../http/php/mod_loadwmc_server.php:78
 #: ../http/php/mod_loadwmc_server.php:87
 #: ../http/php/mod_loadwmc_server.php:101
 msgid "WMC could not be loaded."
-msgstr ""
+msgstr "WMC konnte nicht geladen werden"
 
 #: ../http/php/mod_loadwmc_server.php:132
 msgid "WMC could not be merged."
@@ -1921,23 +1921,27 @@
 
 #: ../http/php/mod_loadwmc_server.php:163
 msgid "WMC could not be appended."
-msgstr ""
+msgstr "WMC konnte nicht angefügt werden."
 
 #: ../http/php/mod_loadwmc_server.php:174
 msgid "Updated public flag"
-msgstr ""
+msgstr "Öffentlichkeitsflag wurde aktualisiert"
 
 #: ../http/php/mod_loadwmc_server.php:177
 msgid "could not update public flag"
-msgstr ""
+msgstr "Kann Öffentlichkeitsflag nicht aktualisieren."
 
+#: ../http/php/mod_loadwmc_server.php
+msgid "Save configuration as WebMapContext document"
+msgstr "Speichere Konfiguration als WebMapContext Dokument"
+
 #: ../http/php/mod_map_messages.php:30
 msgid "The following WMS do not support the current SRS"
 msgstr "Folgende WMS unterstützen das verwendete Koordinatenbezugssystem nicht "
 
 #: ../http/php/mod_meetingPoint.php:222
 msgid "Input too long. Maximum of allowed characters is"
-msgstr ""
+msgstr "Eingabe zu lang. Maximale Stellenzahl "
 
 #: ../http/php/mod_savewmc_server.php:75
 msgid "saved wmc document to session"
@@ -1946,13 +1950,15 @@
 #: ../http/php/mod_savewmc_server.php:84
 #: ../http/php/mod_savewmc_server.php:91
 msgid "WMC document must have a title."
-msgstr ""
+msgstr "WebMapContext Dokument braucht einen Titel"
 
 #: ../http/php/mod_savewmc_server.php:117
-#, php-format
-msgid "WMC %s has been saved."
-msgstr ""
+msgid "WMC"
+msgstr "WMC"
 
+msgid "has been saved."
+msgstr "wurde gespeichert."
+
 #: ../http/javascripts/mod_savewmc.js
 msgid "New / overwrite"
 msgstr "Neu / überschreiben"
@@ -1986,7 +1992,7 @@
 
 #: ../http/javascripts/mod_georss.php:67
 msgid "mapframe: "
-msgstr ""
+msgstr "Kartenrahmen: "
 
 #: ../http/javascripts/mod_georss.php:76
 #: ../http/javascripts/mod_georss.php:121
@@ -2135,19 +2141,19 @@
 
 #: ../lib/editUser.php:470
 msgid "Postal Code"
-msgstr ""
+msgstr "Postleitzahl"
 
 #: ../lib/editUser.php:486
 msgid "Organization"
-msgstr ""
+msgstr "Organisation"
 
 #: ../lib/editUser.php:494
 msgid "Department"
-msgstr ""
+msgstr "Behörde"
 
 #: ../lib/editUser.php:502
 msgid "Position"
-msgstr ""
+msgstr "Position"
 
 #: ../lib/editUser.php:543
 msgid "Login_count"
@@ -2305,12 +2311,18 @@
 msgid "Preview saved"
 msgstr "Vorschau gespeichert"
 
-msgid "Preview saved - but following service urls are not included cause the firewall prevent this!"
-msgstr "Vorschau gespeichert - aber folgende Dienste fehlen, weil die Firewall sie rausschmeißt!"
+msgid "Preview saved - but following service urls are not included !"
+msgstr "Vorschau gespeichert - aber folgende Dienste fehlen! "
 
 msgid "Preview could not be created"
 msgstr "Vorschau konnte nicht gespeichert werden"
 
+msgid "Loading application: "
+msgstr "Lade Anwendung: "
+
+msgid "please wait ... "
+msgstr "Bitte warten ... "
+
 #:../tools/mod_mailAbo.php
-msgid "test1"
-msgstr "test2"
+msgid "Mapbender was unable to access the services listed above. These service may be unreachable on short notice. Please contact the service provider listed in the service metadata. You will find the metadata by following the link mentioned above. Note: This e-mail has been sent automatically because you subscribed to this service. You can unsubscribe by logging in and clicking the unsubscribe button in the Mapbender metadata dialogue."
+msgstr "Das GeoPortal hat Probleme beim Zugriff auf die oben in dieser E-Mail genannten Dienste. Es ist möglich, dass diese kurzfristig nicht verfügbar sind. Weitere Informationen erhalten Sie auf Anfrage beim Dienstebereitsteller, der in den Metadaten des Dienstes angegeben ist. Folgen Sie dazu dem oben in dieser E-Mail aufgeführten Link. Hinweis: Diese E-Mail wurde automatisiert erzeugt und der Versand von Ihnen beantragt. Diese E-Mail-Benachrichtigung können Sie jederzeit abbestellen, indem Sie das Abonnement über die Metadatenanzeige im GeoPortal deaktivieren."

Copied: branches/marc_dev/tools/build_dist.sh (from rev 7721, trunk/mapbender/tools/build_dist.sh)
===================================================================
--- branches/marc_dev/tools/build_dist.sh	                        (rev 0)
+++ branches/marc_dev/tools/build_dist.sh	2011-03-28 19:16:52 UTC (rev 7722)
@@ -0,0 +1,18 @@
+#!/bin/bash
+TMPDIR=`mktemp -d`
+OLDPWD=$PWD
+
+echo $TMPDIR
+svn export . $TMPDIR/mapbender
+
+cd $TMPDIR
+rm -rf mapbender/build mapbender/test
+rm -rf mapbender/resources/mapbender-2.6-i386
+
+NaturalDocs --exclude-input mapbender/http/extensions/  --exclude-input mapbender/resources --exclude-input mapbender/tools -i mapbender/ -o html mapbender/documents/api_js -p mapbender/documents/api_js 
+
+zip -r mapbender.zip mapbender/
+
+cd $OLDPWD
+cp $TMPDIR/mapbender.zip .
+rm -rf $TMPDIR

Modified: branches/marc_dev/tools/mod_mailAbo.php
===================================================================
--- branches/marc_dev/tools/mod_mailAbo.php	2011-03-24 15:55:46 UTC (rev 7721)
+++ branches/marc_dev/tools/mod_mailAbo.php	2011-03-28 19:16:52 UTC (rev 7722)
@@ -38,7 +38,7 @@
 	$cnt++;
 }
 $cnt=0;
-$mail_user_topic = _mb("Mapbender subscribers notification"); // "GeoPortal.rlp Mitteilung WMS Abonennten"
+$mail_user_topic = _mb("Mapbender subscribers notification"); // "GeoPortal.rlp Mitteilung WMS Abonnenten"
 $number_of_users_text = _mb("Number of users"); // "Zahl der eingetragenen User IDs"
 $subscribed_wms_text = _mb("All WMS subscribed by this user"); // "Alle abonnierten WMS des Users"
 $wms_with_problems_text = _mb("WMS with problems"); // "WMS mit Problemen"
@@ -47,7 +47,7 @@
 $body_text = _mb("Mapbender was unable to access the services listed above. " . 
 	"These service may be unreachable on short notice. Please contact the " . 
 	"service provider listed in the service metadata. You will find the " . 
-	"metadata by following the link mentioned above.\n" . 
+	"metadata by following the link mentioned above. " . 
 	"Note: This e-mail has been sent automatically because you subscribed " . 
 	"to this service. You can unsubscribe by logging in and clicking the " . 
 	"unsubscribe button in the Mapbender metadata dialogue."
@@ -104,11 +104,15 @@
 		$res_wms_t = db_prep_query($sql, $v_wms_t, $t_wms_t);
 		$row_wms_t = db_fetch_array($res_wms_t);
 		if ($wms_monitor_status == '-1') {
-			$metadataUrl = preg_replace(
-				"/(.*)frames\/login.php/", 
-				"$1php/mod_layerMetadata.php?id=", 
-				LOGIN
-			);
+			if (isset(MAPBENDER_PATH) && MAPBENDER_PATH != '') {
+				$metadataUrl = MAPBENDER_PATH."/php/mod_showMetadata.php?resource=layer&id=";
+			} else {
+				$metadataUrl = preg_replace(
+					"/(.*)frames\/login.php/", 
+					"$1php/mod_showMetadata.php?resource=layer&id=", 
+					LOGIN
+				);
+			}
 			echo "WMS: ".$wmsid."\n";
 			$body .= _mb($wms_unreachable_text, $row_wms_t["wms_title"], $wmsid) . 
 				" (" . $wms_monitor_timestamp_end . ")\n" . 



More information about the Mapbender_commits mailing list