diff options
Diffstat (limited to 'application/modules/user/controllers/GroupController.php')
| -rw-r--r-- | application/modules/user/controllers/GroupController.php | 20 |
1 files changed, 12 insertions, 8 deletions
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; + } } } } |
