From d90c2f5bb0f5f1fc507c359ee7c969e95509c8da Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 15 Apr 2011 18:47:35 +0200 Subject: Ticket #192 - Parent-Nodes werden nicht doppelt gecrawlt --- .../modules/user/controllers/GroupController.php | 20 ++++++++++++-------- .../modules/user/views/scripts/group/show.phtml | 1 - 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'application') diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index 7a136c8..9eca3e3 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -236,15 +236,19 @@ class User_GroupController extends Zend_Controller_Action $groupGroupsMapper = new Application_Model_GroupGroupsMapper(); $parents = $groupGroupsMapper->getParentGroups($groupID); $groupMapper = new Application_Model_GroupMapper(); - foreach($parents as $p){ + $crawled = array(); + foreach($parents as $p){ foreach($p as $a){ - $group = $groupMapper->find($a); - if($groupID != $a) - $r = $this->rolemapper->findBy(array('groupID' => $a,'inheritance'=>"1")); - else - $r = $this->rolemapper->findBy(array('groupID' => $a)); - foreach($r as $d){ - $roles[$group->getTitle()][] = $d; + if(!in_array($a,$crawled)){ + $crawled[] = $a; + $group = $groupMapper->find($a); + if($groupID != $a) + $r = $this->rolemapper->findBy(array('groupID' => $a,'inheritance'=>"1")); + else + $r = $this->rolemapper->findBy(array('groupID' => $a)); + foreach($r as $d){ + $roles[$group->getTitle()][] = $d; + } } } } diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml index 386c782..fae7b44 100644 --- a/application/modules/user/views/scripts/group/show.phtml +++ b/application/modules/user/views/scripts/group/show.phtml @@ -194,7 +194,6 @@ if((Pbs_Acl::checkRight('gdmo') && $this->usergroup == $this->requestgroup) || ( function printRoleSelect($roleList) { $s = ''; - #print_a($roleList); echo "