Commit 6dca1114 authored by Ad Schellevis's avatar Ad Schellevis

hook Phalcon controllers into current authentication

parent 44de656e
...@@ -51,8 +51,10 @@ class ApiControllerBase extends Controller ...@@ -51,8 +51,10 @@ class ApiControllerBase extends Controller
*/ */
public function beforeExecuteRoute($dispatcher) public function beforeExecuteRoute($dispatcher)
{ {
// use authentication of legacy OPNsense.
//$auth = $this->session->get('auth'); if ($this->session->has("Logged_In") == false) {
$this->response->redirect("/", true);
}
} }
/** /**
......
...@@ -66,6 +66,10 @@ class ControllerBase extends Controller ...@@ -66,6 +66,10 @@ class ControllerBase extends Controller
*/ */
public function beforeExecuteRoute($dispatcher) public function beforeExecuteRoute($dispatcher)
{ {
// use authentication of legacy OPNsense.
if ($this->session->has("Logged_In") == false) {
$this->response->redirect("/", true);
}
// Execute before every found action // Execute before every found action
$this->view->setVar('lang', $this->getTranslator()); $this->view->setVar('lang', $this->getTranslator());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment