start(); // ################################################################ // ERROR REPORTING // ################################################################ set_error_handler('error_handler'); // ################################################################ // URCENI, KTERE STRANKY JSOU VOLNE PRISTUPNE // ################################################################ if (!isset($_GET['s'])) { $_GET['s'] = null; } // ################################################################ // jestlize se jedna o verejnou stranku, nevyzadovat zalogovanisada if (!isset($publicArea)) { $legacyAdminCredentials = ServiceContainer::getService(\KupShop\AdminBundle\Util\LegacyAdminCredentials::class); $legacyAdminCredentials->setAdminGlobalVars(function () { redirect('index.php?error=4&url='.urlencode($_SERVER['REQUEST_URI'])); }); if (isSuperuser()) { ini_set('display_errors', '1'); } } // ################################################################ // SMARTY TEMPLATES // ################################################################ $ctrl = []; $ctrl['admin'] = true; $ctrl['logged'] = false; $ctrl['currUrl'] = [ 'Abs' => $cfg['Addr']['full'].$_SERVER['REQUEST_URI'], 'Rel' => $_SERVER['REQUEST_URI'], ]; $userContext = ServiceContainer::getService(UserContext::class); $userContext->forceEmpty(); $txt_str = []; // ################################################################ // VOLBA JAZYKA // ################################################################ loadLanguage('base'); // ################################################################ // ZISKANI NASTAVENI Z DATABAZE // ################################################################ $dbcfg = Settings::getDefault(); // prevedeni aktivnich modulu pro SMARTY $cfg['module'] = []; foreach ($cfg['Modules'] as $index => $module) { if (is_numeric($index)) { $cfg['module'][$module] = true; } else { $cfg['module'][$index] = true; } } if (findModule('currencies')) { $currencyContext = ServiceContainer::getService(CurrencyContext::class); $currencyContext->activate($currencyContext->getDefaultId()); if (empty($ctrl['currency'])) { $ctrl['currency'] = $dbcfg['currency']; } }