Файл: app/admin/user/control.php
Строк: 46
<?php
Core::only('level', 1);
if (filter_has_var(INPUT_GET, 'id'))
{
$filter = [
'id' => filter_input(INPUT_GET, 'id', FILTER_UNSAFE_RAW)
];
$profile = $db->query("SELECT * FROM `users` WHERE `id` = '".$filter['id']."' LIMIT 1")->fetch();
}
if (empty($profile) || $user['level'] < $profile['level'])
{
Core::go("/");
}
$smarty->header('Управление профилем');
$listing[] = [
'title' => Lang::word('IP') . ': <b>'. $profile['ip'] . '</b>',
'div' => 'warning'
];
$listing[] = [
'title' => Lang::word('Браузер') . ': <b>'. $profile['ua'] . '</b>',
'div' => 'warning'
];
$listing[] = [
'title' => Lang::word('Заблокировать'),
'url' => '/admin/user/block?id=' . $profile['id'],
'icon' => 'lock',
'div' => 'menu'
];
if ($user['level'] >= 2)
{
$listing[] = [
'title' => Lang::word('Редактировать'),
'url' => '/admin/user/edit?id=' . $profile['id'],
'icon' => 'pencil',
'div' => 'menu'
];
}
if ($user['level'] >= 3)
{
$listing[] = [
'title' => Lang::word('Очистить'),
'url' => '/admin/user/clean?id=' . $profile['id'],
'icon' => 'bin',
'div' => 'menu',
];
}
if ($user['level'] == 4)
{
$listing[] = [
'title' => Lang::word('Удалить'),
'url' => '/admin/user/delete?id=' . $profile['id'],
'icon' => 'bin2',
'div' => 'menu'
];
$listing[] = [
'title' => Lang::word('Войти'),
'url' => '/admin/user/enter?id=' . $profile['id'],
'icon' => 'enter',
'div' => 'menu'
];
}
$smarty->assign([
'listing' => $listing
]);
$smarty->display('listing.tpl');
$smarty->footer();