MVC, rename 404 page to not_found, make sure authentication failure still redirects to the login page

This commit is contained in:
Ad Schellevis 2018-03-05 10:18:20 +01:00
parent 9fc4cee31f
commit ae3b64915e
2 changed files with 5 additions and 2 deletions

View File

@ -42,8 +42,11 @@ class IndexController extends \OPNsense\Base\IndexController
public function indexAction()
{
$this->view->title = gettext("Page not found");
$this->view->pick('OPNsense/Core/index');
$this->response->setStatusCode(404, "Not Found");
$this->view->pick('OPNsense/Core/not_found');
if ( $this->response->getStatusCode() != '302') {
// don't send 404 when redirecting to login page
$this->response->setStatusCode(404, "Not Found");
}
return;
}
}