コード例 #1
0
 /**
  * Display the public version of a board
  * Access checked by a simple token, no user login, read only, auto-refresh
  *
  * @access public
  */
 public function readonly()
 {
     $token = $this->request->getStringParam('token');
     $project = $this->projectModel->getByToken($token);
     if (empty($project)) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     $this->response->html($this->helper->layout->app('board/view_public', array('project' => $project, 'swimlanes' => BoardFormatter::getInstance($this->container)->withProjectId($project['id'])->withQuery($this->taskFinderModel->getExtendedQuery())->format(), 'title' => $project['name'], 'description' => $project['description'], 'no_layout' => true, 'not_editable' => true, 'board_public_refresh_interval' => $this->configModel->get('board_public_refresh_interval'), 'board_private_refresh_interval' => $this->configModel->get('board_private_refresh_interval'), 'board_highlight_period' => $this->configModel->get('board_highlight_period'))));
 }
コード例 #2
0
ファイル: Feed.php プロジェクト: xavividal/kanboard
 /**
  * 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)));
 }
コード例 #3
0
 /**
  * Execute middleware
  */
 public function execute()
 {
     if (!$this->authenticationManager->checkCurrentSession()) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     if (!$this->isPublicAccess()) {
         $this->handleAuthentication();
     }
     $this->next();
 }
コード例 #4
0
ファイル: FeedController.php プロジェクト: renothing/kanboard
 /**
  * RSS feed for a project
  *
  * @access public
  */
 public function project()
 {
     $token = $this->request->getStringParam('token');
     $project = $this->projectModel->getByToken($token);
     if (empty($project)) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     $events = $this->helper->projectActivity->getProjectEvents($project['id']);
     $feedBuilder = AtomFeedBuilder::create()->withTitle(e('%s\'s activity', $project['name']))->withFeedUrl($this->helper->url->to('FeedController', 'project', array('token' => $project['token']), '', true))->withSiteUrl($this->helper->url->base())->withDate(new DateTime());
     $this->response->xml($this->buildFeedItems($events, $feedBuilder)->build());
 }
コード例 #5
0
ファイル: Board.php プロジェクト: xavividal/kanboard
 /**
  * Display the public version of a board
  * Access checked by a simple token, no user login, read only, auto-refresh
  *
  * @access public
  */
 public function readonly()
 {
     $token = $this->request->getStringParam('token');
     $project = $this->project->getByToken($token);
     // Token verification
     if (empty($project)) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     // Display the board with a specific layout
     $this->response->html($this->helper->layout->app('board/view_public', array('project' => $project, 'swimlanes' => $this->board->getBoard($project['id']), 'title' => $project['name'], 'description' => $project['description'], 'no_layout' => true, 'not_editable' => true, 'board_public_refresh_interval' => $this->config->get('board_public_refresh_interval'), 'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'), 'board_highlight_period' => $this->config->get('board_highlight_period'))));
 }
コード例 #6
0
 /**
  * Public access (display a task)
  *
  * @access public
  */
 public function readonly()
 {
     $project = $this->projectModel->getByToken($this->request->getStringParam('token'));
     if (empty($project)) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     $task = $this->taskFinderModel->getDetails($this->request->getIntegerParam('task_id'));
     if (empty($task)) {
         throw PageNotFoundException::getInstance()->withoutLayout();
     }
     if ($task['project_id'] != $project['id']) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     $this->response->html($this->helper->layout->app('task/public', array('project' => $project, 'comments' => $this->commentModel->getAll($task['id']), 'subtasks' => $this->subtaskModel->getAll($task['id']), 'links' => $this->taskLinkModel->getAllGroupedByLabel($task['id']), 'task' => $task, 'columns_list' => $this->columnModel->getList($task['project_id']), 'colors_list' => $this->colorModel->getList(), 'tags' => $this->taskTagModel->getList($task['id']), 'title' => $task['title'], 'no_layout' => true, 'auto_refresh' => true, 'not_editable' => true)));
 }
コード例 #7
0
ファイル: Ical.php プロジェクト: xavividal/kanboard
 /**
  * Get project iCalendar
  *
  * @access public
  */
 public function project()
 {
     $token = $this->request->getStringParam('token');
     $project = $this->project->getByToken($token);
     // Token verification
     if (empty($project)) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
     // Common filter
     $queryBuilder = new QueryBuilder();
     $queryBuilder->withQuery($this->taskFinder->getICalQuery())->withFilter(new TaskStatusFilter(TaskModel::STATUS_OPEN))->withFilter(new TaskProjectFilter($project['id']));
     // Calendar properties
     $calendar = new iCalendar('Kanboard');
     $calendar->setName($project['name']);
     $calendar->setDescription($project['name']);
     $calendar->setPublishedTTL('PT1H');
     $this->renderCalendar($queryBuilder, $calendar);
 }
コード例 #8
0
 /**
  * Check feature availability
  */
 private function checkActivation()
 {
     if ($this->configModel->get('password_reset', 0) == 0) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
 }
コード例 #9
0
ファイル: BaseController.php プロジェクト: renothing/kanboard
 /**
  * Check webhook token
  *
  * @access protected
  */
 protected function checkWebhookToken()
 {
     if ($this->configModel->get('webhook_token') !== $this->request->getStringParam('token')) {
         throw AccessForbiddenException::getInstance()->withoutLayout();
     }
 }