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);