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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 21 06:07:01 PST 2016


Author: armin11
Date: 2016-01-21 06:07:01 -0800 (Thu, 21 Jan 2016)
New Revision: 9385

Modified:
   trunk/mapbender/http/classes/class_administration.php
Log:
Some function needed for module that shows wfs log entries

Modified: trunk/mapbender/http/classes/class_administration.php
===================================================================
--- trunk/mapbender/http/classes/class_administration.php	2016-01-21 14:06:22 UTC (rev 9384)
+++ trunk/mapbender/http/classes/class_administration.php	2016-01-21 14:07:01 UTC (rev 9385)
@@ -318,7 +318,7 @@
 	}
 
     /**
-     * returns one or more owners for the given wm_id. First all guis deploying
+     * returns one or more owners for the given wms_id. First all guis deploying
      * this wms are selected. Afterwards for each of the guis the owners are
      * selected and stored within an array.
      *
@@ -389,7 +389,27 @@
           return false;
         }
 	}
+
     /**
+     * returns owner for the given wfs_id.
+     *
+     * @param	integer		the wfs_id
+     * @return	integer		the owners mb_user_id
+     */
+	function getOwnerByWfs($wfs_id){
+        	$sql = "SELECT wfs_owner FROM wfs WHERE wfs_id = $1";
+		$v = array($wfs_id);
+		$t = array('i');
+		$res = db_prep_query($sql,$v,$t);
+		if (!$res) {
+			return false;
+		} else {
+			$row = db_fetch_array($res);
+			return $row["wfs_owner"];
+		}
+	}
+
+    /**
      * tests whether a gui with the passed gui_id exits and returns true or false.
      *
      * @param	string		the gui_id to test
@@ -570,7 +590,7 @@
      * @return string|boolean 	either the title of the wms as string or false when none exists
      */
 	function getWmsTitleByWmsId($id){
-		$sql = "SELECT wms_title FROM wms WHERE wms_id = $1 GROUP BY wms_title";
+		$sql = "SELECT wms_title FROM wms WHERE wms_id = $1";
 		$v = array($id);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
@@ -585,7 +605,7 @@
      * @return string|boolean 	either the title of the wfs as string or false when none exists
      */
 	function getWfsTitleByWfsId($id){
-		$sql = "SELECT wfs_title FROM wfs WHERE wfs_id = $1 GROUP BY wfs_title";
+		$sql = "SELECT wfs_title FROM wfs WHERE wfs_id = $1";
 		$v = array($id);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);



More information about the Mapbender_commits mailing list