2013-05-28 08:01:02 +00:00
|
|
|
<?php
|
2013-05-02 08:00:23 +00:00
|
|
|
if (!check_perms('users_view_ips')) {
|
|
|
|
error(403);
|
|
|
|
}
|
2012-10-11 08:00:15 +00:00
|
|
|
View::show_header('Dupe IPs');
|
2011-03-28 14:21:28 +00:00
|
|
|
define('USERS_PER_PAGE', 50);
|
|
|
|
define('IP_OVERLAPS', 5);
|
2013-05-28 08:01:02 +00:00
|
|
|
list($Page, $Limit) = Format::page_limit(USERS_PER_PAGE);
|
2011-03-28 14:21:28 +00:00
|
|
|
|
|
|
|
|
2013-05-02 08:00:23 +00:00
|
|
|
$RS = $DB->query("
|
|
|
|
SELECT
|
|
|
|
SQL_CALC_FOUND_ROWS
|
|
|
|
m.ID,
|
|
|
|
m.IP,
|
|
|
|
m.Username,
|
|
|
|
m.PermissionID,
|
|
|
|
m.Enabled,
|
|
|
|
i.Donor,
|
|
|
|
i.Warned,
|
|
|
|
i.JoinDate,
|
2013-10-25 08:00:59 +00:00
|
|
|
(
|
|
|
|
SELECT COUNT(DISTINCT h.UserID)
|
2013-05-02 08:00:23 +00:00
|
|
|
FROM users_history_ips AS h
|
2013-07-10 00:08:53 +00:00
|
|
|
WHERE h.IP = m.IP
|
2013-05-02 08:00:23 +00:00
|
|
|
) AS Uses
|
|
|
|
FROM users_main AS m
|
2013-07-10 00:08:53 +00:00
|
|
|
LEFT JOIN users_info AS i ON i.UserID = m.ID
|
2013-05-02 08:00:23 +00:00
|
|
|
WHERE
|
2013-10-25 08:00:59 +00:00
|
|
|
(
|
|
|
|
SELECT COUNT(DISTINCT h.UserID)
|
2013-05-02 08:00:23 +00:00
|
|
|
FROM users_history_ips AS h
|
2013-07-10 00:08:53 +00:00
|
|
|
WHERE h.IP = m.IP
|
2013-05-02 08:00:23 +00:00
|
|
|
) >= ".IP_OVERLAPS."
|
|
|
|
AND m.Enabled = '1'
|
|
|
|
AND m.IP != '127.0.0.1'
|
|
|
|
ORDER BY Uses DESC
|
|
|
|
LIMIT $Limit");
|
2013-07-10 00:08:53 +00:00
|
|
|
$DB->query('SELECT FOUND_ROWS()');
|
2011-03-28 14:21:28 +00:00
|
|
|
list($Results) = $DB->next_record();
|
|
|
|
$DB->set_query_id($RS);
|
|
|
|
|
2013-07-10 00:08:53 +00:00
|
|
|
if ($DB->has_results()) {
|
2011-03-28 14:21:28 +00:00
|
|
|
?>
|
|
|
|
<div class="linkbox">
|
|
|
|
<?
|
2013-05-15 08:00:54 +00:00
|
|
|
$Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 11);
|
2011-03-28 14:21:28 +00:00
|
|
|
echo $Pages;
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<table width="100%">
|
|
|
|
<tr class="colhead">
|
|
|
|
<td>User</td>
|
2013-02-09 08:01:01 +00:00
|
|
|
<td>IP address</td>
|
2011-03-28 14:21:28 +00:00
|
|
|
<td>Dupes</td>
|
|
|
|
<td>Registered</td>
|
|
|
|
</tr>
|
|
|
|
<?
|
2013-10-25 08:00:59 +00:00
|
|
|
$Row = 'b';
|
2013-05-02 08:00:23 +00:00
|
|
|
while (list($UserID, $IP, $Username, $PermissionID, $Enabled, $Donor, $Warned, $Joined, $Uses) = $DB->next_record()) {
|
2013-10-25 08:00:59 +00:00
|
|
|
$Row = $Row === 'b' ? 'a' : 'b';
|
2011-03-28 14:21:28 +00:00
|
|
|
?>
|
|
|
|
<tr class="row<?=$Row?>">
|
2012-10-11 08:00:15 +00:00
|
|
|
<td><?=Users::format_username($UserID, true, true, true, true)?></td>
|
2013-05-02 08:00:23 +00:00
|
|
|
<td>
|
2013-11-05 08:01:12 +00:00
|
|
|
<span style="float: left;"><?=Tools::get_host_by_ajax($IP)." ($IP)"?></span><span style="float: right;"><a href="userhistory.php?action=ips&userid=<?=$UserID?>" title="History" class="brackets tooltip">H</a> <a href="user.php?action=search&ip_history=on&ip=<?=display_str($IP)?>" title="Search" class="brackets tooltip">S</a></span>
|
2013-05-02 08:00:23 +00:00
|
|
|
</td>
|
2011-03-28 14:21:28 +00:00
|
|
|
<td><?=display_str($Uses)?></td>
|
|
|
|
<td><?=time_diff($Joined)?></td>
|
|
|
|
</tr>
|
|
|
|
<? } ?>
|
|
|
|
</table>
|
|
|
|
<div class="linkbox">
|
2014-03-23 08:00:50 +00:00
|
|
|
<? echo $Pages; ?>
|
2011-03-28 14:21:28 +00:00
|
|
|
</div>
|
2014-03-23 08:00:50 +00:00
|
|
|
<? } else { ?>
|
2011-03-28 14:21:28 +00:00
|
|
|
<h2 align="center">There are currently no users with more than <?=IP_OVERLAPS?> IP overlaps.</h2>
|
2014-03-23 08:00:50 +00:00
|
|
|
<?
|
|
|
|
}
|
2012-10-11 08:00:15 +00:00
|
|
|
View::show_footer();
|
2011-03-28 14:21:28 +00:00
|
|
|
?>
|