Advertisement
DanielYTK

Untitled

Nov 15th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <?php
  2. if(!isset($_POST["id"])){
  3. return;
  4. }
  5.  
  6.  
  7. require_once("Rcon.php");
  8.  
  9. class generateKey{
  10.  
  11. private $tamanho;
  12.  
  13. public function __construct($tamanho = 15){
  14. $this->tamanho = $tamanho;
  15. }
  16.  
  17. public function gerar(){
  18. $key = "";
  19. $all = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
  20. for($i=0 ; $i < $this->tamanho; $i++){
  21. $key .= $all[mt_rand(0, 61)];
  22. }
  23. return $key;
  24. }
  25. }
  26.  
  27. $html = false;
  28.  
  29.  
  30. $keyfix = "";
  31. $decoded = json_decode(file_get_contents("ids.json"), true);
  32.  
  33. if(isset($decoded[$_POST["id"]])){
  34.  
  35. $key = new generateKey(20);
  36. $keyfix = $key->gerar();
  37.  
  38. $class = new Rcon("fulledits.auroramystic.com", 18002, "54UEUGf4HI", 30);
  39. $class->connect();
  40.  
  41.  
  42.  
  43. if($decoded[$_POST["id"]]["Produto"] == "cash"){
  44. $class->sendCommand("chave criar ".$keyfix);
  45. $class->sendCommand("chave editar ".$keyfix." addcash {PLAYER} ".$decoded["Quantidade"]);
  46. }
  47.  
  48. unset($decoded[$_POST["id"]]);
  49. file_put_contents("ids.json", json_encode($decoded));
  50. $html = true;
  51.  
  52. }
  53.  
  54. if(!$html){
  55. return;
  56. }else{
  57. echo "O id não existe fih";
  58. }
  59.  
  60. ?>
  61.  
  62. <!DOCTYPE html>
  63. <html>
  64.  
  65. <head>
  66.  
  67. <title>KEY</title>
  68.  
  69. </head>
  70.  
  71. <body>
  72.  
  73. <center><h1>SUA KEY</h1></center>
  74. <center><h1><?php echo "<font color=\"purple\">".$keyfix?></h1><center>
  75.  
  76. </body>
  77.  
  78.  
  79.  
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement