您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. session_start();
  3. define('DS', '/');
  4. define('ROOTDIR', __DIR__);
  5. define('APP', 'Application');
  6. /**
  7. * load all important files
  8. */
  9. require_once __DIR__ ."/autoload.php";
  10. require_once __DIR__ ."/vendor/autoload.php";
  11. require_once ROOTDIR . DS . APP . "/Config/config.php";
  12. use Symfony\Component\Debug\Debug;
  13. use SCF\Core\DI;
  14. use SCF\Core\Database;
  15. use SCF\Core\System;
  16. use SCF\Core\Languages;
  17. use SCF\Core\Templates;
  18. use SCF\Core\Authentication;
  19. use SCF\Core\UserManager;
  20. use SCF\Core\AclManager;
  21. Debug::enable('E_ALL & ~E_NOTICE');
  22. /**
  23. * Create instances of important classes
  24. */
  25. $di = DI::getInstance();
  26. $di->set('db', new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']), true);
  27. $di->set('router', 'AltoRouter', true);
  28. $di->set('lang', new Languages(DI::getInstance()->get('db'),'DE'), true);
  29. $di->set('auth', new Authentication(DI::getInstance()->get('db')), true);
  30. $settings = new System(DI::getInstance()->get('db'));
  31. $router = DI::getInstance()->get('router');
  32. $lang = DI::getInstance()->get('lang');
  33. $auth = DI::getInstance()->get('auth');
  34. /**
  35. * Check login if Login Form was sended
  36. */
  37. if($_POST['sender'] == 1) {
  38. $auth->loginAction($_POST['admin_username'], $_POST['admin_password'], 0);
  39. }
  40. /**
  41. * Check Login with every Page Reload
  42. */
  43. if($auth->isLogin()) {
  44. $admin = new UserManager(DI::getInstance()->get('db'), $_SESSION['scf_userId']);
  45. $di->set('acl', new AclManager(DI::getInstance()->get('db'), $admin->getValue('userGroup')), true);
  46. }
  47. else {
  48. $admin = new UserManager(DI::getInstance()->get('db'), '0');
  49. $di->set('acl', new AclManager(DI::getInstance()->get('db'), '0'), true);
  50. }
  51. $acl = DI::getInstance()->get('acl');
  52. $tpl = new Templates($settings, $auth, $acl, $router, $lang, $admin);