Сборка REDL: панель на PHP 8, капча-тумблер, закрытые уязвимости, установщики в один клик

- панель работает на 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
- документация на русском: ИЗМЕНЕНИЯ, БЕЗОПАСНОСТЬ, ИНСТРУКЦИЯ
This commit is contained in:
2026-07-30 02:00:01 +00:00
commit 6ee2744e3a
492 changed files with 354172 additions and 0 deletions
@@ -0,0 +1,223 @@
<?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 controlController extends Controller {
public function index($webid = null) {
$this->document->setActiveSection('webhost');
$this->document->setActiveItem('control');
$this->data['activesection'] = $this->document->getActiveSection();
$this->data['activeitem'] = $this->document->getActiveItem();
if(!$this->user->isLogged()) {
$this->session->data['error'] = "Вы не авторизированы!";
$this->response->redirect($this->config->url . 'account/login');
}
if($this->user->getAccessLevel() < 0) {
$this->session->data['error'] = "У вас нет доступа к данному разделу!";
$this->response->redirect($this->config->url);
}
$this->load->model('webhost');
$error = $this->validate($webid);
if($error) {
$this->session->data['error'] = $error;
$this->response->redirect($this->config->url . 'webhost/index');
}
$webhost = $this->webhostModel->getWebhostById($webid, array('users','web_tarifs','web_locations'));
$this->data['webhost'] = $webhost;
include_once 'application/controllers/common/main.php';
$this->getChild(array('common/header', 'common/footer'));
return $this->load->view('webhost/control', $this->data);
}
public function ajax($webid = null) {
if(!$this->user->isLogged()) {
$this->data['status'] = "error";
$this->data['error'] = "Вы не авторизированы!";
return json_encode($this->data);
}
if($this->user->getAccessLevel() < 1) {
$this->data['status'] = "error";
$this->data['error'] = "У вас нет доступа к данному разделу!";
return json_encode($this->data);
}
$this->load->model('webhost');
$error = $this->validate($webid);
if($error) {
$this->data['status'] = "error";
$this->data['error'] = $error;
return json_encode($this->data);
}
$webhost = $this->webhostModel->getWebhostById($webid, array('web_tarifs'));
if($webhost['web_status'] == 0) {
$this->data['status'] = "error";
$this->data['error'] = "Веб-хостинг заблокирован!";
return json_encode($this->data);
}
if($this->request->server['REQUEST_METHOD'] == 'POST') {
$errorPOST = $this->validatePOST();
if(!$errorPOST) {
$editpassword = @$this->request->post['editpassword'];
$password = @$this->request->post['password'];
if($editpassword) {
$result = $this->webhostModel->updatepassUser($webid, $password);
if($result["status"] == "success") {
$this->webhostModel->updateWebhost($webid, array('web_password' => $password));
$this->data['status'] = "success";
$this->data['success'] = "Пароль доступа успешно изменен!";
} else {
$this->data["status"] = "error";
$this->data["error"] = $result["description"];
}
} else {
$this->data['status'] = "error";
$this->data['error'] = "Ошибка!";
}
} else {
$this->data['status'] = "error";
$this->data['error'] = $errorPOST;
}
}
return json_encode($this->data);
}
public function buy_months($webid = null) {
if(!$this->user->isLogged()) {
$this->data['status'] = "error";
$this->data['error'] = "Вы не авторизированы!";
return json_encode($this->data);
}
if($this->user->getAccessLevel() < 1) {
$this->data['status'] = "error";
$this->data['error'] = "У вас нет доступа к данному разделу!";
return json_encode($this->data);
}
$this->load->model('users');
$this->load->model('webhost');
$this->load->model('waste');
if($this->request->server['REQUEST_METHOD'] == 'POST') {
$days = @$this->request->post['days'];
if($days != "30" && $days != "60" && $days != "90" && $days != "180" && $days != "360" && $days != "15") {
$this->data['status'] = "error";
$this->data['error'] = "Вы указали недопустимый период оплаты!";
return json_encode($this->data);
}
$userid = $this->user->getId();
$balance = $this->user->getBalance();
$webhost = $this->webhostModel->getWebhostById($webid, array('web_tarifs'));
$price = $webhost['tarif_price'];
switch($days) {
case "15":
$price = $price / 2;
break;
case "30":
break;
case "60":
$price = $price * 2;
break;
case "90":
$price = 3 * $price * 0.95;
break;
case "180":
$price = 6 * $price * 0.90;
break;
case "360":
$price = 12 * $price * 0.85;
break;
}
if($balance >= $price) {
if($webhost['web_status'] == 0) {
$this->webhostModel->extendWebhost($webid,$days,false);
$result = $this->webhostModel->unblockWebhost($webid);
if($result["status"] != "success") {
$this->data["status"] = "error";
$this->data["error"] = $result["description"];
}
} else {
$this->webhostModel->extendWebhost($webid,$days,false);
}
$wasteData = array(
'user_id' => $userid,
'waste_ammount' => $price,
'waste_status' => 1,
'waste_usluga' => "Продление веб-хостинга ws$webid на $days дней"
);
$this->wasteModel->createWaste($wasteData);
$this->usersModel->downUserBalance($userid, $price);
$user = $this->usersModel->getUserById($userid, array(), array(), array());
if($user['ref'] != 0) {
$ref_percent = $this->config->ref_percent;
$getpref = ($price * (1 + $ref_percent / 100)) - $price;
$this->usersModel->upUserBalance($user['ref'], $getpref);
$this->usersModel->upUserRMoney($user['ref'], $getpref);
$wasteData = array(
'user_id' => $user['ref'],
'waste_ammount' => $getpref,
'waste_status' => 0,
'waste_usluga' => "Бонус с реферала ID-$userid"
);
$this->wasteModel->createWaste($wasteData);
}
$this->data['status'] = "success";
$this->data['success'] = "Вы успешно оплатили веб-хостинг на $days дней. С Вашего счета снято ".(round($price, 2))." руб";
} else {
$this->data['status'] = "error";
$this->data['error'] = "На Вашем счету не хватает ".(round($price-$balance, 2))." руб";
}
}
return json_encode($this->data);
}
private function validate($webid) {
$result = null;
$userid = $this->user->getId();
if(!$this->webhostModel->getTotalWebhosts(array('web_id' => (int)$webid, 'user_id' => (int)$userid))) {
$result = "Запрашиваемый веб-хостинг не существует!";
}
return $result;
}
private function validatePOST() {
$this->load->library('validate');
$validateLib = new validateLibrary();
$result = null;
$editpassword = @$this->request->post['editpassword'];
$password = @$this->request->post['password'];
$password2 = @$this->request->post['password2'];
if($editpassword) {
if(!$validateLib->password_web($password)) {
$result = "Пароль должен содержать от 8 до 32 латинских букв, цифр и знаков <i>,.!?_-</i>!";
}
elseif($password != $password2) {
$result = "Введенные вами пароли не совпадают!";
}
}
return $result;
}
}
?>
@@ -0,0 +1,49 @@
<?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 indexController extends Controller {
private $limit = 10;
public function index($page = 1) {
$this->document->setActiveSection('webhost');
$this->document->setActiveItem('index');
if(!$this->user->isLogged()) {
$this->session->data['error'] = "Вы не залогинены!";
$this->response->redirect($this->config->url . 'account/login');
}
if($this->user->getAccessLevel() < 0) {
$this->session->data['error'] = "Нет доступа!";
$this->response->redirect($this->config->url);
}
$this->load->library('pagination');
$this->load->model('webhost');
$userid = $this->user->getId();
$options = array(
'start' => ($page - 1) * $this->limit,
'limit' => $this->limit
);
$total = $this->webhostModel->getTotalWebhosts(array('user_id' => (int)$userid));
$webhosts = $this->webhostModel->getWebhosts(array('user_id' => (int)$userid), array('web_tarifs', 'web_locations'), array(), $options);
$paginationLib = new paginationLibrary();
$paginationLib->total = $total;
$paginationLib->page = $page;
$paginationLib->limit = $this->limit;
$paginationLib->url = $this->config->url . 'webhost/index/index/{page}';
$pagination = $paginationLib->render();
$this->data['webhosts'] = $webhosts;
$this->data['pagination'] = $pagination;
$this->getChild(array('common/header', 'common/footer'));
return $this->load->view('webhost/index', $this->data);
}
}
?>
@@ -0,0 +1,216 @@
<?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 orderController extends Controller {
public function index() {
$this->document->setActiveSection('webhost');
$this->document->setActiveItem('order');
if(!$this->user->isLogged()) {
$this->session->data['error'] = "Вы не авторизированы!";
$this->response->redirect($this->config->url . 'account/login');
}
if($this->user->getAccessLevel() < 0) {
$this->session->data['error'] = "У вас нет доступа к данному разделу!";
$this->response->redirect($this->config->url);
}
$this->load->model('webhostTarifs');
$this->load->model('webLocations');
$tarifs = $this->webhostTarifsModel->getTarifs(array('tarif_status' => 1));
$locations = $this->webLocationsModel->getLocations(array('location_status' => 1));
$this->data['tarifs'] = $tarifs;
$this->data['locations'] = $locations;
$this->getChild(array('common/header', 'common/footer'));
return $this->load->view('webhost/order', $this->data);
}
public function promo() {
if(!$this->user->isLogged()) {
$this->data['status'] = "error";
$this->data['error'] = "Вы не авторизированы!";
return json_encode($this->data);
}
if($this->user->getAccessLevel() < 1) {
$this->data['status'] = "error";
$this->data['error'] = "У вас нет доступа к данному разделу!";
return json_encode($this->data);
}
$this->load->model('users');
if($this->request->server['REQUEST_METHOD'] == 'POST') {
$code = $this->request->post['code'];
$skidka = $this->usersModel->getSkidkaByCode($code, false);$kofficent=(100-$skidka['skidka'])/100;
if($skidka['skidka'] == NULL){
$this->data['status'] = "error";
$this->data['error'] = "Данного кода не существует";
}else{
$this->data['status'] = "success";
$this->data['success'] = "Вы активировали скидку ".$skidka['skidka']."%";
$this->data['skidka'] = $kofficent;
}
}
return json_encode($this->data);
}
public function ajax() {
if(!$this->user->isLogged()) {
$this->data['status'] = "error";
$this->data['error'] = "Вы не авторизированы!";
return json_encode($this->data);
}
if($this->user->getAccessLevel() < 1) {
$this->data['status'] = "error";
$this->data['error'] = "У вас нет доступа к данному разделу!";
return json_encode($this->data);
}
$this->load->model('users');
$this->load->model('waste');
$this->load->model('webhost');
$this->load->model('webhostTarifs');
$this->load->model('webLocations');
if($this->request->server['REQUEST_METHOD'] == 'POST') {
if($this->config->webhost == 1) {
$errorPOST = $this->validatePOST();
if(!$errorPOST) {
$tarifid = $this->request->post['tarifid'];
$days = $this->request->post['days'];
$locationid = $this->request->post['locationid'];
$location = $this->webLocationsModel->getLocationById($locationid);
$location_tarifs = explode(" ", $location['location_tarifs']);
if(!in_array($tarifid, $location_tarifs)) {
$this->data['status'] = "error";
$this->data['error'] = "Данный тариф не доступен для указанной локации!";
return json_encode($this->data);
}
$chars="qazxswedcvfrtgbnhyujmkiolp1234567890QAZXSWEDCVFRTGBNHYUJMKIOLP";
$max=14;
$size=StrLen($chars)-1;
$password=null;
while($max--)
$password.=$chars[rand(0,$size)];
$userid = $this->user->getId();
$balance = $this->user->getBalance();
$tarif = $this->webhostTarifsModel->getTarifById($tarifid);
$code = $this->request->post['promo'];
$skidka = $this->usersModel->getSkidkaByCode($code,true);$kofficent=(100-$skidka['skidka'])/100;
$price = $tarif['tarif_price'];
switch($days) {
case "15":
$price = $price / 2;
break;
case "30":
break;
case "60":
$price = $price * 2;
break;
case "90":
$price = 3 * $price * 0.95;
break;
case "180":
$price = 6 * $price * 0.90;
break;
case "360":
$price = 12 * $price * 0.85;
break;
}
if($skidka['skidka'] != NULL){
$price = $price * $kofficent;
}
if($balance >= $price) {
$webData = array(
'user_id' => $userid,
'location_id' => $locationid,
'web_password' => $password,
'tarif_id' => $tarifid,
'web_status' => 1,
'web_days' => $days
);
$package = $tarif['package'];
$webid = $this->webhostModel->createWebhost($webData);
$result = $this->webhostModel->installWebhost($webid,$password,$package);
if($result["status"] == "success") {
$this->usersModel->downUserBalance($userid, $price);
$wasteData = array(
'user_id' => $userid,
'waste_ammount' => $price,
'waste_status' => 1,
'waste_usluga' => "Заказ веб-хостинга ws$webid"
);
$this->wasteModel->createWaste($wasteData);
$user = $this->usersModel->getUserById($userid, array(), array(), array());
if($user['ref'] != 0) {
$ref_percent = $this->config->ref_percent;
$getpref = ($price * (1 + $ref_percent / 100)) - $price;
$this->usersModel->upUserBalance($user['ref'], $getpref);
$this->usersModel->upUserRMoney($user['ref'], $getpref);
$wasteData = array(
'user_id' => $user['ref'],
'waste_ammount' => $getpref,
'waste_status' => 0,
'waste_usluga' => "Бонус с реферала ID-$userid"
);
$this->wasteModel->createWaste($wasteData);
}
$this->data['status'] = "success";
$this->data['success'] = "Веб-хостинг №".$webid." успешно заказан.";
$this->data['id'] = $webid;
} else {
$this->data["status"] = "error";
$this->data["error"] = $result["description"];
}
} else {
$this->data['status'] = "error";
$this->data['error'] = "На Вашем счету не хватает ".(round($price-$balance, 2))." руб";
}
} else {
$this->data['status'] = "error";
$this->data['error'] = $errorPOST;
}
} else {
$this->data['status'] = "error";
$this->data['error'] = "Веб.хостинг не доступен для заказа!";
}
}
return json_encode($this->data);
}
private function validatePOST() {
$this->load->library('validate');
$validateLib = new validateLibrary();
$result = null;
$tarifid = @$this->request->post['tarifid'];
$months = @$this->request->post['months'];
$locationid = @$this->request->post['locationid'];
$days = @$this->request->post['days'];
if(!$this->webhostTarifsModel->getTotalTarifs(array('tarif_id' => (int)$tarifid, 'tarif_status' => 1))) {
$result = "Вы указали несуществующий тариф!";
}
elseif(!$this->webLocationsModel->getTotalLocations(array('location_id' => (int)$locationid, 'location_status' => 1))) {
$result = "Вы указали несуществующую локацию!";
}
elseif($days != "30" && $days != "60" && $days != "90" && $days != "180" && $days != "360" && $days != "15") {
$result = "Вы указали недопустимый период оплаты!";
}
return $result;
}
}
?>