diff --git a/app/Controller/Project.php b/app/Controller/Project.php index 6356a9c6a..ef9eac6b2 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -405,6 +405,27 @@ class Project extends Base $this->response->redirect('?controller=project&action=show&project_id='.$project_id); } + /** + * RSS feed for a project + * + * @access public + */ + public function feed() + { + $token = $this->request->getStringParam('token'); + $project = $this->project->getByToken($token); + + // Token verification + if (! $project) { + $this->forbidden(true); + } + + $this->response->xml($this->template->load('project_feed', array( + 'events' => $this->project->getActivity($project['id']), + 'project' => $project, + ))); + } + /** * Activity page for a project * diff --git a/app/Model/Acl.php b/app/Model/Acl.php index ca00a09e3..aea13e8cb 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -20,6 +20,7 @@ class Acl extends Base 'user' => array('login', 'check', 'google', 'github'), 'task' => array('add', 'readonly'), 'board' => array('readonly'), + 'project' => array('feed'), ); /** diff --git a/app/Templates/project_activity.php b/app/Templates/project_activity.php index b79d97f9a..86e17e7f8 100644 --- a/app/Templates/project_activity.php +++ b/app/Templates/project_activity.php @@ -12,6 +12,9 @@
= t('No activity.') ?>
+ + +
diff --git a/app/Templates/project_feed.php b/app/Templates/project_feed.php
new file mode 100644
index 000000000..b47c87ad0
--- /dev/null
+++ b/app/Templates/project_feed.php
@@ -0,0 +1,27 @@
+= '' ?>
+
@@ -19,7 +19,7 @@ -
diff --git a/app/Templates/user_index.php b/app/Templates/user_index.php index 7e9197b51..d4e1bbf9b 100644 --- a/app/Templates/user_index.php +++ b/app/Templates/user_index.php @@ -53,10 +53,10 @@