[Fusionforge-commits] FusionForge branch master updated. f95a660d956f97d4408701140fdafdfc582f984c

Franck VILLAUME nerville at fusionforge.org
Wed Feb 5 10:10:30 CET 2014


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  f95a660d956f97d4408701140fdafdfc582f984c (commit)
      from  8cc34ef4034fdde3e072e9701323948bf6ca56c2 (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 f95a660d956f97d4408701140fdafdfc582f984c
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Feb 5 10:08:45 2014 +0100

    plugin projects hierarchy: fix display for private projects

diff --git a/src/plugins/projects-hierarchy/view/home_project_link.php b/src/plugins/projects-hierarchy/view/home_project_link.php
index ed1d94c..9b0c893 100644
--- a/src/plugins/projects-hierarchy/view/home_project_link.php
+++ b/src/plugins/projects-hierarchy/view/home_project_link.php
@@ -5,6 +5,7 @@
  * Copyright 2006 (c) Fabien Regnier - Sogeti
  * Copyright 2010-2011, Franck Villaume - Capgemini
  * Copyright 2013, French Ministry of Education
+ * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -29,6 +30,22 @@ $projectsHierarchy = plugin_get_object('projects-hierarchy');
 
 $parent = $projectsHierarchy->getFamily($group_id, 'parent', false, 'validated');
 $childs = $projectsHierarchy->getFamily($group_id, 'child', false, 'validated');
+
+if (sizeof($parent)) {
+	$parentGroup = group_get_object($parent[0]);
+	if (!forge_check_perm('project_read', $parentGroup->getID())) {
+		array_pop($parent);
+	}
+}
+if (sizeof($childs)) {
+	for ($i = 0; $i < count($childs); $i++) {
+		$childGroup = group_get_object($childs[$i]);
+		if (!forge_check_perm('project_read', $childGroup->getID())) {
+				unset($childs[$i]);
+		}
+	}
+	$childs = array_values($childs);
+}
 if (sizeof($parent) || sizeof($childs)) {
 	echo $HTML->boxTop(_('Linked projects'));
 	if (sizeof($parent)) {

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

Summary of changes:
 .../projects-hierarchy/view/home_project_link.php     |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list