= 70300) { session_set_cookie_params(['lifetime' => 0, 'path' => '/', 'secure' => $sessionSecure, 'httponly' => true, 'samesite' => 'Lax']); } else { session_set_cookie_params(0, '/; samesite=Lax', '', $sessionSecure, true); } session_start(); // 提前初始化 CSRF token 并下发双提交 Cookie,确保即使页面未注入 meta 也能通过 cookie 兜底校验 mnbt_csrf_token(); $scriptpath=str_replace('\\','/',$_SERVER['SCRIPT_NAME']); $sitepath = substr($scriptpath, 0, strrpos($scriptpath, '/')); $siteurl = ($_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$sitepath.'/'; $docRoot = rtrim(str_replace('\\', '/', isset($_SERVER['DOCUMENT_ROOT']) ? realpath($_SERVER['DOCUMENT_ROOT']) : ''), '/'); $projFs = rtrim(str_replace('\\', '/', realpath(ROOT)), '/'); $siteWebRoot = ($docRoot && strpos($projFs, $docRoot) === 0) ? rtrim(substr($projFs, strlen($docRoot)), '/') . '/' : '/'; $install_url = ($_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $siteWebRoot . 'install'; if(is_file(SYSTEM_ROOT.'360safe/360webscan.php')){//360网站卫士 require_once(SYSTEM_ROOT.'360safe/360webscan.php'); } if (!is_file(ROOT.'config.php')) { header("Location: " . $install_url); exit(); } require ROOT.'config.php'; if(!defined('SQLITE') && (!$dbconfig['user']||!$dbconfig['pwd']||!$dbconfig['dbname']))//检测安装 { header("Location: " . $install_url); exit(); } //连接数据库 include_once(SYSTEM_ROOT."db.class.php"); $DB=new DB($dbconfig['host'],$dbconfig['user'],$dbconfig['pwd'],$dbconfig['dbname'],$dbconfig['port']); if(!$DB->get_all_prepare("select * from MN_config where 1"))//检测安装2 { header("Location: " . $install_url); exit(); } $siteid=1; $conf=$DB->get_row_prepare("SELECT * FROM MN_config WHERE id=? limit 1", [$siteid]);//获取系统配置 $password_hash='!@#%!s!0'; include_once(SYSTEM_ROOT."Response.php"); include_once(SYSTEM_ROOT."function.php"); include_once(SYSTEM_ROOT."member.php"); include_once(SYSTEM_ROOT."theme.php"); include_once(SYSTEM_ROOT."plugin.php"); include_once(SYSTEM_ROOT."frontend.php"); require_once(SYSTEM_ROOT."lib/pay.function.php"); mnbt_plugins_boot(); ?>