hook Phalcon controllers into current authentication

This commit is contained in:
Ad Schellevis 2015-02-05 18:36:22 +01:00
parent 44de656e35
commit 6dca11144d
2 changed files with 8 additions and 2 deletions

View File

@ -51,8 +51,10 @@ class ApiControllerBase extends Controller
*/
public function beforeExecuteRoute($dispatcher)
{
//$auth = $this->session->get('auth');
// use authentication of legacy OPNsense.
if ($this->session->has("Logged_In") == false) {
$this->response->redirect("/", true);
}
}
/**

View File

@ -66,6 +66,10 @@ class ControllerBase extends Controller
*/
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
$this->view->setVar('lang', $this->getTranslator());
}