Файл: app/admin/user/enter.php
Строк: 6
<?php
Core::only('level', 4);
if (filter_has_var(INPUT_GET, 'id'))
{
$filter = [
'id' => filter_input(INPUT_GET, 'id', FILTER_UNSAFE_RAW)
];
$profile = $db->query("SELECT `id`, `token`, `level` FROM `users` WHERE `id` = '".$filter['id']."' LIMIT 1")->fetch();
}
if (empty($profile) || $user['level'] < $profile['level'])
{
Core::go("/");
}
setcookie('token', $profile['token'], time() + 60 * 60 * 24 * 31 * 365, '/');
setcookie('id', $profile['id'], time() + 60 * 60 * 24 * 31 * 365, '/');
Core::go('/');