Auth->allow(['display']); } /** * Displays a view * * @param array ...$path Path segments. * @return \Cake\Http\Response|null * @throws \Cake\Http\Exception\ForbiddenException When a directory traversal attempt. * @throws \Cake\Http\Exception\NotFoundException When the view file could not * be found or \Cake\View\Exception\MissingTemplateException in debug mode. */ public function display(...$path) { $count = count($path); if (!$count) { return $this->redirect('/'); } if (in_array('..', $path, true) || in_array('.', $path, true)) { throw new ForbiddenException(); } $page = $subpage = null; if (!empty($path[0])) { $page = $path[0]; } if (!empty($path[1])) { $subpage = $path[1]; } $session = $this->getRequest()->getSession(); $result = $this->requestLogin(); if($result !== true) { return $result; } $user = $session->read('StateUser'); $login_server_session = $this->request->getCookie('GRADIDO_LOGIN', ''); $this->set(compact('page', 'subpage', 'user', 'login_server_session')); try { $this->render(implode('/', $path)); } catch (MissingTemplateException $exception) { if (Configure::read('debug')) { throw $exception; } throw new NotFoundException(); } } }