From ba6f441fe01b49f2836ee182a89632d4552d34e7 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 26 Apr 2011 17:54:31 +0200 Subject: config fix --- .../modules/user/controllers/ConfigController.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index 6c6466c..e41c23e 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -107,20 +107,26 @@ class user_ConfigController extends Zend_Controller_Action foreach ($bootos as $b) if($b->getPublic() - $k >= 0 ){ $this->view->bootoslist[] = $b; - if(Pbs_Acl::checkRight('cc')) - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID())); - else - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + if(Pbs_Acl::checkRight('cc')){ + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + }else{ + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); } } elseif($k == 0 && $b->getPublic() == -1 && Pbs_Acl::checkRight('boc')){ $this->view->bootoslist[] = $b; - if(Pbs_Acl::checkRight('cc')) - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID())); - else - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + if(Pbs_Acl::checkRight('cc')){ + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + }else{ + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); } -- cgit v1.2.3-55-g7522 From 1fb7070e2f16e2531df776829e12938f0ce00509 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 26 Apr 2011 18:03:33 +0200 Subject: config fix --- .../modules/user/controllers/ConfigController.php | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index e41c23e..bb01158 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -99,6 +99,8 @@ class user_ConfigController extends Zend_Controller_Action $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); $parents = array(); + $groupconfs = array(); + $ownerconfs = array(); $parents = $groupgroupsMapper->getParentGroups($groupID); foreach($parents as $k => $parent){ @@ -108,11 +110,14 @@ class user_ConfigController extends Zend_Controller_Action if($b->getPublic() - $k >= 0 ){ $this->view->bootoslist[] = $b; if(Pbs_Acl::checkRight('cc')){ - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); }else{ - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); + } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); @@ -121,11 +126,13 @@ class user_ConfigController extends Zend_Controller_Action elseif($k == 0 && $b->getPublic() == -1 && Pbs_Acl::checkRight('boc')){ $this->view->bootoslist[] = $b; if(Pbs_Acl::checkRight('cc')){ - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); + $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); }else{ - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); - $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); + $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); -- cgit v1.2.3-55-g7522 From fcbea5e77e7eec8dbe9e07c96b2001bb22d1b52d Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 26 Apr 2011 18:05:19 +0200 Subject: config fix --- application/modules/user/controllers/ConfigController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index bb01158..bf79151 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -112,11 +112,11 @@ class user_ConfigController extends Zend_Controller_Action if(Pbs_Acl::checkRight('cc')){ $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); - $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); }else{ $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); - $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); } foreach ($this->view->configlist[$b->getID()] as $config){ @@ -128,11 +128,11 @@ class user_ConfigController extends Zend_Controller_Action if(Pbs_Acl::checkRight('cc')){ $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID())); $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID())); - $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); }else{ $ownerconfs = $this->configMapper->findBy(array('groupID' => $b->getGroupID(), 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); $groupconfs = $this->configMapper->findBy(array('groupID' => $groupID, 'membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1')); - $this->view->configlist[$b->getID()] = array_merge($ownerconfs,$groupconfs); + $this->view->configlist[$b->getID()] = array_unique(array_merge($ownerconfs,$groupconfs)); } foreach ($this->view->configlist[$b->getID()] as $config){ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated())); -- cgit v1.2.3-55-g7522