[Mapbender-commits] r9978 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 19 06:08:52 PDT 2018


Author: armin11
Date: 2018-10-19 06:08:52 -0700 (Fri, 19 Oct 2018)
New Revision: 9978

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
Alter class to allow invocation from cli to register services before installation

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2018-10-12 12:40:08 UTC (rev 9977)
+++ trunk/mapbender/http/classes/class_wms.php	2018-10-19 13:08:52 UTC (rev 9978)
@@ -1818,9 +1818,9 @@
 	/**
 	* writeObjInDB
 	*
-	* this function exports the information from the xml to the mapbender database 
+	* this function exports the information from the xml to the mapbender database, defaults owner to root if invoked from cli
 	*/
-	function writeObjInDB($gui_id){
+	function writeObjInDB($gui_id, $cli=false, $ownerId=1){
 		global $con;
 		if (func_num_args() == 2) { //new for HTTP Authentication
 			$auth = func_get_arg(1);
@@ -1843,6 +1843,12 @@
 		
 		db_begin();
 	
+		if ($cli == true) {
+			$userId = $ownerId;
+		} else {
+			$userId = Mapbender::session()->get('mb_user_id');
+		}
+
 		# TABLE wms
 		$sql = "INSERT INTO wms (wms_version, wms_title, wms_abstract, wms_getcapabilities, wms_getmap, ";
 		$sql.= "wms_getfeatureinfo, wms_getlegendurl, wms_getcapabilities_doc, wms_upload_url, fees, ";
@@ -1874,7 +1880,7 @@
 			$this->contactvoicetelephone,
 			$this->contactfacsimiletelephone,
 			$this->contactelectronicmailaddress,
-			Mapbender::session()->get('mb_user_id'),
+			$userId,
 			strtotime("now"),
 			strtotime("now"),
 			$username,



More information about the Mapbender_commits mailing list