Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <?php
  2. require_once("../../classes/user.class.php");
  3.  
  4. require_once("../../templates/init.tpl");
  5.  
  6. if (!isset($_SESSION['steamid'])){
  7. exit("null");
  8. }
  9.  
  10. if (!User::IsAdmin($_SESSION['steamid'])){
  11. exit("null");
  12. }
  13.  
  14. if (isset($_GET['SteamID']) && !empty($_GET['SteamID'])){
  15. if (!preg_match("/^STEAM_[0-5]:[01]:\d+$/", $_GET['SteamID'])){
  16. exit("<p class='alert alert-danger'>".getPhrase("GlobalBan.NoMatch")."</p>");
  17. }
  18.  
  19. $stmt = $db->prepare("INSERT INTO `commands` (command, servers) VALUES (:command, :servers)");
  20. $stmt->bindValue(":server", "[]");
  21.  
  22. $command;
  23. switch ($config['admin_mod']) {
  24. case "ULX":
  25. $command = "ulx banid ".$_GET['SteamID']. " 0";
  26. break;
  27. case "ServerGuard":
  28. $command = "sg ban ".$_GET['SteamID']. " 0";
  29. break;
  30. default:
  31. $command = "ulx banid ".$_GET['SteamID']. " 0";
  32. break;
  33. }
  34.  
  35. $stmt->bindParam(":command", $command);
  36.  
  37. if ($stmt->execute()){
  38. exit("<p class='alert alert-success'>".getPhrase("GlobalBan.Success")."</p>");
  39. }
  40. } else {
  41. exit("<p class='alert alert-danger'>".getPhrase("GlobalBan.NoIDSupplied")."</p>");
  42. }
  43. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement