Файл: Dvig/dell.php
Строк: 67
<?php
####################
## Автор - USER-X ##
## Copyright 2013 ##
## xcms.mcdir.ru ##
####################
define('xcms_pro', 1);
$path = '';
$title='Удаляем';
include_once ($path . 'core/core.php');
#########
if($users['level'] == '5') {
switch ($act) {
case 'user':
mysql_query("DELETE FROM `users` WHERE `id` = '" . $id . "' LIMIT 1");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил юзера',
`user_ip` = ' $ipuser',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Пользователь удален<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'news':
mysql_query("DELETE FROM `news` WHERE `id` = '$id' LIMIT 1");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил новость',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Новость удалена<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'chat_room':
mysql_query("DELETE FROM `chat_room` WHERE `id` = '$id' LIMIT 1");
mysql_query("DELETE FROM `chat_posts` WHERE `room` = '$id' LIMIT 1");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил комнату в чате',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'chat_post':
mysql_query("DELETE FROM `chat_posts` WHERE `id` = '" . $id . "' LIMIT 1");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил пост в чате',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
$per = mysql_fetch_array(mysql_query("SELECT * FROM `chat_posts` WHERE `id`='$id'"));
$qot= mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$per[author]'"));
mysql_query("UPDATE `users` SET `balans`=balans-1 WHERE `id`='$qot[id]'");
$_SESSION['ok'] = 'Сообщение удалено<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'close_theme':
mysql_query("UPDATE `forum_themes` SET `status`='0' WHERE `id`='$id'");
$_SESSION['ok'] = 'Тема закрыта<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
$time = time();
$theme = mysql_fetch_array(mysql_query('SELECT * FROM `forum_themes` WHERE `id`='.$id.''));
$komu = $theme['author_id'];
$ktoo = $users['id'];
$deistvie = 'Закрыл вашу тему [url=http://forum/theme.php?id='.$theme['id'].']'.$theme['name'].'[/url]';
mysql_query("INSERT INTO `core_deistvie` SET
`komu` = '$komu',
`ktoo` = '$ktoo',
`deistvie` = '$deistvie',
`time` = '$time',
`status`='1'");
exit;
break;
case 'opens_theme':
mysql_query("UPDATE `forum_themes` SET `status`='1' WHERE `id`='$id'");
$_SESSION['ok'] = 'Тема открыта<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
$time = time();
$theme = mysql_fetch_array(mysql_query('SELECT * FROM `forum_themes` WHERE `id`='.$id.''));
$komu = $theme['author_id'];
$ktoo = $users['id'];
$deistvie = 'Открыл вашу тему [url=http://forum/theme.php?id='.$theme['id'].']'.$theme['name'].'[/url]';
mysql_query("INSERT INTO `core_deistvie` SET
`komu` = '$komu',
`ktoo` = '$ktoo',
`deistvie` = '$deistvie',
`time` = '$time',
`status`='1'");
exit;
break;
case 'vip_theme':
mysql_query("UPDATE `forum_themes` SET `vip`='1' WHERE `id`='$id'");
$_SESSION['ok'] = 'Тема вип<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'nevip_theme':
mysql_query("UPDATE `forum_themes` SET `vip`='0' WHERE `id`='$id'");
$_SESSION['ok'] = 'Тема теперь не вип<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'news_comm':
mysql_query("DELETE FROM `news_comm` WHERE `id` = '" . $id . "' LIMIT 1");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил коммент к новости',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Комментарий удалено<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'forum_post':
$temps = mysql_fetch_array(mysql_query('SELECT * FROM `forum_posts` WHERE `id`='.$id.''));
$temp = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id`='.$temps['author'].''));
mysql_query("UPDATE `users` SET `posts` = posts-1 WHERE `id` = '".$temp['id']."'");
$time = time();
$theme = mysql_fetch_array(mysql_query('SELECT * FROM `forum_themes` WHERE `id`='.$temps['theme'].''));
$komu = $temps['author'];
$ktoo = $users['id'];
$deistvie = 'Удалил ваш пост в теме [url=http://forum/theme.php?id='.$theme['id'].']'.$theme['name'].'[/url]';
mysql_query("INSERT INTO `core_deistvie` SET
`komu` = '$komu',
`ktoo` = '$ktoo',
`deistvie` = '$deistvie',
`time` = '$time',
`status`='1'");
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил пост на форуме',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Сообщение удалено<br/>';
mysql_query("DELETE FROM `forum_posts` WHERE `id` = '" . $id . "' LIMIT 1");
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'forum_theme':
$temps = mysql_fetch_array(mysql_query('SELECT * FROM `forum_themes` WHERE `id`='.$id.''));
$komu = $temps['author_id'];
$ktoo = $users['id'];
$deistvie = 'Удалил вашу тему '.$temps['name'].'';
$time = time();
mysql_query("INSERT INTO `core_deistvie` SET
`komu` = '$komu',
`ktoo` = '$ktoo',
`deistvie` = '$deistvie',
`time` = '$time',
`status`='1'");
mysql_query("DELETE FROM `forum_themes` WHERE `id` = '" . $id . "' LIMIT 1");
mysql_query("DELETE FROM `forum_posts` WHERE `theme` = '$id'");
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил тему на форуме',
`user_ip` = '" . $ipuser . "',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Тема удалена<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'forum_podrazdel':
mysql_query("DELETE FROM `forum_podrazdel` WHERE `id` = '" . $id . "' LIMIT 1");
mysql_query("DELETE FROM `forum_themes` WHERE `podrazdel` = ' $id'");
mysql_query("DELETE FROM `forum_posts` WHERE `podrazdel` = '$id'");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил подраздел форума',
`user_ip` = '" . $ipuser . "',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Подфорум удален<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'forum_razdel':
mysql_query("DELETE FROM `forum_razdel` WHERE `id` = '" . $id . "' LIMIT 1");
mysql_query("DELETE FROM `forum_podrazdel` WHERE `razdel` ='$id'");
mysql_query("DELETE FROM `forum_themes` WHERE `razdel` = '$id'");
mysql_query("DELETE FROM `forum_posts` WHERE `razdel` ='$id'");
$time = time();
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'удалил раздел форума',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
$_SESSION['ok'] = 'Раздел удален<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
case 'logs';
mysql_query("TRUNCATE TABLE `logs`");
mysql_query("OPTIMIZE TABLE `logs`");
header("location: ".$_SERVER["HTTP_REFERER"]);
break;
case 'level':
$levels = (int)protect($_GET['level']);
$usss = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$id'"));
$time = time();
if($levels == '5'){$levels = 'aдмином';}
if($levels == '4'){$levels = 'модером';}
if($levels == '0'){$levels = 'юзером';}
$ipuser = $_SERVER['SERVER_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
mysql_query( "INSERT INTO `logs` SET
`who` = '$users[id]',
`time` = '$time',
`deis` = 'Назначил $usss[login] $levels',
`user_ip` = '$ipuser',
`user_agent` = '$agent'
" ) ;
$ktoo = $users['id'];
$deistvie = 'Вас назначили $levels';
$time = time();
mysql_query("INSERT INTO `core_deistvie` SET
`komu` = '$id',
`ktoo` = '$ktoo',
`deistvie` = '$deistvie',
`time` = '$time',
`status`='1'");
mysql_query("UPDATE `users` SET `level`='$levels' WHERE `id`='$id'");
$_SESSION['ok'] = 'Назначили<br/>';
header("location: ".$_SERVER["HTTP_REFERER"]);
exit;
break;
default:
header("location: index.php");
}
} else {
$_SESSION['ok'] = 'Запрещенно!<br/>';
header("location: index.php");
exit;
}
?>