diff --git a/index.php b/index.php index a5c1ebce..9cc72d5c 100644 --- a/index.php +++ b/index.php @@ -27,5 +27,4 @@ require_once 'common.php'; require_once SYSTEM . 'functions.php'; -$app = new \MyAAC\App\App(); -$app->run(); +app()->run(); diff --git a/system/src/App/App.php b/system/src/App/App.php index c083ea67..848950b8 100644 --- a/system/src/App/App.php +++ b/system/src/App/App.php @@ -35,6 +35,11 @@ class App $loginService = new LoginService(); $checkLogin = $loginService->checkLogin(); $this->accountLogged = $checkLogin['account']; + $this->isLoggedIn = $checkLogin['logged']; + + global $logged, $account_logged; + $logged = $this->isLoggedIn; + $account_logged = $this->accountLogged; $statusService = new StatusService(); $status = $statusService->checkStatus(); @@ -76,12 +81,9 @@ class App ]); } - global $template_path, $template_index; + global $template_path, $template_index, $menus; $title_full = (isset($title) ? $title . ' - ' : '') . $config['lua']['serverName']; - - global $logged, $account_logged; - $logged = $checkLogin['logged']; - $account_logged = $checkLogin['account']; + $menus = get_template_menus(); require $template_path . '/' . $template_index; diff --git a/system/src/Services/RouterService.php b/system/src/Services/RouterService.php index c98cfac3..caf15956 100644 --- a/system/src/Services/RouterService.php +++ b/system/src/Services/RouterService.php @@ -92,11 +92,8 @@ class RouterService $ignore = false; - /** @var boolean $logged */ - /** @var \OTS_Account $account_logged */ global $logged_access; $logged_access = 0; - $account_logged = app()->getAccountLogged(); if($logged && $account_logged && $account_logged->isLoaded()) { $logged_access = $account_logged->getAccess(); }