From 834485fb4eaf9398d701498c353e3f7b59716788 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 20 Jul 2011 12:59:48 +0200 Subject: [PATCH] removed old cookie stuff from middleware --- lib/Controller/AggregatorController.php | 4 --- lib/Controller/ChannelController.php | 4 --- lib/Controller/EntityController.php | 34 ------------------------- 3 files changed, 42 deletions(-) diff --git a/lib/Controller/AggregatorController.php b/lib/Controller/AggregatorController.php index 32ff332..06a137e 100644 --- a/lib/Controller/AggregatorController.php +++ b/lib/Controller/AggregatorController.php @@ -78,10 +78,6 @@ class AggregatorController extends EntityController { $aggregator = new Model\Aggregator($type); $this->setProperties($aggregator, $this->view->request->getParameters()); $this->em->persist($aggregator); - - if ($this->view->request->getParameter('setcookie')) { - $this->setCookie($channel); - } } $this->em->flush(); diff --git a/lib/Controller/ChannelController.php b/lib/Controller/ChannelController.php index aabcf80..651450b 100644 --- a/lib/Controller/ChannelController.php +++ b/lib/Controller/ChannelController.php @@ -68,10 +68,6 @@ class ChannelController extends EntityController { $this->em->persist($channel); $this->em->flush(); - if ($this->view->request->getParameter('setcookie')) { - $this->setCookie($channel); - } - return $channel; } } diff --git a/lib/Controller/EntityController.php b/lib/Controller/EntityController.php index 416a8b8..29b88e3 100644 --- a/lib/Controller/EntityController.php +++ b/lib/Controller/EntityController.php @@ -87,40 +87,6 @@ class EntityController extends Controller { return $entity; } - /** - * Adds an entity to the uuids cookie - * - * @todo add to Model\Entity? - * @param Model\Entity $entity - */ - protected function setCookie(Model\Entity $entity) { - $uuids = ($uuids = $this->view->request->getParameter('vz_uuids', 'cookies')) ? explode(';', $uuids) : array(); - - // add new UUID - $uuids[] = $entity->getUuid(); - - // send new cookie to browser - setcookie('vz_uuids', implode(';', array_unique($uuids)), 0, '/'); // TODO correct path - } - - /** - * Removes an entity from the uuids cookie - * - * @param Model\Entity $entity - * @todo add to Model\Entity? - */ - protected function unsetCookie(Model\Entity $entity) { - $uuids = ($uuids = $this->view->request->getParameter('vz_uuids', 'cookies')) ? explode(';', $uuids) : array(); - - // remove old UUID - $uuids = array_filter($uuids, function($uuid) use ($entity) { - return $uuid != $entity->getUuid(); - }); - - // send new cookie to browser - setcookie('vz_uuids', implode(';', array_unique($uuids)), 0, '/'); // TODO correct path - } - /** * Update/set/delete properties of entities */