-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbanips.php
68 lines (64 loc) · 2.06 KB
/
banips.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
<?php
if ($_SERVER["SCRIPT_NAME"] != "/index.php") {
die();
}
backButton("/");
?>
<a href="index.php?task=botips">
<div class="left_button" id="left_button2">
<img src="images/botips.png" title="Bot IPs">
</div>
</a>
<a href="index.php?task=slow_querys">
<div class="left_button" id="left_button3">
<img src="images/sql.png" title="MySQL slow scripts">
</div>
</a>
<a href="index.php?task=gitstatus">
<div class="left_button" id="left_button4">
<img src="images/git.png" title="Git repositories status">
</div>
</a>
<table class="main_table table-striped" id="users_table">
<col span="5">
<tr class="title">
<td class="uip">IP addr</td>
<td class="comment">Comment</td>
<td class="time">Time</td>
<?php if ($isAdmin) { ?>
<td class="ban">Ban</td>
<?php } ?>
</tr>
<?php
$dbconnection = new mysqli($dbhost, $dbusername, $dbpass, $database) or die("Mysql error.".$dbconnection->connect_errno."\n");
$result = $dbconnection->query("SELECT *
FROM $database.`blacklist`
ORDER BY $database.`blacklist`.`ip`
ASC;") or die($dbconnection->error);
while ($row_ip = $result->fetch_assoc()) {
?>
<tr>
<td class="uip">
<?php echo "<a href='/?task=whois&ip=".trim($row_ip['ip'])."'>".trim($row_ip['ip'])."</a>"; ?>
</td>
<td class="comment">
<?php echo trim($row_ip['comment']); ?>
</td>
<td class="time">
<?php echo trim($row_ip['time']); ?>
</td>
<?php if ($isAdmin) { ?>
<td class="ban">
<input type="button"
class="ban_button"
value="x"
onclick="javascript: unban_ip('<?php echo $row_ip['ip']; ?>');
window.setTimeout(location.reload(), 2000);">
</div>
<td>
<?php } ?>
</tr>
<?php
} ?>
</table>
<div id="status_div" class="status_bar"></div>