-
Notifications
You must be signed in to change notification settings - Fork 4
/
ban.php
60 lines (59 loc) · 1.69 KB
/
ban.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
<?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>Ban Players/Accounts</td>
</tr>
<tr class=myheader>
<td>
Ban 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=\"ban.php\" method=\"GET\">
Character Name: <input type=\"text\" class=\"myctl\" name=\"character_name\">\n
<input type=\"submit\" class=\"myctl\" name=\"action\" value=\"Ban Character\"><br>\n
Account Name: <input type=\"text\" class=\"myctl\" name=\"account_name\">\n
<input type=\"submit\" class=\"myctl\" name=\"action\" value=\"Ban Account\"><br>\n
</form>
</td>
</tr>
</table>
";
}
elseif ($POST_action == "Ban This Account!") {
$ban_id = UserID_To_AccountID($POST_account_name);
$reason = $POST_reason;
$query = sprintf(BAN_ACCOUNT, $ban_id);
$result = execute_query($query, "ban.php");
add_admin_entry('Banned ' . $POST_account_name, $reason);
add_ban_entry($POST_account_name, $reason);
redir("index.php", $POST_account_name . " Banned!");
}
else {
if ($GET_action == "Ban Character") {
if ($GET_character_name != "") {
$ban_account = account_of_character($GET_character_name);
}
}
elseif ($GET_action == "Ban Account") {
if ($GET_account_name != "") {
$ban_account = $GET_account_name;
}
}
if ($ban_account != "") {
display_ban($ban_account);
}
}
require 'footer.inc';
?>