set('db', new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']), true); $di->set('router', 'AltoRouter', true); $di->set('lang', new Languages(DI::getInstance()->get('db'),'DE'), true); $di->set('auth', new Authentication(DI::getInstance()->get('db')), true); $settings = new System(DI::getInstance()->get('db')); $router = DI::getInstance()->get('router'); $lang = DI::getInstance()->get('lang'); $auth = DI::getInstance()->get('auth'); /** * Check login if Login Form was sended */ if($_POST['sender'] == 1) { $auth->loginAction($_POST['admin_username'], $_POST['admin_password'], 0); } /** * Check Login with every Page Reload */ if($auth->isLogin()) { $admin = new UserManager(DI::getInstance()->get('db'), $_SESSION['scf_userId']); $di->set('acl', new AclManager(DI::getInstance()->get('db'), $admin->getValue('userGroup')), true); } else { $admin = new UserManager(DI::getInstance()->get('db'), '0'); $di->set('acl', new AclManager(DI::getInstance()->get('db'), '0'), true); } $acl = DI::getInstance()->get('acl'); $tpl = new Templates($settings, $auth, $acl, $router, $lang, $admin);