Файл: plugins/admin/user.delete.php
Строк: 18
<?php
core::only('admin', '4');
if (isset($_GET['url']))
$profile = $db->query("SELECT * FROM `users` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1")->fetch_assoc();
if (empty($profile))
core::go("/");
$title = 'Удалить аккаунт';
require (SYS.'head.php');
if (isset($_GET['delete']))
{
$db->query("DELETE FROM `users` WHERE `id` = '".$profile['id']."' LIMIT 1");
unlink(H.'/files/photo/'.$profile['id'].'.png');
core::go('/admin/index.php');
}
$posts[] = [
'image' => user::photo($profile['id']),
'title' => user::login($profile['id']),
'post' => $profile['status'] != NULL ? core::text($profile['status']) : 'Hello, world!',
];
$listing[] = [
'title' => 'Удалить пользователя',
'url' => '/admin/user.delete.php?id='.$profile['id'].'&delete',
'icon' => 'delete',
'div' => 'block'
];
$smarty->assign([
'post' => $posts,
'listing' => $listing
]);
$smarty->display('posts.tpl');
$smarty->display('listing.tpl');
require_once (SYS.'foot.php');