From e886c3befbbc5932d1b44e0fe46b901821e18d08 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 27 Oct 2011 11:06:29 +0200 Subject: chmod --- application/modules/user/controllers/FilterController.php | 0 application/modules/user/forms/FilterEntry.php | 0 application/modules/user/views/scripts/filter/index.phtml | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 application/modules/user/controllers/FilterController.php mode change 100644 => 100755 application/modules/user/forms/FilterEntry.php mode change 100644 => 100755 application/modules/user/views/scripts/filter/index.phtml diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php old mode 100644 new mode 100755 diff --git a/application/modules/user/forms/FilterEntry.php b/application/modules/user/forms/FilterEntry.php old mode 100644 new mode 100755 diff --git a/application/modules/user/views/scripts/filter/index.phtml b/application/modules/user/views/scripts/filter/index.phtml old mode 100644 new mode 100755 -- cgit v1.2.3-55-g7522 From 350d2566252efc836d83602e913ce2d903b02516 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 27 Oct 2011 14:45:56 +0200 Subject: changebootmenu API --- application/controllers/ResourceController.php | 47 ++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index cef1cc9..e65d1ca 100755 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -382,11 +382,11 @@ class ResourceController extends Zend_Controller_Action $filterMapper->find($filterid, $filter); if($filter->getID) { $filter->setOptions($params); - if($filter->getMembershipID() == $this->membership->getID()) { + if($filter->getMembershipID() == $this->membership->getID() || $filter->getGroupID() == $this->membership->getGroupID()) { $filterMapper->save($filter); - header('HTTP/1.0 201 Filterentry changed'); + header('HTTP/1.0 201 Filter changed'); } else { - header('HTTP/1.0 403 No Right to change this Filterentry'); + header('HTTP/1.0 403 No Right to change this Filter'); die(); } } else { @@ -504,6 +504,47 @@ class ResourceController extends Zend_Controller_Action echo $xml; } + public function changebootmenuAction() + { + list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '65', 'roleID' => $this->membership->getRoleID())); + if($rightroles == null){ + header('HTTP/1.0 403 No Right to Create Bootmenus'); + die(); + } + + $apikey = $this->_request->getParam('apikey'); + if($apikey == ""){ + header('HTTP/1.0 400 No API-Key'); + die(); + } + + $params = $this->_request->getParams(); + $groupID = $this->membership->getGroupID(); + $bootmenuID = $params['bootmenuid']; + + $bootmenuMapper = new Application_Model_BootMenuMapper(); + $bootmenuEntriesMapper = new Application_Model_BootMenuEntriesMapper(); + + $bootmenu = new Application_Model_BootMenu(); + $bootmenuMapper->find($bootmenuID, $bootmenu); + if($bootmenu->getID()) { + $newBootmenu = clone $bootmenu; + $newBootmenu->setOptions($params); + if($newBootmenu->getMembershipID() == $this->membership->getID() || $newBootmenu->getGroupID() == $this->membership->getGroupID()) { + $bootmenMapper->save($newBootmenu); + $bootmenuEntries = $bootmenuEntriesMapper->findBy(array('bootmenuID' => $bootmenuID)); + foreach($bootmenuEntries as $bootmenuEntry) { + $bootmenuEntry->setOptions($params); + $bootmenuEntriesMapper->save($bootmenuEntry); + } + header('HTTP/1.0 201 Bootmenu changed'); + } else { + header('HTTP/1.0 403 No Right to change this Bootmenu'); + die(); + } + } + } + public function deletebootmenuAction() { list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '66', 'roleID' => $this->membership->getRoleID())); if($rightroles == null){ -- cgit v1.2.3-55-g7522 From 51c8e88b8e92363cf0f8e5a4a00f5804ecbbafd1 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 27 Oct 2011 16:10:37 +0200 Subject: verschiedenes --- application/controllers/ResourceController.php | 27 +++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index e65d1ca..5ec0327 100755 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -380,7 +380,7 @@ class ResourceController extends Zend_Controller_Action $filterid = $params['filterid']; $filter = new Application_Model_Filter(); $filterMapper->find($filterid, $filter); - if($filter->getID) { + if($filter->getID()) { $filter->setOptions($params); if($filter->getMembershipID() == $this->membership->getID() || $filter->getGroupID() == $this->membership->getGroupID()) { $filterMapper->save($filter); @@ -520,22 +520,27 @@ class ResourceController extends Zend_Controller_Action $params = $this->_request->getParams(); $groupID = $this->membership->getGroupID(); - $bootmenuID = $params['bootmenuid']; + $bootmenuid = $params['bootmenuid']; $bootmenuMapper = new Application_Model_BootMenuMapper(); $bootmenuEntriesMapper = new Application_Model_BootMenuEntriesMapper(); $bootmenu = new Application_Model_BootMenu(); - $bootmenuMapper->find($bootmenuID, $bootmenu); + $bootmenuMapper->find($bootmenuid, $bootmenu); if($bootmenu->getID()) { - $newBootmenu = clone $bootmenu; - $newBootmenu->setOptions($params); - if($newBootmenu->getMembershipID() == $this->membership->getID() || $newBootmenu->getGroupID() == $this->membership->getGroupID()) { - $bootmenMapper->save($newBootmenu); - $bootmenuEntries = $bootmenuEntriesMapper->findBy(array('bootmenuID' => $bootmenuID)); - foreach($bootmenuEntries as $bootmenuEntry) { - $bootmenuEntry->setOptions($params); - $bootmenuEntriesMapper->save($bootmenuEntry); + $bootmenu->setOptions($params); + if($bootmenu->getMembershipID() == $this->membership->getID() || $bootmenu->getGroupID() == $this->membership->getGroupID()) { + $bootmenuMapper->save($bootmenu); + if(isset($params['changeentry'])) { + $bootos = new Application_Model_BootOs(); + $bootosMapper = new Application_Model_BootOsMapper(); + $bootosMapper->find($params['bootosID'], $bootos); + $params['title'] = $bootos->getTitle(); + $bootmenuEntries = $bootmenuEntriesMapper->findBy(array('bootmenuID' => $bootmenuid)); + foreach($bootmenuEntries as $bootmenuEntry) { + $bootmenuEntry->setOptions($params); + $bootmenuEntriesMapper->save($bootmenuEntry); + } } header('HTTP/1.0 201 Bootmenu changed'); } else { -- cgit v1.2.3-55-g7522