Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("../../classes/user.class.php");
- require_once("../../templates/init.tpl");
- if (!isset($_SESSION['steamid'])){
- exit("null");
- }
- if (!User::IsAdmin($_SESSION['steamid'])){
- exit("null");
- }
- if (isset($_GET['SteamID']) && !empty($_GET['SteamID'])){
- if (!preg_match("/^STEAM_[0-5]:[01]:\d+$/", $_GET['SteamID'])){
- exit("<p class='alert alert-danger'>".getPhrase("GlobalBan.NoMatch")."</p>");
- }
- $stmt = $db->prepare("INSERT INTO `commands` (command, servers) VALUES (:command, :servers)");
- $stmt->bindValue(":server", "[]");
- $command;
- switch ($config['admin_mod']) {
- case "ULX":
- $command = "ulx banid ".$_GET['SteamID']. " 0";
- break;
- case "ServerGuard":
- $command = "sg ban ".$_GET['SteamID']. " 0";
- break;
- default:
- $command = "ulx banid ".$_GET['SteamID']. " 0";
- break;
- }
- $stmt->bindParam(":command", $command);
- if ($stmt->execute()){
- exit("<p class='alert alert-success'>".getPhrase("GlobalBan.Success")."</p>");
- }
- } else {
- exit("<p class='alert alert-danger'>".getPhrase("GlobalBan.NoIDSupplied")."</p>");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement