diff --git a/system/.htaccess b/system/.htaccess
new file mode 100644
index 0000000..5fd3ff1
--- /dev/null
+++ b/system/.htaccess
@@ -0,0 +1,19 @@
+
' . $e->getTraceAsString() . ''); +} catch (Exception $e) { + die($e->getMessage() . '
' . $e->getTraceAsString() . ''); +} + +function _notify($msg, $type = 'e') +{ + $_SESSION['ntype'] = $type; + $_SESSION['notify'] = $msg; +} + +$ui = new Smarty(); +$ui->assign('_kolaps', $_COOKIE['kolaps']); +if (!empty($config['theme']) && $config['theme'] != 'default') { + $_theme = APP_URL . '/' . $UI_PATH . '/themes/' . $config['theme']; + $ui->setTemplateDir([ + 'custom' => File::pathFixer($UI_PATH . '/ui_custom/'), + 'theme' => File::pathFixer($UI_PATH . '/themes/' . $config['theme']), + 'default' => File::pathFixer($UI_PATH . '/ui/') + ]); +} else { + $_theme = APP_URL . '/' . $UI_PATH . '/ui'; + $ui->setTemplateDir([ + 'custom' => File::pathFixer($UI_PATH . '/ui_custom/'), + 'default' => File::pathFixer($UI_PATH . '/ui/') + ]); +} +$ui->assign('_theme', $_theme); +$ui->addTemplateDir($PAYMENTGATEWAY_PATH . File::pathFixer('/ui/'), 'pg'); +$ui->addTemplateDir($PLUGIN_PATH . File::pathFixer('/ui/'), 'plugin'); +$ui->setCompileDir(File::pathFixer($UI_PATH . '/compiled/')); +$ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/')); +$ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/')); +$ui->assign('app_url', APP_URL); +$ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL, PHP_URL_HOST))); +$ui->assign('_url', APP_URL . '/?_route='); +$ui->assign('_path', __DIR__); +$ui->assign('_c', $config); +$ui->assign('user_language', $_SESSION['user_language']); +$ui->assign('UPLOAD_PATH', str_replace($root_path, '', $UPLOAD_PATH)); +$ui->assign('CACHE_PATH', str_replace($root_path, '', $CACHE_PATH)); +$ui->assign('PAGES_PATH', str_replace($root_path, '', $PAGES_PATH)); +$ui->assign('_system_menu', 'dashboard'); + +function _msglog($type, $msg) +{ + $_SESSION['ntype'] = $type; + $_SESSION['notify'] = $msg; +} + +if (isset($_SESSION['notify'])) { + $notify = $_SESSION['notify']; + $ntype = $_SESSION['ntype']; + $ui->assign('notify', $notify); + $ui->assign('notify_t', $ntype); + unset($_SESSION['notify']); + unset($_SESSION['ntype']); +} + +if (!isset($_GET['_route'])) { + $req = ltrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'); + $len = strlen(ltrim(parse_url(APP_URL, PHP_URL_PATH), '/')); + if ($len > 0) { + $req = ltrim(substr($req, $len), '/'); + } +} else { + // Routing Engine + $req = _get('_route'); +} + +$routes = explode('/', $req); +$ui->assign('_routes', $routes); +$handler = $routes[0]; +if ($handler == '') { + $handler = 'default'; +} +try { + if (!empty($_GET['uid'])) { + $_COOKIE['uid'] = $_GET['uid']; + } + $admin = Admin::_info(); + $sys_render = $root_path . File::pathFixer('system/controllers/' . $handler . '.php'); + if (file_exists($sys_render)) { + $menus = array(); + // "name" => $name, + // "admin" => $admin, + // "position" => $position, + // "function" => $function + $ui->assign('_system_menu', $routes[0]); + foreach ($menu_registered as $menu) { + if ($menu['admin'] && _admin(false)) { + if (count($menu['auth']) == 0 || in_array($admin['user_type'], $menu['auth'])) { + $menus[$menu['position']] .= '
' . $e->getTraceAsString() . ''); + $ui->assign("error_title", "PHPNuxBill Crash"); + $ui->display('admin/error.tpl'); + die(); +} catch (Exception $e) { + Message::sendTelegram( + "Sistem Error.\n" . + $e->getMessage() . "\n" . + $e->getTraceAsString() + ); + if (empty($_SESSION['aid'])) { + $ui->display('customer/error.tpl'); + die(); + } + $ui->assign("error_message", $e->getMessage() . '
' . $e->getTraceAsString() . ''); + $ui->assign("error_title", "PHPNuxBill Crash"); + $ui->display('admin/error.tpl'); + die(); +} diff --git a/system/composer.json b/system/composer.json new file mode 100644 index 0000000..5250cfe --- /dev/null +++ b/system/composer.json @@ -0,0 +1,7 @@ +{ + "require": { + "mpdf/mpdf": "^8.1", + "smarty/smarty": "=4.5.3", + "yosiazwan/php-facedetection": "^0.1.0" + } +} diff --git a/system/composer.lock b/system/composer.lock new file mode 100644 index 0000000..bc6c089 --- /dev/null +++ b/system/composer.lock @@ -0,0 +1,532 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "a5f201dce3d594a500f2b9e9a8532e66", + "packages": [ + { + "name": "mpdf/mpdf", + "version": "v8.1.6", + "source": { + "type": "git", + "url": "https://github.com/mpdf/mpdf.git", + "reference": "146c7c1dfd21c826b9d5bbfe3c15e52fd933c90f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/146c7c1dfd21c826b9d5bbfe3c15e52fd933c90f", + "reference": "146c7c1dfd21c826b9d5bbfe3c15e52fd933c90f", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-mbstring": "*", + "mpdf/psr-log-aware-trait": "^2.0 || ^3.0", + "myclabs/deep-copy": "^1.7", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "setasign/fpdi": "^2.1" + }, + "require-dev": { + "mockery/mockery": "^1.3.0", + "mpdf/qrcode": "^1.1.0", + "squizlabs/php_codesniffer": "^3.5.0", + "tracy/tracy": "~2.5", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "ext-bcmath": "Needed for generation of some types of barcodes", + "ext-xml": "Needed mainly for SVG manipulation", + "ext-zlib": "Needed for compression of embedded resources, such as fonts" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-only" + ], + "authors": [ + { + "name": "Matěj Humpál", + "role": "Developer, maintainer" + }, + { + "name": "Ian Back", + "role": "Developer (retired)" + } + ], + "description": "PHP library generating PDF files from UTF-8 encoded HTML", + "homepage": "https://mpdf.github.io", + "keywords": [ + "pdf", + "php", + "utf-8" + ], + "support": { + "docs": "http://mpdf.github.io", + "issues": "https://github.com/mpdf/mpdf/issues", + "source": "https://github.com/mpdf/mpdf" + }, + "funding": [ + { + "url": "https://www.paypal.me/mpdf", + "type": "custom" + } + ], + "time": "2023-05-03T19:36:43+00:00" + }, + { + "name": "mpdf/psr-log-aware-trait", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/mpdf/psr-log-aware-trait.git", + "reference": "7a077416e8f39eb626dee4246e0af99dd9ace275" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mpdf/psr-log-aware-trait/zipball/7a077416e8f39eb626dee4246e0af99dd9ace275", + "reference": "7a077416e8f39eb626dee4246e0af99dd9ace275", + "shasum": "" + }, + "require": { + "psr/log": "^1.0 || ^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mpdf\\PsrLogAwareTrait\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Dorison", + "email": "mark@chromatichq.com" + }, + { + "name": "Kristofer Widholm", + "email": "kristofer@chromatichq.com" + } + ], + "description": "Trait to allow support of different psr/log versions.", + "support": { + "issues": "https://github.com/mpdf/psr-log-aware-trait/issues", + "source": "https://github.com/mpdf/psr-log-aware-trait/tree/v2.0.0" + }, + "time": "2023-05-03T06:18:28+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, + { + "name": "psr/http-message", + "version": "1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/1.1" + }, + "time": "2023-04-04T09:50:52+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "setasign/fpdi", + "version": "v2.3.7", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDI.git", + "reference": "bccc892d5fa1f48c43f8ba7db5ed4ba6f30c8c05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/bccc892d5fa1f48c43f8ba7db5ed4ba6f30c8c05", + "reference": "bccc892d5fa1f48c43f8ba7db5ed4ba6f30c8c05", + "shasum": "" + }, + "require": { + "ext-zlib": "*", + "php": "^5.6 || ^7.0 || ^8.0" + }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, + "require-dev": { + "phpunit/phpunit": "~5.7", + "setasign/fpdf": "~1.8", + "setasign/tfpdf": "1.31", + "squizlabs/php_codesniffer": "^3.5", + "tecnickcom/tcpdf": "~6.2" + }, + "suggest": { + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." + }, + "type": "library", + "autoload": { + "psr-4": { + "setasign\\Fpdi\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Slabon", + "email": "jan.slabon@setasign.com", + "homepage": "https://www.setasign.com" + }, + { + "name": "Maximilian Kresse", + "email": "maximilian.kresse@setasign.com", + "homepage": "https://www.setasign.com" + } + ], + "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.", + "homepage": "https://www.setasign.com/fpdi", + "keywords": [ + "fpdf", + "fpdi", + "pdf" + ], + "support": { + "issues": "https://github.com/Setasign/FPDI/issues", + "source": "https://github.com/Setasign/FPDI/tree/v2.3.7" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/setasign/fpdi", + "type": "tidelift" + } + ], + "time": "2023-02-09T10:38:43+00:00" + }, + { + "name": "smarty/smarty", + "version": "v4.5.3", + "source": { + "type": "git", + "url": "https://github.com/smarty-php/smarty.git", + "reference": "9fc96a13dbaf546c3d7bcf95466726578cd4e0fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/9fc96a13dbaf546c3d7bcf95466726578cd4e0fa", + "reference": "9fc96a13dbaf546c3d7bcf95466726578cd4e0fa", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^7.5", + "smarty/smarty-lexer": "^3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "libs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Monte Ohrt", + "email": "monte@ohrt.com" + }, + { + "name": "Uwe Tews", + "email": "uwe.tews@googlemail.com" + }, + { + "name": "Rodney Rehm", + "email": "rodney.rehm@medialize.de" + }, + { + "name": "Simon Wisselink", + "homepage": "https://www.iwink.nl/" + } + ], + "description": "Smarty - the compiling PHP template engine", + "homepage": "https://smarty-php.github.io/smarty/", + "keywords": [ + "templating" + ], + "support": { + "forum": "https://github.com/smarty-php/smarty/discussions", + "issues": "https://github.com/smarty-php/smarty/issues", + "source": "https://github.com/smarty-php/smarty/tree/v4.5.3" + }, + "time": "2024-05-28T21:46:01+00:00" + }, + { + "name": "yosiazwan/php-facedetection", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/yosiazwan/php-facedetection.git", + "reference": "b016273ceceacd85562bbc50384fbabc947fe525" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yosiazwan/php-facedetection/zipball/b016273ceceacd85562bbc50384fbabc947fe525", + "reference": "b016273ceceacd85562bbc50384fbabc947fe525", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "php": ">=5.2.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "FaceDetector.php", + "Exception/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Maurice Svay", + "homepage": "https://github.com/mauricesvay/php-facedetection/graphs/contributors" + } + ], + "description": "PHP class to detect one face in images. A pure PHP port of an existing JS code from Karthik Tharavad.", + "homepage": "https://github.com/mauricesvay/php-facedetection", + "support": { + "source": "https://github.com/yosiazwan/php-facedetection/tree/0.1.0" + }, + "time": "2016-01-26T22:10:00+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +}