", "<", "&", "%", "|", "^", "~", "(", ")"); $sanitized = str_replace($replacements, "", $input); return htmlspecialchars($sanitized, ENT_QUOTES, 'UTF-8'); // Escape HTML entities } if (isset($_GET['id']) && !isset($_GET['reban']) && !isset($_GET['edit'])) { $id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); showEbanInfo($id); } if (isset($_GET['oldid']) && !isset($_GET['reban']) && !isset($_GET['edit'])) { $icon = " "; if (!isset($_COOKIE['steamID'])) { echo "
$icon You are not logged in. Please log in again.
"; die(); } $admin = new Admin(); $admin->UpdateAdminInfo($_COOKIE['steamID']); $id = filter_input(INPUT_GET, 'oldid', FILTER_SANITIZE_NUMBER_INT); $Eban = new Eban(); $info = $Eban->getEbanInfoFromID($id); if ($info === null) { echo "$icon Eban not found.
"; die(); } if (!IsAdminLoggedIn()) { echo "$icon You are not logged in.
"; die(); } if (!$admin->DoesHaveFullAccess() && $info['admin_steamid'] != $admin->adminSteamID) { echo "$icon You do not have permission to unban an eban issued by another admin.
"; die(); } $reason = sanitizeString($reason); $Eban = new Eban(); if (!$Eban->UnbanByID($id, $reason)) { echo "$icon Failed to unban.
"; die(); } die(); } function showEbanInfo(int $id) { GetRowInfo($id); } if (isset($_GET['add']) && isset($_GET['playerName'])) { if (!IsAdminLoggedIn()) { echo "  You are not logged in.
"; die(); } // Sanitize input $playerName = sanitizeString(filter_input(INPUT_GET, 'playerName', FILTER_SANITIZE_STRING)); $playerSteamID = filter_input(INPUT_GET, 'playerSteamID', FILTER_SANITIZE_STRING); $length = filter_input(INPUT_GET, 'length', FILTER_SANITIZE_NUMBER_INT); $reason = sanitizeString(filter_input(INPUT_GET, 'reason', FILTER_SANITIZE_STRING)); $icon = " "; if (empty($playerSteamID)) { echo "$icon Player SteamID cannot be empty!
"; die(); } if (!preg_match("/^STEAM_[0-5]:[01]:\d+$/", $playerSteamID)) { echo "$icon Invalid SteamID Format
"; die(); } if (empty($reason)) { echo "$icon Reason cannot be empty!
"; die(); } $Eban = new Eban(); if ($Eban->IsSteamIDAlreadyBanned($playerSteamID)) { echo "$icon $playerSteamID is already Ebanned!
"; die(); } $Eban->addNewEban($playerName, $playerSteamID, $length, $reason); } if (isset($_GET['edit']) && isset($_GET['playerName'])) { if (!isset($_COOKIE['steamID'])) { echo "  You are not logged in.
"; die(); } $id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT); $playerName = sanitizeString(filter_input(INPUT_GET, 'playerName', FILTER_SANITIZE_STRING)); $playerSteamID = filter_input(INPUT_GET, 'playerSteamID', FILTER_SANITIZE_STRING); $length = filter_input(INPUT_GET, 'length', FILTER_SANITIZE_NUMBER_INT); $reason = sanitizeString(filter_input(INPUT_GET, 'reason', FILTER_SANITIZE_STRING)); $icon = " "; if (empty($playerName)) { echo "$icon Player name cannot be empty!
"; die(); } if (empty($playerSteamID)) { echo "$icon Player SteamID cannot be empty!
"; die(); } if (!preg_match("/^STEAM_[0-5]:[01]:\d+$/", $playerSteamID)) { echo "$icon Invalid SteamID Format
"; die(); } if (empty($reason)) { echo "$icon Reason cannot be empty!
"; die(); } $admin = new Admin(); $admin->UpdateAdminInfo($_COOKIE['steamID']); if ($length === null && !$admin->DoesHaveFullAccess()) { echo "$icon You do not have permission for Permanent bans!
"; die(); } if (empty($reason)) { $reason = "NO REASON"; } if ($length === null) { $length = 0; } if ($length < 0) { $length = 60; } $Eban = new Eban(); $info = $Eban->getEbanInfoFromID($id); if ($info === null) { echo "$icon Eban not found.
"; die(); } if (!IsAdminLoggedIn()) { echo "$icon You are not logged in.
"; die(); } if (!$admin->DoesHaveFullAccess() && $info['admin_steamid'] != $admin->adminSteamID) { echo "$icon You do not have permission to edit an eban issued by another admin.
"; die(); } if ($playerName == $info['client_name'] && $playerSteamID == $info['client_steamid'] && $reason == $info['reason'] && $length == ($info['duration'] * 60)) { echo "$icon Cannot detect any changes to edit!
"; die(); } if (!$Eban->IsSteamIDAlreadyBanned($playerSteamID)) { echo "$icon The edited steamid is already Eunbanned and cannot be edited from here
"; die(); } // Note: there's no longer a way to validate "is this duration already in the // past" here - expiry is playtime-based and only the sourcemod plugin knows a // player's current playtime, so that check has been removed rather than guessed at. $Eban->EditEban($id, $playerName, $playerSteamID, $length, $reason); } if (isset($_GET['delete'])) { $icon = " "; if (!isset($_COOKIE['steamID'])) { echo "$icon You are not logged in.
"; die(); } $admin = new Admin(); $admin->UpdateAdminInfo($_COOKIE['steamID']); if (!IsAdminLoggedIn()) { echo "$icon You are not logged in.
"; die(); } if (!$admin->DoesHaveFullAccess()) { echo "$icon You do not have permission to delete an eban.
"; die(); } $id = filter_input(INPUT_GET, 'deleteid', FILTER_SANITIZE_NUMBER_INT); $Eban = new Eban(); $Eban->RemoveEbanFromDB($id); die(); } ?>