summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebastian wagner2011-09-14 16:37:43 +0200
committersebastian wagner2011-09-14 16:37:43 +0200
commit1f173d1a62c0e0d6e2aae172cb69be98d93427db (patch)
tree3452d17d0e98ac90f23a68303148c7a39c96b497
parentcheckright für javascript (diff)
downloadpoolctrl-1f173d1a62c0e0d6e2aae172cb69be98d93427db.tar.gz
poolctrl-1f173d1a62c0e0d6e2aae172cb69be98d93427db.tar.xz
poolctrl-1f173d1a62c0e0d6e2aae172cb69be98d93427db.zip
deleteall Action
-rwxr-xr-xapplication/controllers/EventController.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 1d97f86..3ac22fe 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -471,6 +471,43 @@ class EventController extends Zend_Controller_Action
* START CALENDAR FUNCTIONS
* ------------------------
*/
+
+ public function deleteallAction() {
+ if (!$this->acl->checkRight('ed')) {
+ $this->_redirect('/');
+ }
+ $this->_helper->viewRenderer->setNoRender();
+ $eventTitle = $this->_request->getParam('eventTitle');
+ if (isset ($eventTitle)) {
+ $event = new Application_Model_Event();
+ if ($event->getPbs_bootmenuID()) {
+ $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_bootmenuID());
+ }
+ if ($event->getPbs_filterID()) {
+ $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_filterID());
+ }
+ $events = $this->eventMapper->findBy(array("title" => $eventTitle));
+ if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) {
+ if (!$this->acl->checkRight('edo')) {
+ $this->_redirect('/');
+ }
+ }
+ try {
+ foreach($events as $event) {
+ $this->eventMapper->delete($event);
+ }
+
+ } catch (Zend_Exception $e) {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect('/event/');
+ } else {
+ $this->_redirect('/event/');
+ return;
+ }
+ }
public function getpoollistAction() {