- панель работает на 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 - документация на русском: ИЗМЕНЕНИЯ, БЕЗОПАСНОСТЬ, ИНСТРУКЦИЯ
64 lines
2.3 KiB
PHP
64 lines
2.3 KiB
PHP
<?php
|
|
/*
|
|
Copyright (c) 2020 HOSTINPL (HOSTING-RUS) https://vk.com/hosting_rus
|
|
Developed by Samir Shelenko (https://vk.com/id00v)
|
|
*/
|
|
class invoicesController extends Controller {
|
|
private $limit = 8;
|
|
public function index($page = 1) {
|
|
$this->document->setActiveSection('account');
|
|
$this->document->setActiveItem('invoices');
|
|
$this->data['title'] = $this->config->title;
|
|
$this->data['description'] = $this->config->description;
|
|
$this->data['mail_from'] = $this->config->mail_from;
|
|
$this->data['homed'] = $this->config->homed;
|
|
$this->data['city_country'] = $this->config->city_country;
|
|
$this->data['phone'] = $this->config->phone;
|
|
$this->data['logo'] = $this->config->logo;
|
|
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('invoices');
|
|
$this->load->model('users');
|
|
$userid = $this->user->getId();
|
|
$sort = array(
|
|
'invoice_status' => 'DESC',
|
|
'invoice_id' => 'DESC'
|
|
);
|
|
$getOptions = array(
|
|
'start' => ($page - 1) * $this->limit,
|
|
'limit' => $this->limit
|
|
);
|
|
|
|
$total = $this->invoicesModel->getTotalInvoices(array('user_id' => (int)$userid));
|
|
$invoices = $this->invoicesModel->getInvoices(array('user_id' => (int)$userid), array(), $sort, $getOptions);
|
|
|
|
$paginationLib = new paginationLibrary();
|
|
|
|
$paginationLib->total = $total;
|
|
$paginationLib->page = $page;
|
|
$paginationLib->limit = $this->limit;
|
|
$paginationLib->url = $this->config->url . 'account/invoices/index/{page}';
|
|
|
|
$pagination = $paginationLib->render();
|
|
|
|
$this->data['invoices'] = $invoices;
|
|
$this->data['pagination'] = $pagination;
|
|
$this->data['user_email'] = $this->user->getEmail();
|
|
$this->data['user_id'] = $userid;
|
|
$this->data['user_firstname'] = $this->user->getFirstname();
|
|
$this->data['user_lastname'] = $this->user->getLastname();
|
|
$this->data['user_balance'] = $this->user->getBalance();
|
|
$this->getChild(array('common/header', 'common/footer'));
|
|
return $this->load->view('account/invoices', $this->data);
|
|
}
|
|
}
|
|
?>
|