Zero datausage if expired
This commit is contained in:
parent
3f5ea7251e
commit
85ede07d77
@ -25,6 +25,15 @@ class RadiusRest {
|
|||||||
// Remove Customer to Mikrotik/Device
|
// Remove Customer to Mikrotik/Device
|
||||||
function remove_customer($customer, $plan)
|
function remove_customer($customer, $plan)
|
||||||
{
|
{
|
||||||
|
// set zero data usage
|
||||||
|
if ($plan['typebp'] == "Limited" && ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit")) {
|
||||||
|
$cs = ORM::for_table("rad_acct")->where('username', $customer['username'])->findMany();
|
||||||
|
foreach ($cs as $c) {
|
||||||
|
$c->acctOutputOctets = 0;
|
||||||
|
$c->acctInputOctets = 0;
|
||||||
|
$c->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// customer change username
|
// customer change username
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "2024.8.8"
|
"version": "2024.8.9"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user