Guest User

Untitled

a guest
Aug 13th, 2018
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.77 KB | None | 0 0
  1. <?php
  2.     /*
  3.         CREATE TABLE `paypal_log` (
  4.             `id` INT NOT NULL AUTO_INCREMENT,
  5.             `account` VARCHAR(32) NOT NULL DEFAULT '',
  6.             `amount` INT NOT NULL DEFAULT 0,
  7.             `email` VARCHAR(255) NOT NULL DEFAULT '',
  8.             `date` INT NOT NULL DEFAULT 0,
  9.             `ip` VARCHAR(15) NOT NULL DEFAULT '',
  10.             `name` VARCHAR(255) NOT NULL DEFAULT '',
  11.             `country` VARCHAR(255) NOT NULL DEFAULT '',
  12.             `status` SMALLINT NOT NULL DEFAULT 0,
  13.             PRIMARY KEY (`id`)
  14.         ) ENGINE = InnoDB;
  15.     */
  16.     $paypal_ips = array("66.211.170.66", "216.113.188.202", "216.113.188.203", "216.113.188.202", "127.0.0.1");
  17.     if(!in_array($_SERVER['REMOTE_ADDR'], $paypal_ips))
  18.     {
  19.         print "Scammer...";
  20.         $hak = fopen("scammer.log", "a");
  21.         fwrite($hak, $_SERVER['REMOTE_ADDR']." \r\n");
  22.         fclose($hak);
  23.         die(0);
  24.     }
  25.     if ($_REQUEST['debug'])
  26.     {
  27.         ini_set("display_errors", true);
  28.         error_reporting(E_ALL);
  29.     }
  30.     //Relative Paths
  31.     include('../../config/config.php'); //change
  32.     include('../../pot/OTS.php');//change
  33.     /*
  34.      *      Config
  35.      */
  36.         $paylist = array("0.01" => 1, "12.00" => 125, "15.00" => 175);
  37.         $yourMail = "aashora@live.se";
  38.     /*
  39.      *
  40.      */
  41.     $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));  
  42.     $receiver_email = $_REQUEST['receiver_email'];  
  43.     $payment_status = $_REQUEST['payment_status'];  
  44.     $mc_gross = $_REQUEST['mc_gross'];
  45.     $address = $_REQUEST['address_country'];
  46.     $name = $_REQUEST['first_name']." ".$_REQUEST['last_name'];
  47.     $pem = $_REQUEST['payer_email'];
  48.     //Relative Paths
  49.     $config_ini = parse_ini_file('../../config/config.ini');//Change
  50.    
  51.     $server_config = parse_ini_file($config_ini['server_path'].'config.lua');
  52.     if(isset($server_config['mysqlHost']))
  53.     {
  54.         //new (0.2.6+) ots config.lua file
  55.         $mysqlhost = $server_config['mysqlHost'];
  56.         $mysqluser = $server_config['mysqlUser'];
  57.         $mysqlpass = $server_config['mysqlPass'];
  58.         $mysqldatabase = $server_config['mysqlDatabase'];
  59.         $sqlitefile = $server_config['sqliteDatabase'];
  60.     }
  61.     elseif(isset($server_config['sqlHost']))
  62.     {
  63.         //old (0.2.4) ots config.lua file
  64.         $mysqlhost = $server_config['sqlHost'];
  65.         $mysqluser = $server_config['sqlUser'];
  66.         $mysqlpass = $server_config['sqlPass'];
  67.         $mysqldatabase = $server_config['sqlDatabase'];
  68.         $sqlitefile = $server_config['sqliteDatabase'];
  69.     }
  70.     if($server_config['sqlType'] == "mysql")
  71.         POT::getInstance()->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
  72.     elseif($server_config['sqlType'] == "sqlite")
  73.         POT::getInstance()->connect(POT::DB_SQLITE, array('database' => $config_ini['server_path'].$sqlitefile));
  74.     $SQL = POT::getInstance()->getDBHandle();
  75.     if ($_REQUEST['debug'])
  76.     {
  77.         print $payment_status . '\n';
  78.         print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  79.         print $receiver_email . '\n';
  80.         print $custom . '\n';
  81.     }
  82.    
  83.     if ($receiver_email == $yourMail && isset($paylist[$mc_gross]))
  84.     {
  85.         if($payment_status == "Completed")
  86.         {
  87.             $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + ".(int) $paylist[$mc_gross]." WHERE `name` = ".$SQL->quote($custom).";");
  88.             $SQL->query("INSERT INTO `paypal_log`(`account`, `amount`, `email`, `date`, `ip`, `name`, `country`, `status`) VALUES(".$SQL->quote($custom).",".$SQL->quote($mc_gross).", ".$SQL->quote($pem).", ".(int) time().",".$SQL->quote($_SERVER['REMOTE_ADDR']).", ".$SQL->quote($name).", ".$SQL->quote($address).", 1);");  
  89.         }
  90.         else if($payment_status == "Reversed")
  91.             $SQL->query("INSERT INTO `paypal_log`(`account`, `amount`, `email`, `date`, `ip`, `name`, `country`, `status`) VALUES(".$SQL->quote($custom).",".$SQL->quote($mc_gross).", ".$SQL->quote($pem).", ".(int) time().",".$SQL->quote($_SERVER['REMOTE_ADDR']).", ".$SQL->quote($name).", ".$SQL->quote($address).", 2);");  
  92.     }  
  93.     else  
  94.         echo("Error.");  
  95. ?>
Add Comment
Please, Sign In to add comment