if expired plan deleted, go delete customer when expired
This commit is contained in:
parent
95899b4eba
commit
2a7563f43d
@ -44,10 +44,11 @@ class MikrotikHotspot
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
if (!empty($plan['plan_expired'])) {
|
||||
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||
if($p){
|
||||
$this->add_customer($customer, $p);
|
||||
} else {
|
||||
$this->removeHotspotUser($client, $customer['username']);
|
||||
}
|
||||
}
|
||||
$this->removeHotspotUser($client, $customer['username']);
|
||||
$this->removeHotspotActiveUser($client, $customer['username']);
|
||||
}
|
||||
|
||||
|
@ -71,13 +71,15 @@ class MikrotikPppoe
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
if (!empty($plan['plan_expired'])) {
|
||||
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||
if($p){
|
||||
$this->add_customer($customer, $p);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->removePpoeUser($client, $customer['username']);
|
||||
if (!empty($customer['pppoe_username'])) {
|
||||
$this->removePpoeUser($client, $customer['pppoe_username']);
|
||||
}
|
||||
}
|
||||
$this->removePpoeActive($client, $customer['username']);
|
||||
if (!empty($customer['pppoe_username'])) {
|
||||
$this->removePpoeActive($client, $customer['pppoe_username']);
|
||||
|
@ -85,11 +85,12 @@ class Radius
|
||||
{
|
||||
if (!empty($plan['plan_expired'])) {
|
||||
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||
if ($p) {
|
||||
$this->customerAddPlan($customer, $p);
|
||||
} else {
|
||||
$this->customerDeactivate($customer['username'], true);
|
||||
}
|
||||
}
|
||||
$this->customerDeactivate($customer['username'], true);
|
||||
}
|
||||
|
||||
public function change_username($from, $to)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user