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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat May 26 09:05:15 EDT 2007


Author: marcjansen
Date: 2007-05-26 09:05:14 -0400 (Sat, 26 May 2007)
New Revision: 1369

Modified:
   trunk/mapbender/http/classes/class_administration.php
Log:
PHPdoc comments added

Modified: trunk/mapbender/http/classes/class_administration.php
===================================================================
--- trunk/mapbender/http/classes/class_administration.php	2007-05-25 15:16:40 UTC (rev 1368)
+++ trunk/mapbender/http/classes/class_administration.php	2007-05-26 13:05:14 UTC (rev 1369)
@@ -132,10 +132,10 @@
 		}
 		return $newpass;
  	}
-    
+
     /**
      * returns the name of a mapbender user which owns the GUI identified by the passed over gui_id.
-     * 
+     *
      * @param <string> the gui_id
      * @return <string> the name of the owner
      */
@@ -167,10 +167,10 @@
 		}
 		return $owner;
  	}
-    
+
     /**
      * returns the content of the field mb_user_email for the given userid.
-     * 
+     *
      * @param <integer> the userid
      * @return <mixed> the email if one row is found or false if none is foundd
      */
@@ -181,7 +181,7 @@
 		$v = array($userid);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
-		// TODO shall the next two lines be removed? 
+		// TODO shall the next two lines be removed?
         $count_g = 0;
 		$array = array();
 		$row = db_fetch_array($res);
@@ -192,10 +192,10 @@
 			return false;
 		}
 	}
-    
+
     /**
      * returns the name of the user for the given userid.
-     * 
+     *
      * @param <integer> the userid
      * @return  the name if one row is found or false if none is foundd
      */
@@ -221,7 +221,7 @@
     /**
      * returns one or more userids from the given email or false,
      * if there is no record in the database matching the given email
-     * 
+     *
      * @param <string> the email
      * @return <mixed> returns an array of userids or false when no records matches
      */
@@ -249,9 +249,9 @@
      * returns one or more owners for the given wm_id. First all guis deploying
      * this wms are selected. Afterwards for each of the guis the owners are
      * selected and stored within an array.
-     * 
+     *
      * @param <integer> the wms_id
-     * @return <mixed> an array of usernames which use thw wms in their guis (both for persona or group ownership) 
+     * @return <mixed> an array of usernames which use thw wms in their guis (both for persona or group ownership)
      */
 	function getOwnerByWms($wms_id){
 		// first get guis which deploy this wms.
@@ -318,7 +318,7 @@
 	}
     /**
      * tests whether a gui with the passed gui_id exits and returns true or false.
-     * 
+     *
      * @param <string> the gui_id to test
      * @return <boolean> Does a Gui with the passed over gui_id exist?
      */
@@ -335,10 +335,10 @@
 			return false;
 		}
 	}
-    
+
     /**
      * deletes a WMC entry specified by wmc_id and user_id
-     * 
+     *
      * @param <integer> the user_id
      * @param <string> the wmc_id
      * @return <boolean> Did the query run succesfull? This does not necessarily mean that an entry was deleted.
@@ -356,10 +356,10 @@
 			return false;
 		}
  	}
-    
+
     /**
      * inserts a gui with the specified gui_id, after checking the uniqueness of teh gui id.
-     * 
+     *
      * @uses guiExists
      * @param <string> the name and id of the gui to insert.
      * @return <boolean> could the gui be inserted?
@@ -376,10 +376,10 @@
 		}
 		return false;
 	}
-    
+
     /**
      * deletes links between user and guis in gui_mb_user for a certain gui.
-     * 
+     *
      * @param <string> the gui name
      * @return <boolean> could the sql be executed without errors. This does not necessarily mean, that entries were deleted
      */
@@ -395,16 +395,23 @@
 			return true;
 		}
 	}
-    
+
     /**
-     * 
+     * returns an array of WMS for a given user id
      * @uses getGuisByOwner
+     * @param <integer> the user id
+     * @return <array> wms ids for the user
      */
 	function getWmsByOwner($user_id){
 		$gui_list = $this->getGuisByOwner($user_id,true);
 		return $this->getWmsByOwnGuis($gui_list);
 	}
 
+    /**
+     * returns an array of WMS where the owner is the user with the passed user_id
+     * @param <integer> the user id
+     * @return <array> wms ids for the user
+     */
 	function getWmsByWmsOwner($user_id){
 		$sql = "SELECT wms_id FROM wms WHERE wms_owner = $1";
 		$v = array($user_id);
@@ -417,6 +424,12 @@
 		return $r;
 	}
 
+    /**
+     * returns an array of user which are associated with a wms
+     *
+     * @param <integer> the wms id
+     * @return <array> user_ids for the wms
+     */
 	function getUserByWms($wms_id){
 		$sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1 GROUP BY fkey_gui_id";
 		$v = array($wms_id);
@@ -464,8 +477,14 @@
 		return $user;
 	}
 
+    /**
+     * selects the WMS-title for a given wms id.
+     *
+     * @param <integer> the wms id
+     * @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 GROUP BY wms_title";
 		$v = array($id);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
@@ -473,8 +492,14 @@
 		if ($row) return $row["wms_title"]; else return false;
 	}
 
+    /**
+     * selects the Layer-title for a given layer id.
+     *
+     * @param <integer> the wms id
+     * @return <string|boolean> either the title of the wms as string or false when none exists
+     */
 	function getLayerTitleByLayerId($id){
-		$sql = "SELECT layer_title from layer WHERE layer_id = $1 GROUP BY layer_title";
+		$sql = "SELECT layer_title FROM layer WHERE layer_id = $1 GROUP BY layer_title";
 		$v = array($id);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
@@ -482,6 +507,12 @@
 		if ($row) return $row["layer_title"]; else return false;
 	}
 
+    /**
+     * selects the WMC for a given wmc_id.
+     *
+     * @param <integer> the wms id
+     * @return <string|boolean> either the wmc as string or false when none exists
+     */
 	function getWmcById($id){
 		$sql = "SELECT wmc FROM mb_user_wmc WHERE wmc_id = $1 ";
 		$v = array($id);
@@ -496,13 +527,18 @@
 		}
 	}
 
+    /**
+     * resets the loin count of a given user to 0
+     * @param <integer> the user id
+     * @return <boolean> could the login count be reseted?
+     */
 	function resetLoginCount($userId) {
-		$sql = "UPDATE mb_user SET mb_user_login_count = '0' ";
+		// TODO: isn't mb_user_login_count a integer?
+        $sql = "UPDATE mb_user SET mb_user_login_count = '0' ";
 		$sql .= "WHERE mb_user_id = $1 ";
 		$v = array($userId);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
-
 		if (!$res) {
 			return false;
 		}



More information about the Mapbender_commits mailing list