summaryrefslogtreecommitdiff
path: root/controllers/user.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/user.php
parent8159cc99a64cfe563dccea6821348764fc40fb85 (diff)
Display a page not found when the data is not in the dabase anymore
Diffstat (limited to 'controllers/user.php')
-rw-r--r--controllers/user.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/controllers/user.php b/controllers/user.php
index 0fdd9d1e..9f9781ef 100644
--- a/controllers/user.php
+++ b/controllers/user.php
@@ -112,11 +112,13 @@ class User extends Base
{
$user = $this->user->getById($this->request->getIntegerParam('user_id'));
+ if (! $user) $this->notfound();
+
if (! $_SESSION['user']['is_admin'] && $_SESSION['user']['id'] != $user['id']) {
- $this->response->redirect('?controller=user&action=forbidden');
+ $this->forbidden();
}
- if (! empty($user)) unset($user['password']);
+ unset($user['password']);
$this->response->html($this->template->layout('user_edit', array(
'projects' => $this->project->getList(),
@@ -138,7 +140,7 @@ class User extends Base
else {
if ($_SESSION['user']['id'] != $values['id']) {
- $this->response->redirect('?controller=user&action=forbidden');
+ $this->forbidden();
}
if (isset($values['is_admin'])) {
@@ -173,8 +175,12 @@ class User extends Base
{
$this->checkPermissions();
+ $user = $this->user->getById($this->request->getIntegerParam('user_id'));
+
+ if (! $user) $this->notfound();
+
$this->response->html($this->template->layout('user_remove', array(
- 'user' => $this->user->getById($this->request->getIntegerParam('user_id')),
+ 'user' => $user,
'menu' => 'users',
'title' => t('Remove user')
)));