code clean

This commit is contained in:
Igor Barkov (iwork)
2021-08-26 19:15:47 +03:00
parent 5e264f837a
commit 9c7fcda600
5 changed files with 74 additions and 68 deletions
+8 -2
View File
@@ -13,12 +13,18 @@ use Battles\User;
use Battles\UserInfo;
require_once 'config.php';
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
} else {
$user = new User($_SESSION['uid']);
User::$current = new User($_SESSION['uid']);
if (empty($user) && $_SESSION['uid']) {
$user = new User($_SESSION['uid']);
}
if (empty(User::$current) && $_SESSION['uid']) {
User::$current = new User($_SESSION['uid']);
}
}
if (User::$current->getId() && User::$current->getBlock()) {
exit('user blocked!');