Зимние правки. MVC/

Signed-off-by: lopar <lopar.4ever@gmail.com>
This commit is contained in:
lopar
2022-08-09 22:57:43 +03:00
parent 0f62ee20e7
commit b9b4c01cf0
104 changed files with 2254 additions and 2086 deletions
+9 -1
View File
@@ -9,7 +9,15 @@ use Battles\User;
require_once "functions.php";
$user = User::getInstance();
if (User::getInstance()->getInTower() != 1) {
$check = new class{
public static function getInTower(): bool
{
return \Battles\Database\Db::getInstance()->fetchColumn('select in_tower from users where id = ?', User::getInstance()->getId()) === 1;
}
};
if (!$check::getInTower()) {
header('Location: main.php');
exit;
}