-
Notifications
You must be signed in to change notification settings - Fork 29
/
delacctadmin.php
78 lines (69 loc) · 4.07 KB
/
delacctadmin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?
/*
// +--------------------------------------------------------------------------+
// | Project: TBDevYSE - TBDev Yuna Scatari Edition |
// +--------------------------------------------------------------------------+
// | This file is part of TBDevYSE. TBDevYSE is based on TBDev, |
// | originally by RedBeard of TorrentBits, extensively modified by |
// | Gartenzwerg. |
// | |
// | TBDevYSE is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | TBDevYSE is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with TBDevYSE; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
require "include/bittorrent.php";
dbconn();
if (get_user_class() < UC_ADMINISTRATOR)
stderr($tracker_lang['error'], "Íåò äîñòóïà.");
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
$username = trim((string)$_POST["username"]);
if (!$username)
stderr($tracker_lang['error'], "Ïîæàëóñòà çàïîëíÿéòå ôîðìó êîððåêòíî.");
$res = sql_query("SELECT * FROM users WHERE username=" . sqlesc($username)) or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) != 1)
stderr($tracker_lang['error'], "Íåâåðíîå èìÿ ïîëüçîâàòåëÿ. Ïðîâåðüòå ââåäåíûå äàííûå.");
$arr = mysql_fetch_assoc($res);
$id = $arr['id'];
$res = sql_query("DELETE FROM users WHERE id = $id") or sqlerr(__FILE__, __LINE__);
if (mysql_affected_rows() != 1)
stderr($tracker_lang['error'], "Íåâîçìîæíî óäàëèòü àêêàóíò.");
sql_query("DELETE FROM messages WHERE receiver = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM friends WHERE userid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM friends WHERE friendid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM blocks WHERE userid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM blocks WHERE blockid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM bookmarks WHERE userid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM invites WHERE inviter = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM peers WHERE userid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM readtorrents WHERE userid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM simpaty WHERE fromuserid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM checkcomm WHERE userid = $id") or sqlerr(__FILE__,__LINE__);
sql_query("DELETE FROM sessions WHERE uid = $id") or sqlerr(__FILE__,__LINE__);
stderr($tracker_lang['success'], "Àêêàóíò <b>$username</b> óäàëåí.");
}
stdhead("Óäàëèòü àêêàóíò");
?>
<h1>Óäàëèòü àêêàóíò</h1>
<table border=1 cellspacing=0 cellpadding=5>
<form method=post action=delacctadmin.php>
<tr><td class=rowhead>Ïîëüçîâàòåëü</td><td><input size=40 name=username></td></tr>
<tr><td colspan=2><input type=submit class=btn value='Óäàëèòü'></td></tr>
</form>
</table>
<?
stdfoot();
?>