[Mapbender-commits] r8806 - in trunk/mapbender/http: classes php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Mar 26 10:06:55 PDT 2014
Author: armin11
Date: 2014-03-26 10:06:55 -0700 (Wed, 26 Mar 2014)
New Revision: 8806
Modified:
trunk/mapbender/http/classes/class_wfsToDb.php
trunk/mapbender/http/php/mod_wfs_server.php
Log:
allow update of authenticated wfs
Modified: trunk/mapbender/http/classes/class_wfsToDb.php
===================================================================
--- trunk/mapbender/http/classes/class_wfsToDb.php 2014-03-26 07:53:48 UTC (rev 8805)
+++ trunk/mapbender/http/classes/class_wfsToDb.php 2014-03-26 17:06:55 UTC (rev 8806)
@@ -171,6 +171,7 @@
$aWfs->auth['password'] = "";
$aWfs->auth['auth_type'] = "";
}
+ $e = new mb_exception("awfs_username: ".$aWfs->auth['username']);
$admin = new administration();
db_begin();
Modified: trunk/mapbender/http/php/mod_wfs_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_server.php 2014-03-26 07:53:48 UTC (rev 8805)
+++ trunk/mapbender/http/php/mod_wfs_server.php 2014-03-26 17:06:55 UTC (rev 8806)
@@ -234,9 +234,17 @@
function updateWfs($obj){
$id = $obj->wfs;
$url = $obj->url;
+ //get authentication information from db
+ $sql = "SELECT wfs_auth_type, wfs_username, wfs_password from wfs WHERE wfs_id = $1 ";
+ $v = array($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"];
$wfsFactory = new UniversalWfsFactory();
- $myWfs = $wfsFactory->createFromUrl($url);
- //TODO Problem: How to handle authenticated wfs - the old object should be pulled to get the auth information
+ $myWfs = $wfsFactory->createFromUrl($url, $auth);
if (!MD_OVERWRITE) {
$myWfs->overwrite = false;
}
More information about the Mapbender_commits
mailing list