|
|
@ -40,12 +40,13 @@ class FrontController {
|
|
|
|
$match = $this->router->match();
|
|
|
|
$match = $this->router->match();
|
|
|
|
if ($match) {
|
|
|
|
if ($match) {
|
|
|
|
$this->handleMatch($match, $session);
|
|
|
|
$this->handleMatch($match, $session);
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->displayViewByKind(ViewHttpResponse::twig("error.html.twig", [
|
|
|
|
$this->displayViewByKind(ViewHttpResponse::twig("error.html.twig", [
|
|
|
|
'failures' => [ValidationFail::notFound("Could not find page ${_SERVER['REQUEST_URI']}.")],
|
|
|
|
'failures' => [ValidationFail::notFound("Could not find page ${_SERVER['REQUEST_URI']}.")],
|
|
|
|
], HttpCodes::NOT_FOUND));
|
|
|
|
], HttpCodes::NOT_FOUND));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create a new instance of an AltoRouter
|
|
|
|
* Create a new instance of an AltoRouter
|
|
|
@ -96,6 +97,8 @@ class FrontController {
|
|
|
|
if ($controllerName != self::VISITOR_CONTROLLER) {
|
|
|
|
if ($controllerName != self::VISITOR_CONTROLLER) {
|
|
|
|
$account = $session->getAccount();
|
|
|
|
$account = $session->getAccount();
|
|
|
|
if ($account == null) {
|
|
|
|
if ($account == null) {
|
|
|
|
|
|
|
|
// put in the session the initial url the user wanted to get
|
|
|
|
|
|
|
|
$session->setInitialTarget($_SERVER['REQUEST_URI']);
|
|
|
|
return HttpResponse::redirect($this->basePath . "/visitor/login");
|
|
|
|
return HttpResponse::redirect($this->basePath . "/visitor/login");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|