From 1537f3c9b21ebdef144195147b882ec26820ec2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Thu, 21 Mar 2013 14:20:18 +0100 Subject: [PATCH] Diverses corrections --- module/Galerie/src/Galerie/Controller/IndexController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module/Galerie/src/Galerie/Controller/IndexController.php b/module/Galerie/src/Galerie/Controller/IndexController.php index c2bd5f7..488e437 100644 --- a/module/Galerie/src/Galerie/Controller/IndexController.php +++ b/module/Galerie/src/Galerie/Controller/IndexController.php @@ -138,7 +138,7 @@ class IndexController extends AbstractActionController public function indexAction() { - $this->_getLog()->info('Acces à la liste des galeries'); + //$this->_getLog()->info('Acces à la liste des galeries'); $session = new Container('test'); if ($session->offsetExists('last')) { $last = $email = $session->offsetGet('last'); @@ -162,7 +162,7 @@ class IndexController extends AbstractActionController $entry->setLink($this->url()->fromRoute( 'galerie/view', - array('id' => $d->id)) + array('id' => $d->id)), array('force_canonical' => true) ); @@ -368,6 +368,9 @@ class IndexController extends AbstractActionController $galerie = null; } else { $galerie = $this->_getGalerieTable()->any(array('id' => $id)); + if (!$galerie) { + return $this->redirect()->toRoute('galerie'); + } } // Sommes-nous en ajout ou en édition ? @@ -452,6 +455,10 @@ class IndexController extends AbstractActionController $id = $this->params()->fromRoute('id', null); $galerie = $this->_getGalerieInfoTable()->any($id); + if (!$galerie) { + return $this->redirect()->toRoute('galerie'); + } + $pairs = $this->_getGaleriePairTable()->all(); unset($pairs[$id]); -- 1.7.10.4