Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- include('config.php');
- include('functions.php');
- include('rcon.php');
- $host = '51.254.126.147'; // Server host name or IP
- $port = 25571; // Port rcon is listening on
- $password = 'VfhbyfRehl4rjdf123'; // rcon.password setting set in server.properties
- $timeout = 3; // How long to timeout.
- $rcon = new Rcon($host, $port, $password, $timeout);
- if ($_REQUEST)
- {
- $errs = array();
- $sum = trim($_REQUEST["summ"]);
- $pay_id = trim($_REQUEST["pay_id"]);
- $shop_id = '1627';
- $secret_key = '843721195';
- $signature = md5($shop_id.':'.$_REQUEST['summ'].':'.$_REQUEST['pay_id'].':'.$secret_key);
- function getIP() {
- if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
- return $_SERVER['REMOTE_ADDR'];
- }
- if (!in_array(getIP(), array('185.162.128.88'))) {
- die("hacking attempt!");
- }
- if ($signature != $_REQUEST['sign']) {
- die('ERROR_bad sign');
- }
- $id = mysqli_fetch_array(mysqli_query($mysql,"SELECT * FROM `payments` WHERE id = '$pay_id'"))or die('Ошибка получения id платежа');
- if($id['sum'] != $_REQUEST['summ']){
- die('Сумма изменена');
- }
- switch ($id['type']) {
- case 'group':
- $user=$id['account'];
- $group= $id['group'];
- $rcon->connect();
- $rcon->send_command("sync console all pex user $user group set $group");
- break;
- case 'unban':
- $user=$id['account'];
- $rcon->connect();
- $rcon->send_command("sync console all unban $user");
- break;
- case 'money':
- $user= $id['account'];
- $money = $id['group'];
- $rcon->connect();
- $rcon->send_command("eco give $user $money");
- break;
- case 'case':
- $user= $id['account'];
- $key= $id['group'];
- $rcon->connect();
- $rcon->send_command("crate give v $key 1 $user");
- break;
- }
- die('OK');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement