[Mapbender-commits] r10056 - in trunk/mapbender: core http/classes http/extensions/mobilemap2/scripts/netgis http/frames http/php resources/db tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun Feb 17 12:41:01 PST 2019


Author: armin11
Date: 2019-02-17 12:41:01 -0800 (Sun, 17 Feb 2019)
New Revision: 10056

Modified:
   trunk/mapbender/core/globalSettings.php
   trunk/mapbender/http/classes/class_connector.php
   trunk/mapbender/http/classes/class_weldMaps2JPEG.php
   trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js
   trunk/mapbender/http/frames/index.php
   trunk/mapbender/http/php/mb_validateSession.php
   trunk/mapbender/http/php/mod_editGuiWms.php
   trunk/mapbender/resources/db/install_geoportal_mb28.sh
   trunk/mapbender/tools/mod_monitorCapabilities_main.php
Log:
Option to transmit cookies via curl requests. So?\195?\182lve some further problems.

Modified: trunk/mapbender/core/globalSettings.php
===================================================================
--- trunk/mapbender/core/globalSettings.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/core/globalSettings.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -22,7 +22,6 @@
 // constants
 //
 require_once(dirname(__FILE__)."/../core/system.php");
-
 //
 // initiates the session-handling
 //
@@ -87,6 +86,12 @@
         }
     }
 }
