svn commit: r217 - trunk/mapbender/http/classes/class_administration.php

uli at osgeo.org uli at osgeo.org
Wed May 10 08:13:30 EDT 2006


Author: uli
Date: 2006-05-10 12:13:29+0000
New Revision: 217

Modified:
   trunk/mapbender/http/classes/class_administration.php

Log:
new function getModulPermission($userID,$guiID,$elementID)

Modified: trunk/mapbender/http/classes/class_administration.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/classes/class_administration.php?view=diff&rev=217&p1=trunk/mapbender/http/classes/class_administration.php&p2=trunk/mapbender/http/classes/class_administration.php&r1=216&r2=217
==============================================================================
--- trunk/mapbender/http/classes/class_administration.php	(original)
+++ trunk/mapbender/http/classes/class_administration.php	2006-05-10 12:13:29+0000
@@ -20,12 +20,7 @@
 require("phpmailer-1.72/class.phpmailer.php"); 
  
 class administration{
- 	
-	function __construct(){	
- 		$con = db_connect(DBSERVER,OWNER,PW);
- 		db_select_db(DB,$con);
-	}
-		 	 
+ 		 	 
 	function isValidEmail($email) {
 		if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
             return true;
@@ -659,5 +654,23 @@
 			return $url;	
 		}
 	}
+	function getModulPermission($userID,$guiID,$elementID){
+		$g = $this->getGuisByPermission($userID);
+		if(in_array($guiID,$g)){
+			$sql = "SELECT * FROM gui_element WHERE fkey_gui_id = $1 AND e_id = $2 ";
+			$v = array($guiID,$elementID);
+			$t = array('s','s');
+			$res = db_prep_query($sql,$v,$t);
+			if($row = db_fetch_array($res)){
+				return true;
+			}
+			else{
+				return false;
+			}
+		}
+		else{
+			return false;	
+		}			
+	}
 }
 ?>
\ No newline at end of file




More information about the Mapbender_commits mailing list