From 49ea4966f886d374d03914b130c7c870f795b180 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Fri, 19 Jul 2024 10:34:18 +0700 Subject: [PATCH] fix radius --- system/devices/Radius.php | 15 +++++++++------ system/lan/english.json | 3 ++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/system/devices/Radius.php b/system/devices/Radius.php index 1164099c..e93d7d53 100644 --- a/system/devices/Radius.php +++ b/system/devices/Radius.php @@ -28,8 +28,15 @@ class Radius function add_customer($customer, $plan) { - global $b; - $this->customerAddPlan($customer, $plan, $b['expiration'] . '' . $b['time']); + $b = ORM::for_table('tbl_user_recharges') + ->where('customer_id', $customer['id']) + ->where('plan_id', $plan['id']) + ->where('status', 'on') + ->findMany(); + + if($b){ + $this->customerAddPlan($customer, $plan, $b['expiration'] . ' ' . $b['time']); + } } function remove_customer($customer, $plan) @@ -262,10 +269,6 @@ class Radius // Mikrotik Spesific $this->upsertCustomer($customer['username'], 'Max-Data', $datalimit); //$this->upsertCustomer($customer['username'], 'Mikrotik-Total-Limit', $datalimit); - - - - } } else { //$this->delAtribute($this->getTableCustomer(), 'Max-Volume', 'username', $customer['username']); diff --git a/system/lan/english.json b/system/lan/english.json index 1e478501..15efc70c 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -652,5 +652,6 @@ "Api": "Api", "Http_Chap": "Http-Chap", "Hotspot_Authentication_Method__Make_sure_you_have_changed_your_hotspot_login_page_": "Hotspot Authentication Method. Make sure you have changed your hotspot login page.", - "Business": "Business" + "Business": "Business", + "": "" } \ No newline at end of file