+//debug
+/*foreach ($_COOKIE as $key => $value) {
+    if ($key == "MAPBENDER") {
+        $e = new mb_exception("core/globalSettinmgs.php: cookie name: ".$key."cookie value: ".$value);
+    }
+}*/
 
 function getUserData ($userId){
 	$con = db_connect(DBSERVER,OWNER,PW);

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/http/classes/class_connector.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -35,7 +35,7 @@
 	private $httpContentType;
 	private $httpPostFieldsNumber;
 	private $curlSendCustomHeaders = true; //decide to send own headers or not
-	private $curlCookiesession = true;
+	private $curlSessionCookie = false;
 	private $externalHeaders = "";
 
 
@@ -170,6 +170,10 @@
 				$this->externalHeaders = $value;
 				break;
 
+			case "curlSessionCookie":
+				$this->curlSessionCookie = $value;
+				break;
+
 			case "httpContentType":
 				if ($this->isValidHttpContentType($value)) {
 					$this->httpContentType = $value;
@@ -222,6 +226,10 @@
 		curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
 		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeOut);
+		if ($this->curlSessionCookie !== false) {
+			curl_setopt($ch,CURLOPT_COOKIE, $this->curlSessionCookie);
+			//$e = new mb_exception("class_connector: cookie ".$this->curlSessionCookie);	
+		}
 		//$e = new mb_notice("connector: test1:");
 		//get hostname/ip out of url
 		//$host = parse_url($url,PHP_URL_HOST);

Modified: trunk/mapbender/http/classes/class_weldMaps2JPEG.php
===================================================================
--- trunk/mapbender/http/classes/class_weldMaps2JPEG.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/http/classes/class_weldMaps2JPEG.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -139,6 +139,7 @@
 		//$x->set("curlSendCustomHeaders",true);
 		//$x->set("externalHeaders", $headers);
 		//$f = $obj->get("format");
+$e = new mb_exception($imgurl);
 		$im = imagecreatefromstring($x->load($imgurl));
 		if(!$im){
 			$im = false;

Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js	2019-02-17 20:41:01 UTC (rev 10056)
@@ -52,8 +52,9 @@
 	URL_SEARCH_PROXY:		"./scripts/proxy.php",
 	URL_SEARCH_REQUEST:		"http://www.geoportal.rlp.de/mapbender/geoportal/gaz_geom_mobile.php",
 	
-	URL_BACKGROUND_HYBRID:	"http://www.gdi-rp-dienste2.rlp.de/mapcache/tms/1.0.0/test@UTM32",
-	URL_BACKGROUND_AERIAL:	"http://geo4.service24.rlp.de/wms/dop_basis.fcgi",
+	URL_BACKGROUND_HYBRID:	        "http://www.gdi-rp-dienste2.rlp.de/mapcache/tms/1.0.0/topplusbkg@UTM32",
+	//URL_BACKGROUND_HYBRID:	"http://www.gdi-rp-dienste2.rlp.de/mapcache/tms/1.0.0/test@UTM32",
+	URL_BACKGROUND_AERIAL:	        "http://geo4.service24.rlp.de/wms/dop_basis.fcgi",
 
 	URL_FEATURE_INFO_PROXY:	"./scripts/proxy.php",
 	

Modified: trunk/mapbender/http/frames/index.php
===================================================================
--- trunk/mapbender/http/frames/index.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/http/frames/index.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -35,6 +35,7 @@
 $encodingType = "base64";
 $encodeResult = true;
 $minify = true;
+
 //new for geoportal.rlp - some guis has special functions - for normal mapbender installation this doesn't matter
 if (Mapbender::session()->get("mb_user_gui") !== false) {
 	Mapbender::session()->set("previous_gui",Mapbender::session()->get("mb_user_gui"));
@@ -357,7 +358,8 @@
 function replaceBodyWithElement($html, $elementName = 'div') {
     //https://stackoverflow.com/questions/6892199/how-can-i-grab-the-entire-content-inside-body-tag-with-regex
     preg_match("/<body[^>]*>(.*?)<\/body>/is", $html, $matches);
-    $result = "<".$elementName.">".$matches[1]."</".$elementName.">";
+    $result = "<".$elementName." id='body'>".$matches[1]."</".$elementName.">";
+    //$result = "<".$elementName.">".$matches[1]."</".$elementName.">";
     //$e = new mb_exception($result);
     return $result;
 }

Modified: trunk/mapbender/http/php/mb_validateSession.php
===================================================================
--- trunk/mapbender/http/php/mb_validateSession.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/http/php/mb_validateSession.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -21,10 +21,10 @@
 
 $e = new mb_notice("mb_validateSession.php: checking file " . $_SERVER["SCRIPT_NAME"]);
 
-// if cookies are off
+// if cookies are off - TODO check this behaviour!!!
 if ($_REQUEST["sessionName"] && $_REQUEST["sessionId"]) { //TODO: the request parameter won't be sessionName but maybe PHPSESSID - name of cookie! See line 101 usage of SID
-	session_name($_REQUEST["sessionName"]);
-	session_id($_REQUEST["sessionId"]);
+	//session_name($_REQUEST["sessionName"]);
+	//session_id($_REQUEST["sessionId"]);
 }
 //
 // check if user data is valid; if not, return to login screen

Modified: trunk/mapbender/http/php/mod_editGuiWms.php
===================================================================
--- trunk/mapbender/http/php/mod_editGuiWms.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/http/php/mod_editGuiWms.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -527,7 +527,7 @@
 echo "<input type='hidden' name='down' value=''><br><br>";
 
 $may_delete = !isset($wmsList);
-
+//TODO - check if the other application is not the same
 if (isset($wmsList)) {
     // check if user is not owner of the wms or if the wms is still referenced in another own application
     $sql = <<<EOT

Modified: trunk/mapbender/resources/db/install_geoportal_mb28.sh
===================================================================
--- trunk/mapbender/resources/db/install_geoportal_mb28.sh	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/resources/db/install_geoportal_mb28.sh	2019-02-17 20:41:01 UTC (rev 10056)
@@ -1081,11 +1081,11 @@
 <VirtualHost *:80>
         ServerAdmin $webadmin_email
         ReWriteEngine On
-        RewriteRule ^/registry/wfs/([\d]+)\/?$ http://127.0.0.1/http_auth/http/index.php?wfs_id=$1 [P,L,QSA,NE]
-        RewriteRule ^/layer/(.*) http://%{HTTP_HOST}/mapbender/php/mod_showMetadata.php?resource=layer&languageCode=de&id=$1
-        RewriteRule ^/wms/(.*) http://%{HTTP_HOST}/mapbender/php/mod_showMetadata.php?resource=wms&languageCode=de&id=$1
-        RewriteRule ^/wmc/(.*) http://%{HTTP_HOST}/mapbender/php/mod_showMetadata.php?resource=wmc&languageCode=de&id=$1
-        RewriteRule ^/dataset/(.*) http://%{HTTP_HOST}/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=$1
+        RewriteRule ^/registry/wfs/([\d]+)\/?$ http://127.0.0.1/http_auth/http/index.php?wfs_id=\$1 [P,L,QSA,NE]
+        RewriteRule ^/layer/(.*) http://%{HTTP_HOST}/mapbender/php/mod_showMetadata.php?resource=layer&languageCode=de&id=\$1
+        RewriteRule ^/wms/(.*) http://%{HTTP_HOST}/mapbender/php/mod_showMetadata.php?resource=wms&languageCode=de&id=\$1
+        RewriteRule ^/wmc/(.*) http://%{HTTP_HOST}/mapbender/php/mod_showMetadata.php?resource=wmc&languageCode=de&id=\$1
+        RewriteRule ^/dataset/(.*) http://%{HTTP_HOST}/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=\$1
         # for mobilemap2 api
         RewriteCond %{QUERY_STRING} ^(.*)wmcid(.*)$
         RewriteRule /mapbender/extensions/mobilemap/map.php http://%{HTTP_HOST}/mapbender/extensions/mobilemap2/index.html?%1wmc_id%2
@@ -1092,7 +1092,7 @@
         RewriteCond %{QUERY_STRING} ^(.*)layerid(.*)$
         RewriteRule /mapbender/extensions/mobilemap/map.php https://%{HTTP_HOST}/mapbender/extensions/mobilemap2/index.html?%1layerid%2
         # for digitizing module
-        RewriteRule ^/icons/maki/([^/]+)/([^/]+)/([^[/]+).png$ http://127.0.0.1/mapbender/php/mod_getSymbolFromRepository.php?marker-color=$1&marker-size=$2&marker-symbol=$3 [P,L,QSA,NE]
+        RewriteRule ^/icons/maki/([^/]+)/([^/]+)/([^[/]+).png$ http://127.0.0.1/mapbender/php/mod_getSymbolFromRepository.php?marker-color=\$1&marker-size=\$2&marker-symbol=\$3 [P,L,QSA,NE]
 
 #       For typo3 installation
         DocumentRoot ${installation_folder}portal

Modified: trunk/mapbender/tools/mod_monitorCapabilities_main.php
===================================================================
--- trunk/mapbender/tools/mod_monitorCapabilities_main.php	2019-02-13 14:24:05 UTC (rev 10055)
+++ trunk/mapbender/tools/mod_monitorCapabilities_main.php	2019-02-17 20:41:01 UTC (rev 10056)
@@ -28,17 +28,30 @@
 //commandline
 $cl = false;
 
+//for debugging purposes only
+	function logit($text){
+	 	if($h = fopen("/tmp/class_monitoring_capabilities.log","a")){
+					$content = $text .chr(13).chr(10);
+					if(!fwrite($h,$content)){
+						#exit;
+					}
+					fclose($h);
+				}
+	 	
+	 }
+
+
 function getTagsOutOfXML($reportFile,$tagsToReturn, $serviceType="wms") {
 	if (file_exists($reportFile)) {
 		$xml = simplexml_load_file($reportFile);
 		if ($xml == false) {
-			$e = new mb_exception("/tools/mod_monitorCapabilities.php: could not open file: ".$reportFile);
+			//$e = new mb_exception("/tools/mod_monitorCapabilities.php: could not open file: ".$reportFile);
 		}
 		foreach($tagsToReturn as $tagName) {
 			$result[$tagName] = (string)$xml->{$serviceType}->$tagName;
 		}
 	} else {
-		$e = new mb_exception("/tools/mod_monitorCapabilities.php: could not find file: ".$reportFile);
+		//$e = new mb_exception("/tools/mod_monitorCapabilities.php: could not find file: ".$reportFile);
 	}
 	return $result;
 }
@@ -220,7 +233,6 @@
 		echo "initialize monitoring for user: " . $userid . 
 			" ".$serviceType.": " . $service_id_own[$k] . $br;
 		//$e = new mb_exception("/tools/mod_monitorCapabilities_main.php: ".$serviceType.": ".$service_id_own[$k]);
-
 		switch ($serviceType) {
 			case "WMS":
 				$sql = "INSERT INTO mb_monitor (upload_id, fkey_wms_id, " . 
@@ -362,6 +374,7 @@
 sleep(TIME_LIMIT);
 //when time limit has ended: begin to collect results for every registrating user
 for ($iz = 0; $iz < count($user_id_all); $iz++) {
+    logit("/tools/mod_monitorCapabilities.php - collect info from xml for user: ".$user_id_all[$iz]);
     //$e = new mb_exception("/tools/mod_monitorCapabilities.php - collect info from xml for user: ".$user_id_all[$iz]);
     //loop for serviceType - reinitialize all things from earlier serviceType
     //foreach ($serviceTypes as $serviceType) {
@@ -394,6 +407,7 @@
 		$cap_diff = $tags['getcapdiff'];
 		$timestamp_begin = $tags['getcapbegin'];
 		$timestamp_end = $tags['getcapend'];
+logit("try to update ".$serviceType." with id ".$service_id_own[$k]);
 		switch ($serviceType) {
 			case "WMS":
 				$map_url = rawurldecode($tags['getmapurl']);



More information about the Mapbender_commits mailing list