disconnect PPPOE when plan change

This commit is contained in:
Ibnu Maksum 2024-08-01 10:12:54 +07:00
parent 721ef32e12
commit aac8306d7b
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -29,6 +29,7 @@ class MikrotikPppoe
function add_customer($customer, $plan)
{
global $isChangePlan;
$mikrotik = $this->info($plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
//check if customer exists
@ -51,7 +52,9 @@ class MikrotikPppoe
$setRequest->setArgument('password', $pass);
$client->sendSync($setRequest);
//disconnect then
//$this->removePpoeActive($client, $customer['username']);
if(isset($isChangePlan) && $isChangePlan){
$this->removePpoeActive($client, $customer['username']);
}
}
}