From 772804add8095eea9b3ec2a832c2f82fbb9a6fd5 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 31 Dec 2014 12:37:15 -0500 Subject: Acl refactoring --- app/Controller/Comment.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/Controller/Comment.php') diff --git a/app/Controller/Comment.php b/app/Controller/Comment.php index fb21353e..9796ea38 100644 --- a/app/Controller/Comment.php +++ b/app/Controller/Comment.php @@ -24,7 +24,7 @@ class Comment extends Base $this->notfound(); } - if (! $this->acl->isAdminUser() && $comment['user_id'] != $this->acl->getUserId()) { + if (! $this->userSession->isAdmin() && $comment['user_id'] != $this->userSession->getId()) { $this->response->html($this->template->layout('comment/forbidden', array( 'title' => t('Access Forbidden') ))); @@ -44,7 +44,7 @@ class Comment extends Base if (empty($values)) { $values = array( - 'user_id' => $this->acl->getUserId(), + 'user_id' => $this->userSession->getId(), 'task_id' => $task['id'], ); } @@ -78,7 +78,7 @@ class Comment extends Base $this->session->flashError(t('Unable to create your comment.')); } - $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comments'); + $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id'].'#comments'); } $this->create($values, $errors); @@ -125,7 +125,7 @@ class Comment extends Base $this->session->flashError(t('Unable to update your comment.')); } - $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comment-'.$comment['id']); + $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id'].'#comment-'.$comment['id']); } $this->edit($values, $errors); @@ -166,6 +166,6 @@ class Comment extends Base $this->session->flashError(t('Unable to remove this comment.')); } - $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'#comments'); + $this->response->redirect('?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id'].'#comments'); } } -- cgit v1.2.3