регистрация и проверка на админа в админке
This commit is contained in:
1 parent
84281eca9f
commit
91a01fca41
1 file changed
+4
-7
@@ -3,16 +3,13 @@
|
|||||||
use Core\Models\User;
|
use Core\Models\User;
|
||||||
|
|
||||||
require_once __DIR__ . '/bootstrap.php';
|
require_once __DIR__ . '/bootstrap.php';
|
||||||
|
global $USER, $arUser;
|
||||||
|
|
||||||
if (!User::isAuthorized() && $_SERVER['REQUEST_URI'] !== '/login.php') {
|
if (!User::isAuthorized() && $_SERVER['REQUEST_URI'] !== '/login.php') {
|
||||||
header('Location: login.php');
|
header('Location: login.php');
|
||||||
die();
|
die();
|
||||||
}
|
} elseif (!$USER->isAdmin()) {
|
||||||
|
header('Location: ../index.php');
|
||||||
global $USER, $arUser;
|
|
||||||
|
|
||||||
if(!$USER->isAdmin()) {
|
|
||||||
User::logout();
|
|
||||||
echo 'Вы не админ, сессия разорвана.';
|
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in new issue
Block a user