[Mapbender-commits] r9164 - trunk/mapbender/http_auth/http

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Mar 9 06:53:51 PDT 2015


Author: armin11
Date: 2015-03-09 06:53:51 -0700 (Mon, 09 Mar 2015)
New Revision: 9164

Modified:
   trunk/mapbender/http_auth/http/index.php
Log:
Bugfix for feature info over http_auth proxy

Modified: trunk/mapbender/http_auth/http/index.php
===================================================================
--- trunk/mapbender/http_auth/http/index.php	2015-03-09 12:43:13 UTC (rev 9163)
+++ trunk/mapbender/http_auth/http/index.php	2015-03-09 13:53:51 UTC (rev 9164)
@@ -348,15 +348,15 @@
  * 
  * @param string the original url of the image to send
  */
-function getImage($or)
+function getImage($log_id,$or)
 {
     global $reqParams;
     header("Content-Type: " . $reqParams['format']);
-    if (func_num_args() == 2) { //new for HTTP Authentication
-        $auth = func_get_arg(1);
-        echo getDocumentContent($or, $auth);
+    if (func_num_args() == 3) { //new for HTTP Authentication
+        $auth = func_get_arg(2);
+        getDocumentContent($log_id, $or, $header, $auth);
     } else {
-        echo getDocumentContent($or);
+        getDocumentContent($log_id, $or, $header);
     }
 }
 
@@ -391,8 +391,8 @@
 function getFeatureInfo($log_id, $url)
 {
     global $reqParams;
-    $e = new mb_notice("owsproxy: Try to fetch FeatureInfoRequest: " . $url);
-    header("Content-Type: " . $reqParams['info_format']);
+    //$e = new mb_notice("owsproxy: Try to fetch FeatureInfoRequest: " . $url);
+    //header("Content-Type: " . $reqParams['info_format']);
     if (func_num_args() == 3) { //new for HTTP Authentication
         $auth = func_get_arg(2);
         getDocumentContent($log_id, $url, false, $auth);
@@ -405,10 +405,13 @@
 {
     //TODO: problem here, we are stateless and have no information about any session :-( . To allow proxying, we need another temporal storage for the given urls 
     global $urlsToExclude;
-    if (!session_is_registered("owsproxyUrls")) {
-        $_SESSION["owsproxyUrls"] = array();
-        $_SESSION["owsproxyUrls"]["id"] = array();
-        $_SESSION["owsproxyUrls"]["url"] = array();
+    $owsproxyUrls = Mapbender::session()->get('owsproxyUrls');
+    if ($owsproxyUrls == false) {
+		$e = new mb_notice("owsproxyUrls does not exist - create it!");
+		$owsproxyUrls = array();
+		$owsproxyUrls['id'] = array();
+		$owsproxyUrls['url'] = array();
+		Mapbender::session()->set('owsproxyUrls',$owsproxyUrls);
     }
     $pattern = "/[\"|\'](https*:\/\/[^\"|^\']*)[\"|\']/";
     preg_match_all($pattern, $content, $matches);
@@ -451,7 +454,7 @@
 
             header("Content-Type: " . $metainfo['Content-Type']);
 
-            $content = getDocumentContent($cUrl, false);
+            $content = getDocumentContent(false, $cUrl, $metainfo);
             #$content = matchUrls($content); //In the case of http_auth - this is not possible cause we cannot save them in the header - maybe we could create a special session to do so later on? 			
             echo $content;
         }



More information about the Mapbender_commits mailing list