From 00a1bcc61d4b5c1e28b14c018332a934100e227f Mon Sep 17 00:00:00 2001 From: michael pereira Date: Fri, 1 Apr 2011 16:46:47 +0200 Subject: Bootmenu & BootOs Controller --- application/modules/user/controllers/BootosController.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'application/modules/user/controllers/BootosController.php') diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php index eae0dcf..0a1f41f 100644 --- a/application/modules/user/controllers/BootosController.php +++ b/application/modules/user/controllers/BootosController.php @@ -265,14 +265,14 @@ class user_BootosController extends Zend_Controller_Action $configMapper = new Application_Model_ConfigMapper(); $configlist = $configMapper->findBy("groupID", $groupID); + $bootos = new Application_Model_BootOs(); + $bootos = $this->bootosMapper->find($bootosID); + + if($this->membership->getGroupID() != $bootos->getGroupID()) + $this->_redirect('/user/bootos/index/page/'.$page.'/modifyresult/forbidden'); + if (!isset($_POST["editbootos"])){ - - $bootos = new Application_Model_BootOs(); - $bootos = $this->bootosMapper->find($bootosID); - if($this->membership->getGroupID() != $bootos->getGroupID()) - $this->_redirect('/user/bootos/index/page/'.$page.'/modifyresult/forbidden'); - $bootosForm = new user_Form_Bootos(array('action' => 'editbootos', 'groupdepth' => $childgroups, 'configlist'=>$configlist, 'rights' => 'meta')); $bootosForm->populate($bootos->toArray()); @@ -281,8 +281,7 @@ class user_BootosController extends Zend_Controller_Action if ($bootosForm->isValid($_POST)) { - $bootosold = new Application_Model_BootOs(); - $this->bootosMapper->find($bootosID, $bootosold); + $bootosold = $bootos; $bootos = new Application_Model_BootOs($_POST); $bootos->setMembershipID($this->membership->getID()); -- cgit v1.2.3-55-g7522