summaryrefslogtreecommitdiff
path: root/app/Controller/Ical.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/Ical.php
parent108e867605dbc7ece4cbcbecc89a674e9c154a9b (diff)
Refactoring: added controlled middleware and changed response class
Diffstat (limited to 'app/Controller/Ical.php')
-rw-r--r--app/Controller/Ical.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Controller/Ical.php b/app/Controller/Ical.php
index 8fe97b46..091ea5f4 100644
--- a/app/Controller/Ical.php
+++ b/app/Controller/Ical.php
@@ -2,6 +2,7 @@
namespace Kanboard\Controller;
+use Kanboard\Core\Controller\AccessForbiddenException;
use Kanboard\Core\Filter\QueryBuilder;
use Kanboard\Filter\TaskAssigneeFilter;
use Kanboard\Filter\TaskProjectFilter;
@@ -16,7 +17,7 @@ use Eluceo\iCal\Component\Calendar as iCalendar;
* @package controller
* @author Frederic Guillot
*/
-class Ical extends Base
+class Ical extends BaseController
{
/**
* Get user iCalendar
@@ -30,7 +31,7 @@ class Ical extends Base
// Token verification
if (empty($user)) {
- $this->forbidden(true);
+ throw AccessForbiddenException::getInstance()->withoutLayout();
}
// Common filter
@@ -61,7 +62,7 @@ class Ical extends Base
// Token verification
if (empty($project)) {
- $this->forbidden(true);
+ throw AccessForbiddenException::getInstance()->withoutLayout();
}
// Common filter
@@ -84,6 +85,8 @@ class Ical extends Base
* Common method to render iCal events
*
* @access private
+ * @param QueryBuilder $queryBuilder
+ * @param iCalendar $calendar
*/
private function renderCalendar(QueryBuilder $queryBuilder, iCalendar $calendar)
{