[Mapbender-commits] r9774 - in trunk/mapbender/http: classes extensions
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Aug 25 02:01:59 PDT 2017
Author: armin11
Date: 2017-08-25 02:01:58 -0700 (Fri, 25 Aug 2017)
New Revision: 9774
Modified:
trunk/mapbender/http/classes/class_ows.php
trunk/mapbender/http/classes/class_ows_factory.php
trunk/mapbender/http/classes/class_wfs.php
trunk/mapbender/http/classes/class_wfs_factory.php
trunk/mapbender/http/extensions/geom2wfst.php
Log:
Fix for digitizing objects via wfs-t and external http_digest authentication
Modified: trunk/mapbender/http/classes/class_ows.php
===================================================================
--- trunk/mapbender/http/classes/class_ows.php 2017-08-23 15:54:02 UTC (rev 9773)
+++ trunk/mapbender/http/classes/class_ows.php 2017-08-25 09:01:58 UTC (rev 9774)
@@ -126,7 +126,6 @@
$connection->set("httpType", "post");
$connection->set("httpContentType", "text/xml");
$connection->set("httpPostData", $postData);
- //$e = new mb_notice("OWS REQUEST: " . $url . "\n\n" . $postData);
if (!$this->auth) {
$data = $connection->load($url);
} else {
Modified: trunk/mapbender/http/classes/class_ows_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_ows_factory.php 2017-08-23 15:54:02 UTC (rev 9773)
+++ trunk/mapbender/http/classes/class_ows_factory.php 2017-08-25 09:01:58 UTC (rev 9774)
@@ -24,8 +24,13 @@
* creating OGC Web Services (OWS).
*/
abstract class OwsFactory {
-
/**
+ * Variable controls, if the proxy urls should be used when creating the ows object, otherwise the
+ * orig
+ */
+ public $returnProxyUrls = false;
+
+ /**
* Creates an OWS from an XML, presumably a capabilities document.
*
* @return Ows
Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php 2017-08-23 15:54:02 UTC (rev 9773)
+++ trunk/mapbender/http/classes/class_wfs.php 2017-08-25 09:01:58 UTC (rev 9774)
@@ -265,7 +265,6 @@
$e = new mb_exception("Invalid transaction method: " . $method);
return null;
}
-
$postData = $this->wrapTransaction($featureType, $requestData);
return $this->post($this->transaction, $postData); //from class_ows!
}
Modified: trunk/mapbender/http/classes/class_wfs_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_factory.php 2017-08-23 15:54:02 UTC (rev 9773)
+++ trunk/mapbender/http/classes/class_wfs_factory.php 2017-08-25 09:01:58 UTC (rev 9774)
@@ -65,7 +65,11 @@
else {
return null;
}
- $withProxyUrls = true;
+ /*
+ //From class_ows_factory.php :
+ if ($this->returnProxyUrls == true) {
+ $e = new mb_exception("return proxy urls: true");
+ }*/
// WFS
$sql = "SELECT * FROM wfs WHERE wfs_id = $1;";
$v = array($id);
@@ -89,20 +93,21 @@
$aWfs->getCapabilitiesDoc = db_result($res, $cnt, "wfs_getcapabilities_doc");
$aWfs->uploadUrl = db_result($res, $cnt, "wfs_upload_url");
$aWfs->describeFeatureType = db_result($res, $cnt, "wfs_describefeaturetype");
- if(!$hasOwsproxyUrl || !$withProxyUrls){
+ //TODO check why this switch is used and in which cases this is relevant
+ if($this->returnProxyUrls == false){
$aWfs->getFeature = db_result($res, $cnt, "wfs_getfeature");
+ new mb_notice("class_wfs_factory.getFeature.url: don't use proxy");
}
else{
$aWfs->getFeature = $owsproxyUrl;
}
new mb_notice("class_wfs_factory.getFeature.url: ".$aWfs->getFeature);
- if(!$hasOwsproxyUrl || !$withProxyUrls){
+ if($this->returnProxyUrls == false){
$aWfs->transaction = db_result($res, $cnt, "wfs_transaction");
}
else{
$aWfs->transaction = $owsproxyUrl;
- }
-
+ }
$aWfs->fees = db_result($res, $cnt, "fees");
$aWfs->accessconstraints = db_result($res, $cnt, "accessconstraints");
$aWfs->owner = db_result($res, $cnt, "wfs_owner");
Modified: trunk/mapbender/http/extensions/geom2wfst.php
===================================================================
--- trunk/mapbender/http/extensions/geom2wfst.php 2017-08-23 15:54:02 UTC (rev 9773)
+++ trunk/mapbender/http/extensions/geom2wfst.php 2017-08-25 09:01:58 UTC (rev 9774)
@@ -47,6 +47,8 @@
}
$myWfsFactory = new UniversalWfsFactory();
+//don't return proxy urls cause the request should go directly to the server
+$myWfsFactory->returnProxyUrls = false;
$myWfs = $myWfsFactory->createFromDb($wfsConf->wfsId);
if (is_null($myWfs)) {
@@ -64,4 +66,4 @@
header("Content-Type:application/x-json");
$json = new Mapbender_JSON();
echo $json->encode($resObj);
-?>
\ No newline at end of file
+?>
More information about the Mapbender_commits
mailing list