forked from jmlue42/Talishar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BanPlayer.php
34 lines (27 loc) · 1015 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
<?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 != "Launch" && $useruid != "LaustinSpayce" && $useruid != "Star_Seraph" && $useruid != "Tower") {
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);
}
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");