summaryrefslogtreecommitdiff
path: root/app/Controller/Feed.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-15 18:31:47 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-15 18:31:47 -0400
commit67b836164997527b91452b19adbcb8aa3c5decf1 (patch)
treeb5876d311912e97b0592c7e208639f7b52813a75 /app/Controller/Feed.php
parent108e867605dbc7ece4cbcbecc89a674e9c154a9b (diff)
Refactoring: added controlled middleware and changed response class
Diffstat (limited to 'app/Controller/Feed.php')
-rw-r--r--app/Controller/Feed.php9
1 files changed, 5 insertions, 4 deletions
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(