diff options
| author | Simon | 2011-04-15 18:47:35 +0200 |
|---|---|---|
| committer | Simon | 2011-04-15 18:47:35 +0200 |
| commit | d90c2f5bb0f5f1fc507c359ee7c969e95509c8da (patch) | |
| tree | 96d3f863dfc3e0f0c5cf6885aadb2b601ad06e25 /application | |
| parent | Ticket #192 - Inheritance ist nun auch berücksichtigt Group Controller fertig (diff) | |
| download | pbs2-d90c2f5bb0f5f1fc507c359ee7c969e95509c8da.tar.gz pbs2-d90c2f5bb0f5f1fc507c359ee7c969e95509c8da.tar.xz pbs2-d90c2f5bb0f5f1fc507c359ee7c969e95509c8da.zip | |
Ticket #192 - Parent-Nodes werden nicht doppelt gecrawlt
Diffstat (limited to 'application')
| -rw-r--r-- | application/modules/user/controllers/GroupController.php | 20 | ||||
| -rw-r--r-- | application/modules/user/views/scripts/group/show.phtml | 1 |
2 files changed, 12 insertions, 9 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; + } } } } 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 "<select name=\"roleID\">"; foreach($roleList as $grouptitle=>$head) { #print_a($grouptitle,$head); |
