From 67b836164997527b91452b19adbcb8aa3c5decf1 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 May 2016 18:31:47 -0400 Subject: Refactoring: added controlled middleware and changed response class --- app/Controller/Feed.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/Controller/Feed.php') diff --git a/app/Controller/Feed.php b/app/Controller/Feed.php index f8b3d320..7554a499 100644 --- a/app/Controller/Feed.php +++ b/app/Controller/Feed.php @@ -2,13 +2,15 @@ namespace Kanboard\Controller; +use Kanboard\Core\Controller\AccessForbiddenException; + /** * Atom/RSS Feed controller * * @package controller * @author Frederic Guillot */ -class Feed extends Base +class Feed extends BaseController { /** * RSS feed for a user @@ -22,7 +24,7 @@ class Feed extends Base // Token verification if (empty($user)) { - $this->forbidden(true); + throw AccessForbiddenException::getInstance()->withoutLayout(); } $this->response->xml($this->template->render('feed/user', array( @@ -41,9 +43,8 @@ class Feed extends Base $token = $this->request->getStringParam('token'); $project = $this->project->getByToken($token); - // Token verification if (empty($project)) { - $this->forbidden(true); + throw AccessForbiddenException::getInstance()->withoutLayout(); } $this->response->xml($this->template->render('feed/project', array( -- cgit v1.2.3