if (!empty($_GET['ba'])) { $bansAdmin = $_GET['ba']; } else { $bansAdmin = ""; } $lan_file = ROOTDIR . '/languages/' . $LANGUAGE . '/lan_banlist.php'; include file_exists($lan_file) ? $lan_file : ROOTDIR . "/languages/English/lan_banlist.php"; $banQueries = new BanQueries(); // Ban delete process if ($fullPower) { // A full power admin executed a ban delete if (!empty($_GET['process']) && !empty($_GET['BanId'])) { if ($_GET['process'] == "delete") { if ($_GET['BanId'] != null || $_GET['BanId'] != "") { $deleteBannedUser = $banQueries->getBannedUser($_GET['BanId']); unBanUser($deleteBannedUser->getSteamId(), $deleteBannedUser->getIp()); $banQueries->deleteBan($deleteBannedUser->getSteamId()); } } } } function unBanUser($steamId, $bannedIP) { // This will send an RCON command to the server $serverQueries = new ServerQueries(); // Get the list of servers $servers = $serverQueries->getServers(); // Cycle through each server foreach ($servers as $server) { $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); if ($r->isValid()) {
$active = $_POST['active']; // Switch the current active state to the other state // off becomes on, and on becomes off if ($active == 0) { $active = 1; } else { $active = 0; } $banQueries = new BanQueries(); // Must be logged in to change the status if ($member || $admin || $banManager || $fullPower) { $banQueries->updateBanActiveStatus($active, $id); if ($active == 0) { //$bannedUser = new BannedUser(); $bannedUser = $banQueries->getBannedUser($id); unBanUser($bannedUser->getSteamId(), $bannedUser->getIp()); } } function unBanUser($steamId, $bannedIP) { // This will send an RCON command to the server $serverQueries = new ServerQueries(); // Get the list of servers $servers = $serverQueries->getServers(); // Cycle through each server foreach ($servers as $server) { $r = new rcon($server->getIp(), $server->getPort(), $server->getRcon()); if ($r->isValid()) { $r->Auth(); $r->sendRconCommand("removeid " . $steamId); $r->sendRconCommand("removeip " . $bannedIP);