[Mapbender-commits] r9006 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 29 03:09:49 PDT 2014


Author: armin11
Date: 2014-07-29 03:09:49 -0700 (Tue, 29 Jul 2014)
New Revision: 9006

Modified:
   trunk/mapbender/http/php/mod_inspireDownloadFeed.php
Log:
Allow INSPIRE Download Feeds for authenticated WFS

Modified: trunk/mapbender/http/php/mod_inspireDownloadFeed.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireDownloadFeed.php	2014-07-28 10:18:26 UTC (rev 9005)
+++ trunk/mapbender/http/php/mod_inspireDownloadFeed.php	2014-07-29 10:09:49 UTC (rev 9006)
@@ -1165,7 +1165,20 @@
 				$gHLink .= $mapbenderMetadata[$i]->wfs_version."&typeName=";
 				$gHLink .= $mapbenderMetadata[$i]->featuretype_name."&resultType=hits";
 				$startRequestTime = time();
-				$hitConnector = new connector($gHLink);
+				//get auth information from database:
+				$sql = "SELECT wfs_auth_type, wfs_username, wfs_password from wfs WHERE wfs_id = $1 ";
+				$v = array($mapbenderMetadata[$i]->wfs_id);
+				$t = array('i');
+				$res = db_prep_query($sql,$v,$t);
+				$row = db_fetch_assoc($res);
+				$auth['auth_type'] = $row["wfs_auth_type"];
+				$auth['username'] = $row["wfs_username"];
+				$auth['password'] = $row["wfs_password"];
+				if (isset($auth['auth_type']) && $auth['auth_type'] != '' && isset($auth['username']) && $auth['username'] != '' && isset($auth['password']) && $auth['password'] != '') {
+					$hitConnector = new connector($gHLink,$auth);
+				} else {
+					$hitConnector = new connector($gHLink);
+				}
 				$hitXml = $hitConnector->file;
 				$e = new mb_notice($gHLink);
 				$endRequestTime = time();



More information about the Mapbender_commits mailing list