Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.
This commit is contained in:
+1
-20
@@ -1,27 +1,8 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!$_SESSION['uid']) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once 'functions.php';
|
||||
$user = $user ?? 0;
|
||||
|
||||
if ($user->level < 1) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->room != 25) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
|
||||
|
||||
$putItemCost = (int)filter_input(INPUT_POST, 'cost', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
|
||||
$putItemId = (int)filter_input(INPUT_POST, 'putId', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
|
||||
$returningItemId = (int)filter_input(INPUT_GET, 'back', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
|
||||
|
||||
Reference in New Issue
Block a user