feat: 实现管理员权限系统并本地化sweetalert资源

- 添加管理员权限系统,支持all/say/review三种权限类型
- 为各管理页面添加权限检查逻辑
- 将sweetalert从CDN改为本地资源
- 添加统一的登出确认弹窗和logout.php处理
- 更新config.php中的数据库和SMTP配置
This commit is contained in:
2025-07-15 21:30:51 +08:00
parent 3ca83c8662
commit d4dc9e1edc
20 changed files with 263 additions and 46 deletions

View File

@@ -2,10 +2,17 @@
require_once '../config.php';
session_start();
// 检查管理员登录状态
// 检查是否已登录
if (!isset($_SESSION['admin'])) {
header('Location: login.php');
exit;
exit();
}
// 检查权限
if ($_SESSION['admin']['permission'] != 'all') {
$redirect = $_SESSION['admin']['permission'] == 'say' ? 'announcements.php' : 'review_apps.php';
header("Location: $redirect");
exit();
}
// 验证App ID