[Fusionforge-commits] r9837 - in trunk/gforge/common: forum pm tracker

Roland Mas lolando at libremir.placard.fr.eu.org
Fri May 21 09:56:44 CEST 2010


Author: lolando
Date: 2010-05-21 09:56:44 +0200 (Fri, 21 May 2010)
New Revision: 9837

Modified:
   trunk/gforge/common/forum/Forum.class.php
   trunk/gforge/common/pm/ProjectGroup.class.php
   trunk/gforge/common/tracker/ArtifactType.class.php
Log:
Also remove unused getCurrentUserPerm() methods

Modified: trunk/gforge/common/forum/Forum.class.php
===================================================================
--- trunk/gforge/common/forum/Forum.class.php	2010-05-21 07:56:29 UTC (rev 9836)
+++ trunk/gforge/common/forum/Forum.class.php	2010-05-21 07:56:44 UTC (rev 9837)
@@ -692,36 +692,6 @@
 		return forge_check_perm ('forum_admin', $this->Group->getID()) ;
 	}
 
-	/**
-	 *  getCurrentUserPerm - get the logged-in user's perms from his role.
-	 *
-	 *  @return int perm level for the logged-in user.
-	 */
-	function getCurrentUserPerm() {
-		if (!session_loggedin()) {
-			return -1;
-		} else {
-			if (!isset($this->current_user_perm)) {
-				$res = db_query_params ('SELECT role_setting.value::integer
-				FROM role_setting, user_group
-				WHERE role_setting.ref_id=$1
-				AND user_group.role_id=role_setting.role_id
-                                AND user_group.user_id=$2
-                                AND role_setting.section_name=$3',
-							array ($this->getID(),
-							       user_getid(),
-							       'forum')) ;
-				$this->current_user_perm=db_result($res,0,0);
-
-				// Return no access if no access rights defined.
-				if (!$this->current_user_perm)
-					$this->current_user_perm=-1;
-			}
-			return $this->current_user_perm;
-		}
-	}
-
-
 }
 
 // Local Variables:

Modified: trunk/gforge/common/pm/ProjectGroup.class.php
===================================================================
--- trunk/gforge/common/pm/ProjectGroup.class.php	2010-05-21 07:56:29 UTC (rev 9836)
+++ trunk/gforge/common/pm/ProjectGroup.class.php	2010-05-21 07:56:44 UTC (rev 9837)
@@ -568,31 +568,6 @@
 		return forge_check_perm ('pm', $this->getID(), 'tech') ;
 	}
 
-	/**
-	 *  getCurrentUserPerm - get the logged-in user's perms from the role data
-	 *
-	 *  @return int perm level for the logged-in user.
-	 */
-	function getCurrentUserPerm() {
-		if (!session_loggedin()) {
-			return -1;
-		} else {
-			if (!isset($this->current_user_perm)) {
-				$res = db_query_params ('SELECT role_setting.value::integer
-				FROM role_setting, user_group
-				WHERE role_setting.ref_id=$1
-				AND user_group.role_id = role_setting.role_id
-                                AND user_group.user_id=$2
-                                AND role_setting.section_name=$3',
-							array ($this->getID(),
-							       user_getid(),
-							       'pm')) ;
-				$this->current_user_perm=db_result($res,0,0);
-			}
-			return $this->current_user_perm;
-		}
-	}
-
 }
 
 // Local Variables:

Modified: trunk/gforge/common/tracker/ArtifactType.class.php
===================================================================
--- trunk/gforge/common/tracker/ArtifactType.class.php	2010-05-21 07:56:29 UTC (rev 9836)
+++ trunk/gforge/common/tracker/ArtifactType.class.php	2010-05-21 07:56:44 UTC (rev 9837)
@@ -987,30 +987,6 @@
 	}
 
 	/**
-	 *	getCurrentUserPerm - get the logged-in user's perms from his role
-	 *
-	 *	@return int perm level for the logged-in user.
-	 */
-	function getCurrentUserPerm() {
-		if (!session_loggedin()) {
-			return 0;
-		} else {
-			if (!isset($this->current_user_perm)) {
-				$this->current_user_perm=db_result(db_query_params ('SELECT role_setting.value::integer
-				FROM role_setting, user_group
-				WHERE role_setting.ref_id=$1
-				AND user_group.role_id=role_setting.role_id
-                                AND user_group.user_id=$2
-                                AND role_setting.section_name=$3',
-										    array ($this->getID(),
-											   user_getid(),
-											   'tracker')),0,0) ;
-			}
-			return $this->current_user_perm;
-		}
-	}
-
-	/**
 	 *  update - use this to update this ArtifactType in the database.
 	 *
 	 *  @param	string	The item name.




More information about the Fusionforge-commits mailing list