[Fusionforge-commits] FusionForge branch master updated. 0904aeef26cde281865c7db69f53f84ea0f091b2

Franck VILLAUME nerville at fusionforge.org
Sun Apr 14 19:15:03 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  0904aeef26cde281865c7db69f53f84ea0f091b2 (commit)
      from  55f96506e15c39f53e924fed4a9383b5afe141b2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0904aeef26cde281865c7db69f53f84ea0f091b2
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Apr 14 19:14:46 2013 +0200

    patch #550: add more check on disabled feature in RBAC normalize function

diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index 57ffefd..d73273b 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -5,6 +5,7 @@
  * Copyright 2004, GForge, LLC
  * Copyright 2009-2010, Roland Mas
  * Copyright 2012-2013, Franck Villaume - TrivialDev
+ * Copyright 2013, French Ministry of National Education
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -891,14 +892,16 @@ abstract class BaseRole extends Error {
 				continue;
 			}
 			$ff = new ForumFactory ($p) ;
-			$fids = $ff->getAllForumIdsWithNews () ;
-			foreach ($fids as $fid) {
-				if (array_key_exists ('forum', $this->perms_array)
-				    && array_key_exists ($fid, $this->perms_array['forum']) ) {
-					$new_pa['forum'][$fid] = $this->perms_array['forum'][$fid] ;
-				} elseif (array_key_exists ('new_forum', $this->perms_array)
-					  && array_key_exists ($p->getID(), $this->perms_array['new_forum']) ) {
-					$new_pa['forum'][$fid] = $new_pa['new_forum'][$p->getID()] ;
+			if (!$ff->isError()) {
+				$fids = $ff->getAllForumIdsWithNews () ;
+				foreach ($fids as $fid) {
+					if (array_key_exists ('forum', $this->perms_array)
+					&& array_key_exists ($fid, $this->perms_array['forum']) ) {
+						$new_pa['forum'][$fid] = $this->perms_array['forum'][$fid] ;
+					} elseif (array_key_exists ('new_forum', $this->perms_array)
+						&& array_key_exists ($p->getID(), $this->perms_array['new_forum']) ) {
+						$new_pa['forum'][$fid] = $new_pa['new_forum'][$p->getID()] ;
+					}
 				}
 			}
 		}
@@ -911,14 +914,16 @@ abstract class BaseRole extends Error {
 				continue;
 			}
 			$pgf = new ProjectGroupFactory ($p) ;
-			$pgids = $pgf->getAllProjectGroupIds () ;
-			foreach ($pgids as $gid) {
-				if (array_key_exists ('pm', $this->perms_array)
-				    && array_key_exists ($gid, $this->perms_array['pm']) ) {
-					$new_pa['pm'][$gid] = $this->perms_array['pm'][$gid] ;
-				} elseif (array_key_exists ('new_pm', $this->perms_array)
-					  && array_key_exists ($p->getID(), $this->perms_array['new_pm']) ) {
-					$new_pa['pm'][$gid] = $new_pa['new_pm'][$p->getID()] ;
+			if (!$pgf->isError()) {
+				$pgids = $pgf->getAllProjectGroupIds () ;
+				foreach ($pgids as $gid) {
+					if (array_key_exists ('pm', $this->perms_array)
+					&& array_key_exists ($gid, $this->perms_array['pm']) ) {
+						$new_pa['pm'][$gid] = $this->perms_array['pm'][$gid] ;
+					} elseif (array_key_exists ('new_pm', $this->perms_array)
+						&& array_key_exists ($p->getID(), $this->perms_array['new_pm']) ) {
+						$new_pa['pm'][$gid] = $new_pa['new_pm'][$p->getID()] ;
+					}
 				}
 			}
 		}

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/RBAC.php |   37 +++++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list