From 763db5fcb24b5a92f66210a54f21f3e4c7c09171 Mon Sep 17 00:00:00 2001 From: klarkxy <278370456@qq.com> Date: Sun, 20 Oct 2024 12:34:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=94=E8=B5=9B=E6=9D=83=E9=99=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/contest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/contest.php b/web/contest.php index 46ae36a..a0d4273 100644 --- a/web/contest.php +++ b/web/contest.php @@ -199,6 +199,13 @@ if (isset($_GET['cid'])) { $_SESSION[$OJ_NAME . '_' . $row['rightstr']] = true; } } + // 从testusers表里获取用户的比赛权限 + $sql = 'SELECT * from `testusers` WHERE `user_id`=?'; + $result = pdo_query($sql, $user_id); + foreach ($result as $row) { + $_SESSION[$OJ_NAME . '_c' . $row['contest_id']] = true; + } + if (isset($_SESSION[$OJ_NAME . '_vip'])) { // VIP mark can access all [VIP] marked contest $sql = "select contest_id from contest where title like '%[VIP]%'"; $result = pdo_query($sql);