diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e1fe96..89b521ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # CHANGELOG +## 2023.9.1.1 + +- Fix cronjob Delete customer + ## 2023.9.1 - Critical bug fixes, bug happen when user buy package, expired time will be calculated from last expired, not from when they buy the package diff --git a/system/autoload/Package.php b/system/autoload/Package.php index e7081343..638680b9 100644 --- a/system/autoload/Package.php +++ b/system/autoload/Package.php @@ -19,7 +19,7 @@ class Package */ public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel) { - global $_c, $_L, $_notifmsg; + global $_c; $date_now = date("Y-m-d H:i:s"); $date_only = date("Y-m-d"); $time_only = date("H:i:s"); diff --git a/system/cron.php b/system/cron.php index 6c324b7f..f13df716 100644 --- a/system/cron.php +++ b/system/cron.php @@ -19,8 +19,8 @@ ORM::configure('logging', true); include "autoload/Hookers.php"; // notification message -if(file_exists("system/uploads/notifications.json")){ - $_notifmsg =json_decode(file_get_contents('system/uploads/notifications.json'), true); +if (file_exists("system/uploads/notifications.json")) { + $_notifmsg = json_decode(file_get_contents('system/uploads/notifications.json'), true); } $_notifmsg_default = json_decode(file_get_contents('system/uploads/notifications.default.json'), true); @@ -66,7 +66,7 @@ date_default_timezone_set($config['timezone']); $textExpired = Lang::getNotifText('expired'); $d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->where_lte('expiration', date("Y-m-d"))->find_many(); -echo "Found ".count($d)." user(s)\n"; +echo "Found " . count($d) . " user(s)\n"; run_hook('cronjob'); #HOOK foreach ($d as $ds) { @@ -84,6 +84,7 @@ foreach ($d as $ds) { $client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); Mikrotik::setHotspotLimitUptime($client, $c['username']); Mikrotik::removeHotspotActiveUser($client, $c['username']); + Mikrotik::removeHotspotUser($client, $c['username']); Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']); } //update database user dengan status off @@ -106,10 +107,10 @@ foreach ($d as $ds) { "\nRouter: " . $router_name . "\nPrice: " . $p['price']); } - }else{ + } else { echo "no renewall | plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n"; } - }else{ + } else { echo "no renewall | balance $config[enable_balance] auto_renewal $c[auto_renewal]\n"; } } else echo " : ACTIVE \r\n"; @@ -127,6 +128,7 @@ foreach ($d as $ds) { $client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); Mikrotik::disablePpoeUser($client, $c['username']); Mikrotik::removePpoeActive($client, $c['username']); + Mikrotik::removePpoeUser($client, $c['username']); Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']); } diff --git a/version.json b/version.json index a683b0f7..e281d048 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2023.9.1" + "version": "2023.9.1.1" } \ No newline at end of file