Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.22 KB | None | 0 0
  1. <?php
  2. class Website extends VoteAppModel
  3. {
  4.     // Valid if user has voted
  5.     public function valid($user, $ip, $website)
  6.     {
  7.         // Data
  8.         $website['data'] = json_decode($website['data'], true);
  9.         // Check
  10.         switch ($website['type']) {
  11.             case 'RPG-PARADIZE':
  12.                 // TODO: Check OUT
  13.                 break;
  14.             case 'SRV-MC-ORG':
  15.                 // Check with API
  16.                 $result = @file_get_contents("http://www.serveurs-minecraft.org/api/is_valid_vote.php?id={$website['data']['server_id']}&ip=$ip&duration=3");
  17.                 if ($result === false || intval($result) > 0)
  18.                     return true;
  19.                 break;
  20.             case 'SRVMC-ORG':
  21.                 // Check with API
  22.                 $result = @file_get_contents("https://www.serveursminecraft.org/sm_api/peutVoter.php?id={$website['data']['server_id']}&ip=$ip");
  23.                 if ($result === false || $result != "true")
  24.                     return true;
  25.                 break;
  26.             case 'SRV-MC-COM':
  27.                 // Check with API
  28.                 $result = @file_get_contents("https://serveurs-minecraft.com/api.php?Classement={$website['data']['server_id']}&ip=$ip");
  29.                 if ($result === false)
  30.                     return true;
  31.                 $result = @json_decode($result, true);
  32.                 if ($result === false)
  33.                     return true;
  34.                 if (time() - strtotime($result['lastVote']['date']) < (3 * 60 * 60)) // 3 minutes between vote and check
  35.                     return true;
  36.                 break;
  37.             case 'SRV-MINECRAFT-FR':
  38.                 // Check with API
  39.                 $result = @file_get_contents("https://serveur-minecraft.fr/api-{$website['data']['server_id']}_$ip.json");
  40.                 if ($result && ($result = json_decode($result, true))) {
  41.                     if ($result["status"] == "Success")
  42.                         return true;
  43.                 }
  44.                 break;
  45.             case 'TOPG-ORG':
  46.                 // Check with API
  47.                 $result = @file_get_contents("http://topg.org/check_ip.php?siteid={$website['data']['server_id']}&userip=$ip");
  48.                 if ($result === false || $result == "1")
  49.                     return true;
  50.                 break;
  51.             case 'TOP-SERVEUR-NET':
  52.                 // Check with API
  53.                 $result = @file_get_contents("https://api.top-serveurs.net/v1/votes/check-ip?server_token={$website['data']['server_token']}&ip=$ip");
  54.                 if ($result && ($result = json_decode($result, true)))
  55.                     return true;
  56.                 break;
  57.             case 'LISTE-SRV-MC-FR':
  58.                 // Check with API
  59.                 $result = @file_get_contents("https://liste-serv-minecraft.fr/api/check?server={$website['data']['server_id']}&ip=$ip");
  60.                 if ($result === false || ($result = json_decode($result, true)) === false || $result['id_vote'])
  61.                     return true;
  62.                 break;
  63.             case 'SRV-PRIV':
  64.                 // Check with API
  65.                 $result = @file_get_contents("https://serveur-prive.net/api/vote/json/{$website['data']['server_id']}/$ip");
  66.                 if ($result && ($result = json_decode($result, true))) {
  67.                     if ($result === false || intval($result['status']) == 1)
  68.                         return true;
  69.                 }
  70.                 break;
  71.             case 'KIOSQUE-SRV':
  72.                 // Check with API
  73.                 $result = @file_get_contents("https://api.kiosque-serveur.net/v1/vote/$ip/{$website['data']['server_id']}");
  74.                 if ($result && ($result = json_decode($result, true))) {
  75.                     if ($result === false || intval($result['vote']) == 1)
  76.                         return true;
  77.                 }
  78.                 break;
  79.             case 'LIST-SRV-MC-ORG':
  80.                 // Check with API
  81.                 $result = @file_get_contents("https://api.liste-serveurs-minecraft.org/vote/vote_verification.php?server_id={$website['data']['server_id']}&ip=$ip&duration=180");
  82.                 if ($result === false || intval($result) == 1)
  83.                     return true;
  84.                 break;
  85.             case 'SRV-MULTIGAMES':
  86.                 // Check with API
  87.                 $result = @file_get_contents("https://serveur-multigames.net/api/{$website['data']['server_id']}/?ip=$ip");
  88.                 if ($result || intval($result) > 0)
  89.                     return true;
  90.                 break;
  91.             case 'MGS':
  92.                 // Check with API
  93.                 $result = json_decode(@file_get_contents("https://mygreatserver.fr/api/checkvote/{$website['data']['server_id']}/$ip"));
  94.                 if ($result->success && $result->data->vote)
  95.                     return true;
  96.                 break;
  97.             case 'LISTE-SERVEUR-FR':
  98.                 // Check with API
  99.                 $result = json_decode(@file_get_contents("https://www.liste-serveur.fr/api/hasVoted/{$website['data']['server_token']}/$ip"));
  100.                 if (isset($result->hasVoted) && $result->hasVoted === true)
  101.                     return true;
  102.                 break;
  103.             default:
  104.                 return true;
  105.         }
  106.         return false;
  107.     }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement