From ab48a09f0d674b703467975b376c5ac7352670ae Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 May 2016 11:31:54 -0400 Subject: Rename controllers --- app/Controller/FeedController.php | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/Controller/FeedController.php (limited to 'app/Controller/FeedController.php') diff --git a/app/Controller/FeedController.php b/app/Controller/FeedController.php new file mode 100644 index 00000000..e453ecb9 --- /dev/null +++ b/app/Controller/FeedController.php @@ -0,0 +1,55 @@ +request->getStringParam('token'); + $user = $this->user->getByToken($token); + + // Token verification + if (empty($user)) { + throw AccessForbiddenException::getInstance()->withoutLayout(); + } + + $this->response->xml($this->template->render('feed/user', array( + 'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermission->getActiveProjectIds($user['id'])), + 'user' => $user, + ))); + } + + /** + * RSS feed for a project + * + * @access public + */ + public function project() + { + $token = $this->request->getStringParam('token'); + $project = $this->project->getByToken($token); + + if (empty($project)) { + throw AccessForbiddenException::getInstance()->withoutLayout(); + } + + $this->response->xml($this->template->render('feed/project', array( + 'events' => $this->helper->projectActivity->getProjectEvents($project['id']), + 'project' => $project, + ))); + } +} -- cgit v1.2.3