From 5f5008b377d2e94be9ebba810b956c41713445eb Mon Sep 17 00:00:00 2001 From: Frank Harris Date: Sun, 23 Nov 2025 14:42:37 -0500 Subject: [PATCH] fixed missign config file and added check if xmlrpc istnt installed --- includes/lib_remote.php | 18 ++++++ modules/billing/admin.php | 2 +- modules/billing/admin_config.php | 2 +- modules/billing/admin_coupons.php | 2 +- modules/billing/admin_payments.php | 2 +- modules/billing/api/capture_order.php | 2 +- modules/billing/api/create_order.php | 2 +- modules/billing/bootstrap.php | 9 +-- modules/billing/diag_remote.php | 18 ++++-- modules/billing/docs.php | 2 +- modules/billing/docs/xml_notes.php | 2 +- modules/billing/includes/admin_auth.php | 3 +- modules/billing/includes/config_loader.php | 64 +++++++++++++++++++ modules/billing/includes/menu.php | 2 +- .../billing/includes/payment_processor.php | 11 +--- modules/billing/invoices.php | 2 +- modules/billing/payment_cancel.php | 2 +- modules/billing/payment_success.php | 4 +- modules/billing/return.php | 2 +- modules/billing/tools/check_db_user.php | 4 +- modules/billing/webhook.php | 2 +- 21 files changed, 115 insertions(+), 42 deletions(-) create mode 100644 modules/billing/includes/config_loader.php diff --git a/includes/lib_remote.php b/includes/lib_remote.php index aafb450e..1f206cbb 100644 --- a/includes/lib_remote.php +++ b/includes/lib_remote.php @@ -24,6 +24,24 @@ require_once("Crypt/XXTEA.php"); +if (!defined('GSP_XMLRPC_READY')) { + if (!function_exists('xmlrpc_encode_request') || !function_exists('xmlrpc_decode')) { + $message = "GSP requires the PHP xmlrpc extension for agent communication.\n". + "Install the php-xmlrpc package for your PHP version (example: sudo apt install php8.3-xmlrpc on Ubuntu 24.04 or use PECL).\n". + "See https://www.php.net/manual/en/book.xmlrpc.php for installation instructions."; + if (PHP_SAPI === 'cli') { + fwrite(STDERR, $message . PHP_EOL); + } else { + if (!headers_sent()) { + header('Content-Type: text/plain; charset=UTF-8', true, 500); + } + echo nl2br(htmlentities($message)); + } + exit(1); + } + define('GSP_XMLRPC_READY', true); +} + // Screen type for servers define("OGP_SCREEN_TYPE_HOME","HOME"); define("OGP_SCREEN_TYPE_UPDATE","UPDATE"); diff --git a/modules/billing/admin.php b/modules/billing/admin.php index 7512ab87..8139bcfe 100644 --- a/modules/billing/admin.php +++ b/modules/billing/admin.php @@ -1,7 +1,7 @@ + diff --git a/modules/billing/invoices.php b/modules/billing/invoices.php index b11c6145..ef1ff88d 100644 --- a/modules/billing/invoices.php +++ b/modules/billing/invoices.php @@ -1,7 +1,7 @@ 0) { - \ No newline at end of file + diff --git a/modules/billing/return.php b/modules/billing/return.php index cdb3f314..922f20b0 100644 --- a/modules/billing/return.php +++ b/modules/billing/return.php @@ -1,5 +1,5 @@ \ No newline at end of file +?> diff --git a/modules/billing/webhook.php b/modules/billing/webhook.php index cf628247..b51c95e5 100644 --- a/modules/billing/webhook.php +++ b/modules/billing/webhook.php @@ -1,5 +1,5 @@