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

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Mar 29 11:12:46 CEST 2010


Author: lolando
Date: 2010-03-29 11:12:45 +0200 (Mon, 29 Mar 2010)
New Revision: 9272

Modified:
   trunk/gforge/common/forum/Forum.class.php
   trunk/gforge/common/pm/ProjectGroup.class.php
   trunk/gforge/common/tracker/ArtifactType.class.php
Log:
Normalize all roles when creating a forum, a tracker or a subproject

Modified: trunk/gforge/common/forum/Forum.class.php
===================================================================
--- trunk/gforge/common/forum/Forum.class.php	2010-03-29 09:12:35 UTC (rev 9271)
+++ trunk/gforge/common/forum/Forum.class.php	2010-03-29 09:12:45 UTC (rev 9272)
@@ -185,21 +185,6 @@
 		$this->group_forum_id=db_insertid($result,'forum_group_list','group_forum_id');
 		$this->fetchData($this->group_forum_id);
 		
-		// set the permission for the role's group 
-		$roles_group = $this->Group->getRolesId();
-		for ($i=0; $i<sizeof($roles_group); $i++) {
-			$role_setting_res = db_query_params ('INSERT INTO role_setting (role_id,section_name,ref_id,value) VALUES ($1,$2,$3,$4)',
-						array ($roles_group[$i],
-						       'forum',
-						       $this->group_forum_id,
-						       1)) ;
-			if (!$role_setting_res) {
-				db_rollback();
-				$this->setError('Error: Role setting for forum id ' . $this->group_forum_id . ' for groud id ' . $this->Group->getID() . ' ' .db_error());
-				return false;
-			}
-		}
-		
 		if ($create_default_message) {
 			$fm=new ForumMessage($this);
 			// Use the system side default language
@@ -213,6 +198,9 @@
 			}
 		}
 		db_commit();
+
+		$this->Group->normalizeAllRoles () ;
+
 		return true;
 	}
 

Modified: trunk/gforge/common/pm/ProjectGroup.class.php
===================================================================
--- trunk/gforge/common/pm/ProjectGroup.class.php	2010-03-29 09:12:35 UTC (rev 9271)
+++ trunk/gforge/common/pm/ProjectGroup.class.php	2010-03-29 09:12:45 UTC (rev 9272)
@@ -167,6 +167,9 @@
 		$this->fetchData($this->group_project_id);
 
 		db_commit();
+
+		$this->Group->normalizeAllRoles () ;
+
 		return true;
 	}
 

Modified: trunk/gforge/common/tracker/ArtifactType.class.php
===================================================================
--- trunk/gforge/common/tracker/ArtifactType.class.php	2010-03-29 09:12:35 UTC (rev 9271)
+++ trunk/gforge/common/tracker/ArtifactType.class.php	2010-03-29 09:12:45 UTC (rev 9272)
@@ -270,6 +270,7 @@
 				return false;
 			} else {
 				db_commit();
+				$this->Group->normalizeAllRoles () ;
 				return $id;
 		}
 	}




More information about the Fusionforge-commits mailing list