/**
  * @inheritdoc
  */
 public function forbidden($requestUrl, $code = Response::HTTP_FORBIDDEN, $headers = array())
 {
     // set page for redirection after successful login
     $this->session->set('rUri', $requestUrl);
     // load page forbidden
     $item = '/page_forbidden';
     $c = Page::getByPath($item);
     if (is_object($c) && !$c->isError()) {
         $this->request->setCurrentPage($c);
         return $this->controller($c->getPageController(), $code, $headers);
     }
     $cnt = $this->app->make(PageForbidden::class);
     $this->controller($cnt, $code, $headers);
 }
 private function collectionNotFound(Collection $collection, Request $request, array $headers)
 {
     // if we don't have a path and we're doing cID, then this automatically fires a 404.
     if (!$request->getPath() && $request->get('cID')) {
         return $this->notFound('', Response::HTTP_NOT_FOUND, $headers);
     }
     // let's test to see if this is, in fact, the home page,
     // and we're routing arguments onto it (which is screwing up the path.)
     $home = Page::getByID(HOME_CID);
     $request->setCurrentPage($home);
     $homeController = $home->getPageController();
     $homeController->setupRequestActionAndParameters($request);
     $response = $homeController->validateRequest();
     if ($response instanceof \Symfony\Component\HttpFoundation\Response) {
         return $response;
     } elseif ($response === true) {
         return $this->controller($homeController);
     } else {
         return $this->notFound('', Response::HTTP_NOT_FOUND, $headers);
     }
 }
示例#3
0
 /**
  * @param \Concrete\Core\Page\Page $c
  */
 public function setCurrentPage(Concrete\Core\Page\Page $c)
 {
     return parent::setCurrentPage($c);
 }