[Mapbender-commits] r9141 - trunk/mapbender/http_auth/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 8 01:03:50 PST 2015
Author: armin11
Date: 2015-01-08 01:03:50 -0800 (Thu, 08 Jan 2015)
New Revision: 9141
Modified:
trunk/mapbender/http_auth/http/index.php
Log:
Possibility to exclude urls from the owsproxy in case of featureinfo requests. Sometimes there are problems with redirects and headers, and not all urls should be replaced.
Modified: trunk/mapbender/http_auth/http/index.php
===================================================================
--- trunk/mapbender/http_auth/http/index.php 2015-01-08 09:03:33 UTC (rev 9140)
+++ trunk/mapbender/http_auth/http/index.php 2015-01-08 09:03:50 UTC (rev 9141)
@@ -5,7 +5,11 @@
require(dirname(__FILE__) . "/../../http/classes/class_connector.php");
require_once(dirname(__FILE__) . "/../../http/classes/class_mb_exception.php");
require(dirname(__FILE__) . "/../../owsproxy/http/classes/class_QueryHandler.php");
-
+$urlsToExclude = array();
+if (is_file(dirname(__FILE__) . "/../../conf/excludeproxyurls.conf"))
+{
+ require_once(dirname(__FILE__) . "/../../conf/excludeproxyurls.conf");
+}
//database connection
$db = db_connect($DBSERVER, $OWNER, $PW);
db_select_db(DB, $db);
@@ -365,6 +369,8 @@
function matchUrls($content)
{
+ //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();
@@ -374,8 +380,12 @@
preg_match_all($pattern, $content, $matches);
for ($i = 0; $i < count($matches[1]); $i++) {
$req = $matches[1][$i];
- $e = new mb_exception("Gefundene URL " . $i . ": " . $req);
+ $e = new mb_notice("Gefundene URL " . $i . ": " . $req);
#$notice = new mb_notice("owsproxy id:".$req);
+ //only register and exchange urls, that should not be excluded!
+ if (in_array($req,$urlsToExclude)) {
+ continue;
+ }
$id = registerURL($req);
$extReq = setExternalRequest($id);
$e = new mb_exception("MD5 URL " . $id . "-Externer Link: " . $extReq);
More information about the Mapbender_commits
mailing list