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
requirePHPLib('form');
if (!Auth::check()) {
if (!Auth::check() && UOJConfig::$data['switch']['force-login']) {
redirectToLogin();
}
if (!isNormalUser($myUser) && UOJConfig::$data['switch']['force-login']) {
become403Page();
}
$REQUIRE_LIB['bootstrap5'] = '';
$REQUIRE_LIB['calendar_heatmap'] = '';
?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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