-
Notifications
You must be signed in to change notification settings - Fork 29
/
ipcheck.php
103 lines (95 loc) · 5.47 KB
/
ipcheck.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?
/*
// +--------------------------------------------------------------------------+
// | 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_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
stdhead("Ïîâòîðÿþùèåñÿ IP ïîëüçîâàòåëåé");
begin_frame("Ïîâòîðÿþùèåñÿ IP ïîëüçîâàòåëåé:", true);
begin_table();
if (get_user_class() >= UC_MODERATOR)
{
$res = sql_query("SELECT count(*) AS dupl, ip FROM users WHERE enabled = 'yes' AND ip <> '' AND ip <> '127.0.0.0' GROUP BY ip ORDER BY dupl DESC, ip") or sqlerr(__FILE__, __LINE__);
print("<tr align=center><td class=colhead width=90>Ïîëüçîâàòåëü</td>
<td class=colhead width=70>Email</td>
<td class=colhead width=70>Ðåãèñòðàöèÿ</td>
<td class=colhead width=75>Ïîñë. Àêòèâíîñòü</td>
<td class=colhead width=70>Ñêà÷àë</td>
<td class=colhead width=70>Ðàçäàë</td>
<td class=colhead width=45>Ðåéòèíã</td>
<td class=colhead width=125>IP</td>
<td class=colhead width=40>Ïèð</td></tr>\n");
$uc = 0;
while($ras = mysql_fetch_assoc($res)) {
if ($ras["dupl"] <= 1)
break;
if ($ip <> $ras['ip']) {
$ros = sql_query("SELECT id, username, class, email, added, last_access, downloaded, uploaded, ip, warned, donor, enabled, (SELECT COUNT(*) FROM peers WHERE peers.ip = users.ip AND users.id = peers.userid) AS peer_count FROM users WHERE ip='".$ras['ip']."' ORDER BY id") or sqlerr(__FILE__, __LINE__);
$num2 = mysql_num_rows($ros);
if ($num2 > 1) {
$uc++;
while($arr = mysql_fetch_assoc($ros)) {
if ($arr['added'] == '0000-00-00 00:00:00')
$arr['added'] = '-';
if ($arr['last_access'] == '0000-00-00 00:00:00')
$arr['last_access'] = '-';
if($arr["downloaded"] != 0)
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
else
$ratio="---";
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
$uploaded = mksize($arr["uploaded"]);
$downloaded = mksize($arr["downloaded"]);
$added = substr($arr['added'], 0, 10);
$last_access = substr($arr['last_access'], 0, 10);
if ($uc%2 == 0)
$utc = "";
else
$utc = " bgcolor=\"ECE9D8\"";
/*$peer_res = sql_query("SELECT count(*) FROM peers WHERE ip = " . sqlesc($ras['ip']) . " AND userid = " . $arr['id']);
$peer_row = mysql_fetch_row($peer_res);*/
print("<tr$utc><td align=left><b><a href='userdetails.php?id=" . $arr['id'] . "'>" . get_user_class_color($arr['class'], $arr['username'])."</b></a>" . get_user_icons($arr) . "</td>
<td align=center>$arr[email]</td>
<td align=center>$added</td>
<td align=center>$last_access</td>
<td align=center>$downloaded</td>
<td align=center>$uploaded</td>
<td align=center>$ratio</td>
<td align=center><span style=\"font-weight: bold;\">$arr[ip]</span></td>\n<td align=center>" .
($arr['peer_count'] > 0 ? "<span style=\"color: red; font-weight: bold;\">Äà</span>" : "<span style=\"color: green; font-weight: bold;\">Íåò</span>") . "</td></tr>\n");
$ip = $arr["ip"];
}
}
}
}
} else {
print("<br /><table width=60% border=1 cellspacing=0 cellpadding=9><tr><td align=center>");
print("<h2>Èçâèíèòå, òîëüêî äëÿ àäìèíèñòðàöèè</h2></table></td></tr>");
}
end_frame();
end_table();
stdfoot();
?>