fix(web/blog): ban contest_only user

This commit is contained in:
Baoshuo Ren 2022-10-08 14:10:14 +08:00
parent edb8176f8f
commit 4779cb3bcc
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
9 changed files with 41 additions and 9 deletions

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
$REQUIRE_LIB['bootstrap5'] = ''; $REQUIRE_LIB['bootstrap5'] = '';
$REQUIRE_LIB['calendar_heatmap'] = ''; $REQUIRE_LIB['calendar_heatmap'] = '';
?> ?>

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
$REQUIRE_LIB['bootstrap5'] = ''; $REQUIRE_LIB['bootstrap5'] = '';
$blogs_cond = "poster = '".UOJContext::userid()."'"; $blogs_cond = "poster = '".UOJContext::userid()."'";

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!isset($_GET['id']) || !validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id'])) || !UOJContext::isHis($blog)) { if (!isset($_GET['id']) || !validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id'])) || !UOJContext::isHis($blog)) {
become404Page(); become404Page();
} }

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!UOJContext::hasBlogPermission()) { if (!UOJContext::hasBlogPermission()) {
become403Page(); become403Page();
} }

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!UOJContext::hasBlogPermission()) { if (!UOJContext::hasBlogPermission()) {
become403Page(); become403Page();
} }

View File

@ -1,8 +1,12 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!isset($_COOKIE['bootstrap4'])) { if (!isset($_COOKIE['bootstrap4'])) {
$REQUIRE_LIB['bootstrap5'] = ''; $REQUIRE_LIB['bootstrap5'] = '';
} }

View File

@ -1,5 +1,5 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!isset($_GET['id']) || !validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id'])) || !UOJContext::isHisSlide($blog)) { if (!isset($_GET['id']) || !validateUInt($_GET['id']) || !($blog = queryBlog($_GET['id'])) || !UOJContext::isHisSlide($blog)) {
become404Page(); become404Page();
} }

View File

@ -1,10 +1,14 @@
<?php <?php
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin(); redirectToLogin();
} }
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
if (!UOJContext::hasBlogPermission()) { if (!UOJContext::hasBlogPermission()) {
become403Page(); become403Page();
} }