Merge pull request #268 from agstrxyz/Development

Update Radius.php
This commit is contained in:
iBNu Maksum 2024-08-22 09:43:06 +07:00 committed by GitHub
commit 244f477f27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,9 +88,10 @@ class Radius
if ($p) { if ($p) {
$this->customerAddPlan($customer, $p); $this->customerAddPlan($customer, $p);
} }
} } else {
$this->customerDeactivate($customer['username'], true); $this->customerDeactivate($customer['username'], true);
} }
}
public function change_username($plan, $from, $to) public function change_username($plan, $from, $to)
{ {
@ -257,6 +258,7 @@ class Radius
{ {
$this->getTableCustomer()->where_equal('username', $username)->delete_many(); $this->getTableCustomer()->where_equal('username', $username)->delete_many();
$this->getTableUserPackage()->where_equal('username', $username)->delete_many(); $this->getTableUserPackage()->where_equal('username', $username)->delete_many();
$this->getTableCustomerAttr()->where_equal('username', $username)->delete_many();
} }
/** /**
@ -361,7 +363,15 @@ class Radius
} }
if ($plan['type'] == 'PPPOE') { if ($plan['type'] == 'PPPOE') {
if (!empty($customer['pppoe_ip']) && $expired != '') {
$this->upsertCustomerAttr($customer['username'], 'Framed-Pool', $plan['pool'], ':='); $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', ':=');
}
} }