feat: redirect to login instead of return 403
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-06 20:28:43 +08:00
parent c2c569da31
commit c5bb4a1a67
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
39 changed files with 39 additions and 39 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -5,7 +5,7 @@
$REQUIRE_LIB['mathjax'] = ''; $REQUIRE_LIB['mathjax'] = '';
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!validateUInt($_GET['id']) || !($contest = queryContest($_GET['id']))) { if (!validateUInt($_GET['id']) || !($contest = queryContest($_GET['id']))) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isset($_COOKIE['bootstrap4'])) { if (!isset($_COOKIE['bootstrap4'])) {

View File

@ -2,7 +2,7 @@
requirePHPLib('judger'); requirePHPLib('judger');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser) && $_GET['type'] != 'attachment') { if (!isNormalUser($myUser) && $_GET['type'] != 'attachment') {

View File

@ -4,7 +4,7 @@
requirePHPLib('data'); requirePHPLib('data');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -4,7 +4,7 @@
requirePHPLib('data'); requirePHPLib('data');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -4,7 +4,7 @@
requirePHPLib('data'); requirePHPLib('data');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -3,7 +3,7 @@
requirePHPLib('judger'); requirePHPLib('judger');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!validateUInt($_GET['id']) || !($problem = queryProblemBrief($_GET['id']))) { if (!validateUInt($_GET['id']) || !($problem = queryProblemBrief($_GET['id']))) {

View File

@ -4,7 +4,7 @@
requirePHPLib('data'); requirePHPLib('data');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
requirePHPLib('form'); requirePHPLib('form');

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
requirePHPLib('form'); requirePHPLib('form');

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isset($_COOKIE['bootstrap4'])) { if (!isset($_COOKIE['bootstrap4'])) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -4,7 +4,7 @@
requirePHPLib('data'); requirePHPLib('data');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -5,7 +5,7 @@
$REQUIRE_LIB['bootstrap5'] = ''; $REQUIRE_LIB['bootstrap5'] = '';
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!validateUInt($_GET['id']) || !($problem = queryProblemBrief($_GET['id']))) { if (!validateUInt($_GET['id']) || !($problem = queryProblemBrief($_GET['id']))) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!validateUInt($_GET['id']) || !($problem = queryProblemBrief($_GET['id']))) { if (!validateUInt($_GET['id']) || !($problem = queryProblemBrief($_GET['id']))) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
$REQUIRE_LIB['bootstrap5'] = ''; $REQUIRE_LIB['bootstrap5'] = '';

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
$REQUIRE_LIB['bootstrap5'] = ''; $REQUIRE_LIB['bootstrap5'] = '';

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
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)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!UOJContext::hasBlogPermission()) { if (!UOJContext::hasBlogPermission()) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!UOJContext::hasBlogPermission()) { if (!UOJContext::hasBlogPermission()) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isset($_COOKIE['bootstrap4'])) { if (!isset($_COOKIE['bootstrap4'])) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
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)) {

View File

@ -2,7 +2,7 @@
requirePHPLib('form'); requirePHPLib('form');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!UOJContext::hasBlogPermission()) { if (!UOJContext::hasBlogPermission()) {

View File

@ -3,7 +3,7 @@
requirePHPLib('judger'); requirePHPLib('judger');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!validateUInt($_GET['id']) || !($submission = querySubmission($_GET['id']))) { if (!validateUInt($_GET['id']) || !($submission = querySubmission($_GET['id']))) {

View File

@ -1,7 +1,7 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!is_array($_GET['get'])) { if (!is_array($_GET['get'])) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {

View File

@ -1,6 +1,6 @@
<?php <?php
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); redirectToLogin();
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {