- панель работает на PHP 8.4 (оригинал под PHP 7.0): elFinder utf8_encode, apache_get_modules, warnings - капча выключена и управляется из админки (флаг captcha_enable + блок настроек) - закрыты две SQL-инъекции без авторизации (createAuthLog: пароль из POST и CF-Connecting-IP) - убрано хранение паролей в открытом виде в authlog, XSS в поле ref - установщики install-panel.sh и install-node.sh (оригинальный затирал sources.list репозиториями Debian 9) - современный Dockerfile (оригинальный на debian:stretch больше не собирается) - планировщик и автозапуск работают без systemd - брендинг REDL.IO, год 2026, ссылки на redl.io - документация на русском: ИЗМЕНЕНИЯ, БЕЗОПАСНОСТЬ, ИНСТРУКЦИЯ
71 lines
2.2 KiB
PHP
71 lines
2.2 KiB
PHP
<?php
|
|
/*
|
|
Copyright (c) 2020 HOSTINPL (HOSTING-RUS) https://vk.com/hosting_rus
|
|
Developed by Samir Shelenko and Alexander Zemlyanoy (https://vk.com/id00v / https://vk.com/mrsasha082)
|
|
*/
|
|
class anypayController extends Controller {
|
|
public function index() {
|
|
$this->load->model('users');
|
|
$this->load->model('invoices');
|
|
$this->load->model('waste');
|
|
|
|
if($this->request->server['REQUEST_METHOD'] == 'POST') {
|
|
$errorPOST = $this->validatePOST();
|
|
if(!$errorPOST) {
|
|
$ammount = $this->request->post['amount'];
|
|
$invid = $this->request->post['pay_id'];
|
|
$signature = $this->request->post['sign'];
|
|
|
|
$invoice = $this->invoicesModel->getInvoiceById($invid);
|
|
$userid = $invoice['user_id'];
|
|
$user = $this->usersModel->getUserById($userid);
|
|
|
|
if($ammount > 50){
|
|
$this->usersModel->updateUser($userid, $userData = array('user_promised_pay' => 0));
|
|
}
|
|
|
|
$wasteData = array(
|
|
'user_id' => $userid,
|
|
'waste_ammount' => $ammount,
|
|
'waste_status' => 0,
|
|
'waste_usluga' => "Пополнение баланса пользователя",
|
|
);
|
|
$this->wasteModel->createWaste($wasteData);
|
|
|
|
$this->usersModel->upUserBalance($userid, $ammount);
|
|
|
|
$bonus_percent = $this->config->bonus_percent;
|
|
$getbonus = ($ammount * (1 + $bonus_percent / 100)) - $ammount;
|
|
$this->usersModel->upUserBonuses($userid, $getbonus);
|
|
|
|
$this->invoicesModel->updateInvoice($invid, array('invoice_status' => 1));
|
|
return "OK$invid\n";
|
|
} else {
|
|
return "Error: $errorPOST";
|
|
}
|
|
} else {
|
|
return "Error: Invalid request!";
|
|
}
|
|
}
|
|
|
|
private function validatePOST() {
|
|
$result = null;
|
|
|
|
$ammount = $this->request->post['amount'];
|
|
$invid = $this->request->post['pay_id'];
|
|
$signature = $this->request->post['sign'];
|
|
|
|
$login = $this->config->anypay_login;
|
|
$password = $this->config->anypay_password;
|
|
|
|
if(!$this->invoicesModel->getTotalInvoices(array('invoice_id' => (int)$invid))) {
|
|
$result = "Invalid invoice!";
|
|
}
|
|
elseif(strtoupper($signature) != strtoupper(md5("$login:$ammount:$invid:$password"))) {
|
|
$result = "Invalid signature!";
|
|
}
|
|
return $result;
|
|
}
|
|
}
|
|
?>
|