From 342fbe25a8cdcdfba914ead516b0ca5a9cbc0f5e Mon Sep 17 00:00:00 2001 From: AGSTR <144728914+agstrxyz@users.noreply.github.com> Date: Wed, 21 Aug 2024 21:31:27 +0700 Subject: [PATCH] Update Radius.php lokal ip dan profil expired pppoe --- system/devices/Radius.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/system/devices/Radius.php b/system/devices/Radius.php index 2544c7c5..634ba2da 100644 --- a/system/devices/Radius.php +++ b/system/devices/Radius.php @@ -88,8 +88,9 @@ class Radius if ($p) { $this->customerAddPlan($customer, $p); } - } + } else { $this->customerDeactivate($customer['username'], true); + } } public function change_username($plan, $from, $to) @@ -257,6 +258,7 @@ class Radius { $this->getTableCustomer()->where_equal('username', $username)->delete_many(); $this->getTableUserPackage()->where_equal('username', $username)->delete_many(); + $this->getTableCustomerAttr()->where_equal('username', $username)->delete_many(); } /** @@ -361,8 +363,16 @@ class Radius } if ($plan['type'] == 'PPPOE') { + if (!empty($customer['pppoe_ip']) && $expired != '') { + $this->upsertCustomerAttr($customer['username'], 'Framed-Pool', $plan['pool'], ':='); + $this->upsertCustomerAttr($customer['username'], 'Framed-IP-Address', $customer['pppoe_ip'], ':='); + $this->upsertCustomerAttr($customer['username'], 'Framed-IP-Netmask', '255.255.255.0', ':='); + }else{ $this->upsertCustomerAttr($customer['username'], 'Framed-Pool', $plan['pool'], ':='); - } + $this->upsertCustomerAttr($customer['username'], 'Framed-IP-Address', '0.0.0.0', ':='); + $this->upsertCustomerAttr($customer['username'], 'Framed-IP-Netmask', '255.255.255.0', ':='); + } + } return true;