[Mapbender-commits] r7714 - in trunk/mapbender/http: css geoportal php plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Mar 21 11:38:07 EDT 2011


Author: armin11
Date: 2011-03-21 08:38:07 -0700 (Mon, 21 Mar 2011)
New Revision: 7714

Added:
   trunk/mapbender/http/css/metadataNew.css
Modified:
   trunk/mapbender/http/geoportal/mod_initialStartWmc.php
   trunk/mapbender/http/php/mod_callMetadata.php
   trunk/mapbender/http/php/mod_getWmcDisclaimer.php
   trunk/mapbender/http/php/tagCloud.php
   trunk/mapbender/http/plugins/mb_print.php
Log:
Bugfixes: i18 for button of new print module, new hostname whitelist for some special scripts.

Added: trunk/mapbender/http/css/metadataNew.css
===================================================================
--- trunk/mapbender/http/css/metadataNew.css	                        (rev 0)
+++ trunk/mapbender/http/css/metadataNew.css	2011-03-21 15:38:07 UTC (rev 7714)
@@ -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;	
+}

Modified: trunk/mapbender/http/geoportal/mod_initialStartWmc.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_initialStartWmc.php	2011-03-17 16:38:31 UTC (rev 7713)
+++ trunk/mapbender/http/geoportal/mod_initialStartWmc.php	2011-03-21 15:38:07 UTC (rev 7714)
@@ -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: trunk/mapbender/http/php/mod_callMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_callMetadata.php	2011-03-17 16:38:31 UTC (rev 7713)
+++ trunk/mapbender/http/php/mod_callMetadata.php	2011-03-21 15:38:07 UTC (rev 7714)
@@ -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: trunk/mapbender/http/php/mod_getWmcDisclaimer.php
===================================================================
--- trunk/mapbender/http/php/mod_getWmcDisclaimer.php	2011-03-17 16:38:31 UTC (rev 7713)
+++ trunk/mapbender/http/php/mod_getWmcDisclaimer.php	2011-03-21 15:38:07 UTC (rev 7714)
@@ -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: trunk/mapbender/http/php/tagCloud.php
===================================================================
--- trunk/mapbender/http/php/tagCloud.php	2011-03-17 16:38:31 UTC (rev 7713)
+++ trunk/mapbender/http/php/tagCloud.php	2011-03-21 15:38:07 UTC (rev 7714)
@@ -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: trunk/mapbender/http/plugins/mb_print.php
===================================================================
--- trunk/mapbender/http/plugins/mb_print.php	2011-03-17 16:38:31 UTC (rev 7713)
+++ trunk/mapbender/http/plugins/mb_print.php	2011-03-21 15:38:07 UTC (rev 7714)
@@ -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");?>");
 	};
 
 	/**



More information about the Mapbender_commits mailing list