$_GET['lang'])); header('Location: http'.(!(empty($_SERVER['HTTPS']) || 'off' === $_SERVER['HTTPS']) || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO']) || (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && 'on' === $_SERVER['HTTP_X_FORWARDED_SSL']) ? 's' : '')."://$_SERVER[HTTP_HOST]/", true, 302); exit(); } function isValidTimeStamp(string $timestamp): bool { return ((string) (int) $timestamp === $timestamp) && ($timestamp <= PHP_INT_MAX) && ($timestamp >= ~PHP_INT_MAX); } function RunDollySites($installed) { require_once(MSSE_INC_DIR.'/sys_config.php'); MSConfig::RequireFile('filesystemstorage', 'tsystemmessages'); require_once(DOCUMENT_ROOT.'/lib/IndexController.php'); MSConfig::AddSoftware('DollySites '.Controllers::VERSION); $prefix ='controller.'; $action = false; if(!empty($_REQUEST['__dolly_action']) && 0 === strpos($_REQUEST['__dolly_action'], $prefix) && ($a = substr($_REQUEST['__dolly_action'], strlen($prefix)))) { $controllers = array('parse' => 2, 'get_encoding' => 1); if(isset($controllers[$a]) && ($i = 2 * isset($_POST['__dolly_action']) + isset($_GET['__dolly_action'])) && ($i & $controllers[$a])) { $action = $a; unset($_GET['__dolly_action']); unset($_POST['__dolly_action']); } else HTTP::Status(400); } if($installed) { if(isset($_GET['dollyeditor'])) $_GET['__dolly_action'] ='editor'; if(!empty($_GET['__dolly_action'])) require_once(MSSE_INC_DIR.'/actions.php'); } // auto remove cache $fname = MSSE_INC_DIR.'/storage/cache_settings.php'; $settings = \MaxieSystems\File::LoadArray($fname); $cache_time = (int)$settings['cache_time']; if ( $cache_time !== 0 ) { $removedCacheTime = trim(file_get_contents(DOCUMENT_ROOT . '/removed_cache_time.txt')); if ( isValidTimeStamp($removedCacheTime) ) { $cache_time_in_seconds = $cache_time * 60; $difference_in_seconds = time() - $removedCacheTime; if ( $difference_in_seconds >= $cache_time_in_seconds ) { CacheBackend::clearCache(); } } } // auto remove cache Controllers::setCharset('UTF-8'); $obj = new IndexController(); if($action) { $obj->{$action}(); exit; } return $obj; } if(DollyConfig::Get('base_url')) { $obj = RunDollySites(true); $obj->default_action(); exit; } $obj = new PreInstallCheckManager(); $obj->SetData('php:version', '5.6.0', '50.0.0'); // $obj->SetData('php:extensions', array('dom', 'mbstring', 'reflection')); // $obj->SetData('apache:modules', array('mod_headers', 'mod_rewrite')); try { $r = $obj->Run(); $obj = RunDollySites(false); $obj->startAuth(); $obj->start_dolly(true === $r ? null : $r); } catch(EPreInstallCheckFailed $e) { $message = $e->GetMessage(); require_once(DOCUMENT_ROOT.'/dolly_templates/no_install.php'); } exit;