регистрация и проверка на админа в админке

This commit is contained in:
rsgrinko committed 2022-06-21 20:25:56 +03:00
1 parent 842bd20a28
commit 84281eca9f
6 files changed
+157 -6

No files matched your search

+7 -1
View File
@@ -3,12 +3,18 @@
use Core\Models\User;
require_once __DIR__ . '/bootstrap.php';
if (!User::isAuthorized() and $_SERVER['REQUEST_URI'] !== '/login.php') {
if (!User::isAuthorized() && $_SERVER['REQUEST_URI'] !== '/login.php') {
header('Location: login.php');
die();
}
global $USER, $arUser;
if(!$USER->isAdmin()) {
User::logout();
echo 'Вы не админ, сессия разорвана.';
die();
}
?>
<!DOCTYPE html>
<html lang="en">