Файл: modules/users/delete.php
Строк: 18
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$id = $db->guard($_GET['id']);
$tmp->header('profile');
$p=$db->fass("select * from `users` where `id` = '".$id."' ");
if(!$p){
$tmp->div('block', Language::config('error'));
$tmp->div('menu', '<a href="/">'.Language::config('back').'</a>');
$tmp->footer();
exit();
}
User::panel();
if(!User::aut()){
header('location: /');
}
if(User::aut()){
$del = $db->guard($_GET['delete']);
$c=$db->fass("SELECT * FROM `wall` where `id` ='".$del."'");
if(!$c){
$tmp->div('block', Language::config('error'));
$tmp->div('menu', '<a href="/">'.Language::config('back').'</a>');
$tmp->footer();
exit();
}
if($c['kto'] == User::ID() || User::profile('level') >=2)
$db->query("DELETE FROM `wall` where `id` ='".$del."'");
header('location: /us'.$id);
}
$tmp->footer();
?>