From 24df116003903bc5d86e6a7ae7bad3a5aeea94a7 Mon Sep 17 00:00:00 2001 From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com> Date: Sat, 13 Jan 2024 09:41:58 +0100 Subject: [PATCH 1/2] Update cron.php stop user from auto renewing packages that has been disabled for purchase. --- system/cron.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/cron.php b/system/cron.php index 98a2d833..cac928ab 100644 --- a/system/cron.php +++ b/system/cron.php @@ -137,7 +137,7 @@ foreach ($d as $ds) { // autorenewal from deposit if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) { - if ($p && $p['enabled'] && $c['balance'] >= $p['price']) { + if ($p && $p['enabled'] && $c['balance'] >= $p['price'] && $p['allow_purchase'] =='yes') { if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) { // if success, then get the balance Balance::min($ds['customer_id'], $p['price']); @@ -191,7 +191,7 @@ foreach ($d as $ds) { // autorenewal from deposit if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) { - if ($p && $p['enabled'] && $c['balance'] >= $p['price']) { + if ($p && $p['enabled'] && $c['balance'] >= $p['price']&& $p['allow_purchase'] =='yes') { if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) { // if success, then get the balance Balance::min($ds['customer_id'], $p['price']); From 90e62834264e7d4ec53bdedaf5a055caf51facc0 Mon Sep 17 00:00:00 2001 From: Focuslinkstech <45756999+Focuslinkstech@users.noreply.github.com> Date: Sun, 14 Jan 2024 13:58:46 +0100 Subject: [PATCH 2/2] urgent update fix installation database added plan name when editing service plan --- install/phpnuxbill.sql | 5 +++-- ui/ui/hotspot-edit.tpl | 2 +- ui/ui/pppoe-edit.tpl | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql index 77d2bbfc..ee0a4b20 100644 --- a/install/phpnuxbill.sql +++ b/install/phpnuxbill.sql @@ -104,7 +104,8 @@ CREATE TABLE `tbl_plans` ( `is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius', `pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `pool_expired` varchar(40) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled\r\n' + `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled\r\n', + `allow_purchase` enum('yes','no') DEFAULT 'yes' COMMENT 'allow to show package in buy package page' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; DROP TABLE IF EXISTS `tbl_pool`; @@ -309,4 +310,4 @@ VALUES ( 'Active', '2022-09-06 16:09:50', '2014-06-23 01:43:07' - ); \ No newline at end of file + ); diff --git a/ui/ui/hotspot-edit.tpl b/ui/ui/hotspot-edit.tpl index 9489932f..c945df16 100644 --- a/ui/ui/hotspot-edit.tpl +++ b/ui/ui/hotspot-edit.tpl @@ -3,7 +3,7 @@