修复全新部署首跑顺序:装库先于2FA引导;install表单补令牌透传

- security.php 新增 secInstallPending():install.php 在场且无 install.lock = 装库未完成
- 引导模式下所有入口先 302 到 install.php,装完自删后才轮到 admin_2fa_setup.php
- admin_login/admin_2fa_setup 兜住本机直连与已引导未装库两种入口(secTokenUrl 带令牌)
- install.php 表单隐藏 token 字段,已引导站点 POST 也能过第三层门禁
This commit is contained in:
ypsdf1
2026-10-09 18:56:46 +08:00
parent e1010927e5
commit fc8c82b188
4 changed files with 41 additions and 0 deletions
+5
View File
@@ -465,6 +465,11 @@ ul{margin:6px 0;padding-left:20px}
<form method="post" action="install.php" autocomplete="off">
<input type="hidden" name="act" value="save">
<input type="hidden" name="csrf" value="<?php echo htmlspecialchars($csrf, ENT_QUOTES, 'UTF-8'); ?>">
<?php if (secToken() !== ''): ?>
<!-- 已引导站点(config 有 SEC_ACCESS_TOKEN):POST 也要过第三层令牌门禁;
本页只会渲染给已经过了门禁的访问者,令牌不出圈。全新站点为空 → 不输出。 -->
<input type="hidden" name="token" value="<?php echo htmlspecialchars(secToken(), ENT_QUOTES, 'UTF-8'); ?>">
<?php endif; ?>
<h2>运行模式</h2>
<div class="modes">