[Mapbender-commits] r10032 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jan 17 11:15:32 PST 2019
Author: armin11
Date: 2019-01-17 11:15:32 -0800 (Thu, 17 Jan 2019)
New Revision: 10032
Modified:
trunk/mapbender/http/classes/class_wfs.php
trunk/mapbender/http/classes/class_wfsToDb.php
Log:
Allow the registrating of wfs via cli
Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php 2019-01-17 19:14:49 UTC (rev 10031)
+++ trunk/mapbender/http/classes/class_wfs.php 2019-01-17 19:15:32 UTC (rev 10032)
@@ -591,8 +591,8 @@
*
* @return Boolean
*/
- public function insertOrUpdate () {
- return WfsToDb::insertOrUpdate($this);
+ public function insertOrUpdate ($owner=false) {
+ return WfsToDb::insertOrUpdate($this, $owner);
}
/**
Modified: trunk/mapbender/http/classes/class_wfsToDb.php
===================================================================
--- trunk/mapbender/http/classes/class_wfsToDb.php 2019-01-17 19:14:49 UTC (rev 10031)
+++ trunk/mapbender/http/classes/class_wfsToDb.php 2019-01-17 19:15:32 UTC (rev 10032)
@@ -34,11 +34,11 @@
* @return Boolean
* @param $aWfs Wfs
*/
- public function insertOrUpdate ($aWfs) {
+ public function insertOrUpdate ($aWfs, $owner=false) {
if (WfsToDb::exists($aWfs)) {
return WfsToDb::update($aWfs);
}
- return WfsToDb::insert($aWfs);
+ return WfsToDb::insert($aWfs, $owner);
}
/**
@@ -47,7 +47,7 @@
* @return Boolean
* @param $aWfs Wfs
*/
- public static function insert ($aWfs) {
+ public static function insert ($aWfs, $owner=false) {
db_begin();
$uuid = new Uuid();
$sql = "INSERT INTO wfs (wfs_version, wfs_name, wfs_title, wfs_abstract, ";
@@ -70,6 +70,10 @@
//set initial wfs_owsproxy hash
$wfs_owsproxy = md5(microtime(1));
}
+ $wfsOwner = Mapbender::session()->get("mb_user_id");
+ if ($owner !== false) {
+ $wfsOwner = $owner;
+ }
$v = array(
$aWfs->getVersion(),
$aWfs->name,
@@ -94,7 +98,7 @@
$aWfs->facsimile,
$aWfs->electronicMailAddress,
$aWfs->country,
- Mapbender::session()->get("mb_user_id"),
+ $wfsOwner,
strtotime("now"),
strtotime("now"),
$uuid,
More information about the Mapbender_commits
mailing list