summaryrefslogtreecommitdiff
path: root/controllers/project.php
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-24 19:07:25 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-24 19:07:25 -0500
commit565290fbf9e3727655921a969550167aa59a6e24 (patch)
tree0c3a98b1152e90eff86da26d9d9c8ec803dfdf95 /controllers/project.php
parent8159cc99a64cfe563dccea6821348764fc40fb85 (diff)
Display a page not found when the data is not in the dabase anymore
Diffstat (limited to 'controllers/project.php')
-rw-r--r--controllers/project.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/controllers/project.php b/controllers/project.php
index c44dd38d..1ad2e829 100644
--- a/controllers/project.php
+++ b/controllers/project.php
@@ -88,6 +88,11 @@ class Project extends Base
$project = $this->project->get($this->request->getIntegerParam('project_id'));
+ if (! $project) {
+ $this->session->flashError(t('Project not found.'));
+ $this->response->redirect('?controller=project');
+ }
+
$this->response->html($this->template->layout('project_edit', array(
'errors' => array(),
'values' => $project,
@@ -128,8 +133,15 @@ class Project extends Base
{
$this->checkPermissions();
+ $project = $this->project->get($this->request->getIntegerParam('project_id'));
+
+ if (! $project) {
+ $this->session->flashError(t('Project not found.'));
+ $this->response->redirect('?controller=project');
+ }
+
$this->response->html($this->template->layout('project_remove', array(
- 'project' => $this->project->get($this->request->getIntegerParam('project_id')),
+ 'project' => $project,
'menu' => 'projects',
'title' => t('Remove project')
)));