Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.
This commit is contained in:
@@ -3,22 +3,9 @@
|
||||
* Центральная площадь
|
||||
*/
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "functions.php";
|
||||
$user = $user ?? [];
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
if ($user->in_tower == 1) {
|
||||
header('Location: towerin.php');
|
||||
exit;
|
||||
}
|
||||
if ($user->zayavka) {
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user