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] 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']);