Example #1
0
 /**
  * Common method to get project filters
  *
  * @access protected
  */
 protected function getProjectFilters($controller, $action)
 {
     $project = $this->getProject();
     $search = $this->request->getStringParam('search', $this->userSession->getFilters($project['id']));
     $board_selector = $this->projectPermission->getAllowedProjects($this->userSession->getId());
     unset($board_selector[$project['id']]);
     $filters = array('controller' => $controller, 'action' => $action, 'project_id' => $project['id'], 'search' => urldecode($search));
     $this->userSession->setFilters($project['id'], $filters['search']);
     return array('project' => $project, 'board_selector' => $board_selector, 'filters' => $filters, 'title' => $project['name']);
 }
Example #2
0
 /**
  * Check if the CSRF token from the URL is correct
  *
  * @access protected
  */
 protected function checkCSRFParam()
 {
     if (!Security::validateCSRFToken($this->request->getStringParam('csrf_token'))) {
         $this->forbidden();
     }
 }
Example #3
0
 /**
  * Check webhook token
  *
  * @access protected
  */
 protected function checkWebhookToken()
 {
     if ($this->config->get('webhook_token') !== $this->request->getStringParam('token')) {
         $this->response->text('Not Authorized', 401);
     }
 }