summaryrefslogtreecommitdiff
path: root/html/pages/admin/ipsearch.php
diff options
context:
space:
mode:
authorMatthijs Kuiper <info@matthijskuiper.nl>2017-02-04 16:05:45 +0100
committerMatthijs Kuiper <info@matthijskuiper.nl>2017-02-04 16:05:45 +0100
commit40dfa7d5c0dc8e4cb2c95e403b6b4b2c4bf70644 (patch)
tree6ac6279ac26749ffe7ca0ae9603fbcae2e757e6e /html/pages/admin/ipsearch.php
Original UTStats beta 4.2.84.2.8
Diffstat (limited to 'html/pages/admin/ipsearch.php')
-rwxr-xr-xhtml/pages/admin/ipsearch.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/html/pages/admin/ipsearch.php b/html/pages/admin/ipsearch.php
new file mode 100755
index 0000000..4ac9731
--- /dev/null
+++ b/html/pages/admin/ipsearch.php
@@ -0,0 +1,58 @@
+<?php
+if (empty($import_adminkey) or isset($_REQUEST['import_adminkey']) or $import_adminkey != $adminkey) die('bla');
+
+$options['requireconfirmation'] = false;
+$options['title'] = 'IP Search';
+$i = 0;
+$options['vars'][$i]['name'] = 'ip_from';
+$options['vars'][$i]['type'] = 'text';
+$options['vars'][$i]['prompt'] = 'Enter the IP you want to search from:';
+$options['vars'][$i]['caption'] = 'IP from:';
+$i++;
+$options['vars'][$i]['name'] = 'ip_to';
+$options['vars'][$i]['type'] = 'text';
+$options['vars'][$i]['initialvalue'] = 'ip_from';
+$options['vars'][$i]['prompt'] = 'Enter the IP you want to search to:';
+$options['vars'][$i]['caption'] = 'IP to:';
+$i++;
+
+$results = adminselect($options);
+
+
+$ip_from = $results['ip_from'];
+$ip_to = $results['ip_to'];
+
+echo'<br><table border="0" cellpadding="1" cellspacing="2" width="600">
+<tr>
+ <td class="smheading" align="center" colspan="2">Players using IPs '.$ip_from.' - '.$ip_to.' and their last 5 matches using these IPs</td>
+</tr>';
+
+
+$sql_players = "SELECT pi.name, pi.id AS pid FROM uts_player p, uts_pinfo pi WHERE p.pid = pi.id AND p.ip BETWEEN INET_ATON('$ip_from') AND INET_ATON('$ip_to') GROUP BY pid";
+$q_players = mysql_query($sql_players) or die(mysql_error());
+$j = 0;
+while ($r_players = mysql_fetch_array($q_players)) {
+ echo '<tr>';
+ echo '<td class="dark" align="center" valign="top" width="150">';
+ echo '<a class="darkhuman" href="admin.php?action=pinfo&amp;pid='.$r_players['pid'].'">'.$r_players['name'].'</a></td>';
+ $sql_recent = "SELECT m.time AS time, m.id AS mid, INET_NTOA(p.ip) AS ip FROM uts_player p, uts_match m WHERE m.id = p.matchid AND p.pid = '${r_players['pid']}' AND p.ip BETWEEN INET_ATON('$ip_from') AND INET_ATON('$ip_to') ORDER BY m.time DESC LIMIT 0,5";
+ echo '<td class="grey">';
+ echo '<table width="100%" border="0" cellspacing="0" cellpadding="2">';
+ $q_recent= mysql_query($sql_recent) or die(mysql_error());
+ while ($r_recent = mysql_fetch_array($q_recent)) {
+ $j++;
+ $class = ($j%2) ? 'grey' : 'grey2';
+ echo '<tr><td class="'.$class.'" align="center" width="60%">';
+ echo '<a class="'.$class.'" href="./?p=match&amp;mid='.$r_recent['mid'].'">'.mdate($r_recent['time']).'</a>';
+ echo '</td><td class="'.$class.'" align="center">';
+ echo $r_recent['ip'];
+ echo '</td></tr>';
+ }
+ echo '</table></td></tr>';
+}
+
+
+echo'<tr>
+ <td class="smheading" align="center" colspan="2"><a class="grey" href="./admin.php?key='.$_REQUEST[key].'">Go Back To Admin Page</a></td>
+</tr></table>';
+?>