Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.

This commit is contained in:
lopar
2020-10-30 01:30:05 +02:00
parent 2024a6fac7
commit 32c72e3413
143 changed files with 6986 additions and 7329 deletions
+3 -134
View File
@@ -6,11 +6,6 @@ if ($get == 'exit') {
session_destroy();
header("Location: fight.php");
}
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once 'functions.php';
try {
@@ -18,15 +13,6 @@ try {
} catch (\Krugozor\Database\Mysql\Exception $e) {
echo "<div class='debug' '>Ошибка: " . $e->getMessage() . "<br> Стек: " . $e->getTraceAsString() . "</div>";
}
if ($user->battle) {
header('location: fbattle.php');
exit();
}
//БС
if ($user->in_tower == 1) {
header('Location: towerin.php');
exit();
}
// Инициализируем входящие GET\POST переменные.
$goto = $_GET['goto'] ?? null;
@@ -77,125 +63,8 @@ if ($edit === null) {
header('Location: city.php');
exit();
}
if ($user->room == 22) {
header('Location: shop.php');
exit();
}
if ($user->room == 23) {
header('Location: repair.php');
exit();
}
if ($user->room == 25) {
header('Location: comission.php');
exit();
}
if ($user->room == 27) {
header('Location: post.php');
exit();
}
if ($user->room == 29) {
header('Location: bank.php');
exit();
}
if ($user->room == 31) {
header('Location: tower.php');
exit();
}
if ($user->room == 30) {
header('Location: clan_create.php');
exit();
}
if ($user->room == 34) {
header('Location: fshop.php');
exit();
}
if ($user->room == 45) {
header('Location: clan_castle.php');
exit();
}
if ($user->room == 53) {
header('Location: library.php');
exit();
}
if ($user->room == 61) {
header('Location: akadem.php');
exit();
}
if ($user->room == 650) {
header('Location: ul_clans.php');
exit();
}
//ЦХ
if ($user->room == 600) {
header('Location: c_haos.php');
exit();
}
if ($user->room == 601) {
header('Location: c_haos_in.php');
exit();
}
if ($user->room == 602) {
header('Location: c_park.php');
exit();
}
if ($user->room == 603) {
header('Location: aren_of_angels.php');
exit();
}
if ($user->room == 620) {
header('Location: enter_cave.php');
exit();
}
if ($user->room == 621) {
header('Location: cave.php');
exit();
}
if ($user->room == 660) {
header('Location: hostel.php');
exit();
}
if ($user->room == 661) {
header('Location: hostel_room.php');
exit();
}
if ($user->room == 662) {
header('Location: quest_room.php');
exit();
}
if ($user->room == 760) {
header('Location: c_forest.php');
exit();
}
if ($user->room == 1000) {
header('Location: solib/enterbezdna.php');
exit();
}
if ($user->room == 1001) {
header('Location: solib/dungeon.php');
exit();
}
if ($user->room == 1051) {
header('Location: lab_enter.php');
exit();
}
if ($user->room == 1052) {
header('Location: labirint.php');
exit();
}
if ($user->room == 402) {
header('Location: vxod.php');
exit();
}
if ($user->room == 403) {
header('Location: canalizaciya.php');
exit();
}
if ($user->room == 1055) {
header('Location: group_arena.php');
exit();
}
if ($user->room == 666) {
header('Location: jail.php');
if (in_array($user->room, [22, 23, 25, 27, 29, 30, 31, 34, 45, 53, 61, 402, 403, 600, 601, 602, 603, 620, 621, 650, 660, 661, 662, 666, 760, 1051, 1052, 1055])) {
header('location: ' . \Battles\Travel::$roomFileName[$user->room]);
exit();
}
}
@@ -557,7 +426,7 @@ if ($edit) {
<?php endif; ?>
<div class="button-group">
<?php if ($user->room == 20): ?>
<input class="button icon move" type="submit" name="move_inside" value="Войти внутрь">
<input class="button icon move" type="submit" name="move_inside" value="Войти внутрь">
<?php elseif ($user->room == 1): ?>
<input class="button primary" type="submit" name="battlefield" value="Поединки">
<input class="button icon move" type="submit" name="move_outside" value="Выйти на улицу">