-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathBanPlayer.php
35 lines (28 loc) · 1005 Bytes
/
BanPlayer.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
<?php
include "./Libraries/HTTPLibraries.php";
include_once './includes/functions.inc.php';
include_once "./includes/dbh.inc.php";
session_start();
if (!isset($_SESSION["useruid"])) {
echo ("Please login to view this page.");
exit;
}
$useruid = $_SESSION["useruid"];
if ($useruid != "OotTheMonk" && $useruid != "love" && $useruid != "ninin" && $useruid != "Brubraz") {
echo ("You must log in to use this page.");
exit;
}
$playerToBan = TryGET("playerToBan", "");
$ipToBan = TryGET("ipToBan", "");
$playerNumberToBan = TryGET("playerNumberToBan", "");
if ($playerToBan != "") {
file_put_contents('./HostFiles/bannedPlayers.txt', $playerToBan . "\r\n", FILE_APPEND | LOCK_EX);
BanPlayer($playerToBan);
}
if ($ipToBan != "") {
$gameName = $ipToBan;
include './MenuFiles/ParseGamefile.php';
$ipToBan = ($playerNumberToBan == "1" ? $hostIP : $joinerIP);
file_put_contents('./HostFiles/bannedIPs.txt', $ipToBan . "\r\n", FILE_APPEND | LOCK_EX);
}
header("Location: ./zzModPage.php");