Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- CREATE TABLE `paypal_log` (
- `id` INT NOT NULL AUTO_INCREMENT,
- `account` VARCHAR(32) NOT NULL DEFAULT '',
- `amount` INT NOT NULL DEFAULT 0,
- `email` VARCHAR(255) NOT NULL DEFAULT '',
- `date` INT NOT NULL DEFAULT 0,
- `ip` VARCHAR(15) NOT NULL DEFAULT '',
- `name` VARCHAR(255) NOT NULL DEFAULT '',
- `country` VARCHAR(255) NOT NULL DEFAULT '',
- `status` SMALLINT NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`)
- ) ENGINE = InnoDB;
- */
- $paypal_ips = array("66.211.170.66", "216.113.188.202", "216.113.188.203", "216.113.188.202", "127.0.0.1");
- if(!in_array($_SERVER['REMOTE_ADDR'], $paypal_ips))
- {
- print "Scammer...";
- $hak = fopen("scammer.log", "a");
- fwrite($hak, $_SERVER['REMOTE_ADDR']." \r\n");
- fclose($hak);
- die(0);
- }
- if ($_REQUEST['debug'])
- {
- ini_set("display_errors", true);
- error_reporting(E_ALL);
- }
- //Relative Paths
- include('../../config/config.php'); //change
- include('../../pot/OTS.php');//change
- /*
- * Config
- */
- $paylist = array("0.01" => 1, "12.00" => 125, "15.00" => 175);
- $yourMail = "aashora@live.se";
- /*
- *
- */
- $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
- $receiver_email = $_REQUEST['receiver_email'];
- $payment_status = $_REQUEST['payment_status'];
- $mc_gross = $_REQUEST['mc_gross'];
- $address = $_REQUEST['address_country'];
- $name = $_REQUEST['first_name']." ".$_REQUEST['last_name'];
- $pem = $_REQUEST['payer_email'];
- //Relative Paths
- $config_ini = parse_ini_file('../../config/config.ini');//Change
- $server_config = parse_ini_file($config_ini['server_path'].'config.lua');
- if(isset($server_config['mysqlHost']))
- {
- //new (0.2.6+) ots config.lua file
- $mysqlhost = $server_config['mysqlHost'];
- $mysqluser = $server_config['mysqlUser'];
- $mysqlpass = $server_config['mysqlPass'];
- $mysqldatabase = $server_config['mysqlDatabase'];
- $sqlitefile = $server_config['sqliteDatabase'];
- }
- elseif(isset($server_config['sqlHost']))
- {
- //old (0.2.4) ots config.lua file
- $mysqlhost = $server_config['sqlHost'];
- $mysqluser = $server_config['sqlUser'];
- $mysqlpass = $server_config['sqlPass'];
- $mysqldatabase = $server_config['sqlDatabase'];
- $sqlitefile = $server_config['sqliteDatabase'];
- }
- if($server_config['sqlType'] == "mysql")
- POT::getInstance()->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
- elseif($server_config['sqlType'] == "sqlite")
- POT::getInstance()->connect(POT::DB_SQLITE, array('database' => $config_ini['server_path'].$sqlitefile));
- $SQL = POT::getInstance()->getDBHandle();
- if ($_REQUEST['debug'])
- {
- print $payment_status . '\n';
- print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
- print $receiver_email . '\n';
- print $custom . '\n';
- }
- if ($receiver_email == $yourMail && isset($paylist[$mc_gross]))
- {
- if($payment_status == "Completed")
- {
- $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + ".(int) $paylist[$mc_gross]." WHERE `name` = ".$SQL->quote($custom).";");
- $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);");
- }
- else if($payment_status == "Reversed")
- $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);");
- }
- else
- echo("Error.");
- ?>
Add Comment
Please, Sign In to add comment