-
Notifications
You must be signed in to change notification settings - Fork 4
/
unban.php
87 lines (86 loc) · 2.15 KB
/
unban.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
<?php
require 'memory.php';
require 'header.inc';
check_auth($_SERVER['PHP_SELF']); // checks for required access
if (!$GET_action && !$POST_action) {
EchoHead(80);
echo "
<tr class=mytitle>
<td>Unban Players/Accounts</td>
</tr>
<tr class=myheader>
<td>
Unban a player! Enter the character name, and you can ban the account that it came from, or just ban the account.
</td>
</tr>
<tr class=myheader>
<td>
There will be a confirmation screen if you make a mistake.
</td>
</tr>
<tr class=mycell>
<td>
<form action=\"unban.php\" method=\"GET\">
Character Name: <input type=\"text\" class=\"myctl\" name=\"character_name\">\n
<input type=\"submit\" class=\"myctl\" name=\"action\" value=\"Unban Character\"><br>\n
Account Name: <input type=\"text\" class=\"myctl\" name=\"account_name\">\n
<input type=\"submit\" class=\"myctl\" name=\"action\" value=\"Unban Account\"><br>\n
</form>
</td>
</tr>
</table>
";
EchoHead(50);
echo "
<tr class=mytitle>
<td>Ban List</td>
</tr>
";
$query = SHOW_BAN_LIST;
$result = execute_query($query, "unban.php");
if ($result->RowCount() == 0) {
echo "
<tr class=mycell>
<td>There are no banned accounts!</td>
</tr>
";
}
else {
while ($line = $result->FetchRow()) {
echo "
<tr class=mycell>
<td>{$line[0]}</td>
</tr>
";
}
}
echo "
</table>
";
}
elseif ($POST_action == "Unban This Account!") {
$ban_id = UserID_To_AccountID($POST_account_name);
$reason = $POST_reason;
$query = sprintf(UNBAN_ACCOUNT, $ban_id);
$result = execute_query($query, "unban.php");
add_admin_entry('Unbanned ' . $POST_account_name, $reason);
add_unban_entry($POST_account_name, $reason);
redir("index.php", $POST_account_name . " Unbanned!");
}
else {
if ($GET_action == "Unban Character") {
if ($GET_character_name != "") {
$unban_account = account_of_character($GET_character_name);
}
}
elseif ($GET_action == "Unban Account") {
if ($GET_account_name != "") {
$unban_account = $GET_account_name;
}
}
if ($unban_account != "") {
display_unban($unban_account);
}
}
require 'footer.inc';
?>