removed old cookie stuff from middleware
This commit is contained in:
parent
60991480eb
commit
834485fb4e
3 changed files with 0 additions and 42 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue