Plan For Expired Customer
This commit is contained in:
@ -34,8 +34,9 @@ class MikrotikHotspot
|
||||
}
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
if (!empty($plan['pool_expired'])) {
|
||||
$this->setHotspotUserPackage($client, $customer['username'], 'EXPIRED NUXBILL ' . $plan['pool_expired']);
|
||||
if (!empty($plan['plan_expired'])) {
|
||||
$p = ORM::for_table("tbl_plans")->select("name_plan")->find_one($plan['plan_expired']);
|
||||
$this->setHotspotUserPackage($client, $customer['username'], $p['name_plan']);
|
||||
} else {
|
||||
$this->removeHotspotUser($client, $customer['username']);
|
||||
}
|
||||
@ -322,7 +323,7 @@ class MikrotikHotspot
|
||||
$client->sendSync($setRequest);
|
||||
}
|
||||
|
||||
function setHotspotUserPackage($client, $user, $plan)
|
||||
function setHotspotUserPackage($client, $user, $plan_name)
|
||||
{
|
||||
global $_app_stage;
|
||||
if ($_app_stage == 'demo') {
|
||||
@ -335,7 +336,7 @@ class MikrotikHotspot
|
||||
|
||||
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
|
||||
$setRequest->setArgument('numbers', $id);
|
||||
$setRequest->setArgument('profile', $plan);
|
||||
$setRequest->setArgument('profile', $plan_name);
|
||||
$client->sendSync($setRequest);
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,9 @@ class MikrotikPppoe
|
||||
}
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
if (!empty($plan['pool_expired'])) {
|
||||
$this->setPpoeUserPlan($client, $customer['username'], 'EXPIRED NUXBILL ' . $plan['pool_expired']);
|
||||
if (!empty($plan['plan_expired'])) {
|
||||
$p = ORM::for_table("tbl_plans")->select("name_plan")->find_one($plan['plan_expired']);
|
||||
$this->setPpoeUserPlan($client, $customer['username'], $p['plan_expired']);
|
||||
} else {
|
||||
$this->removePpoeUser($client, $customer['username']);
|
||||
}
|
||||
|
@ -23,8 +23,10 @@ class Radius {
|
||||
if ($_app_stage == 'demo') {
|
||||
return;
|
||||
}
|
||||
if (empty($plan['pool_expired'])) {
|
||||
if (empty($plan['plan_expired'])) {
|
||||
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||
$this->customerDeactivate($customer['username']);
|
||||
$this->customerAddPlan($customer, $p);
|
||||
} else {
|
||||
$this->upsertCustomerAttr($customer['username'], 'Framed-Pool', $plan['pool_expired'], ':=');
|
||||
$this->disconnectCustomer($customer['username']);
|
||||
|
Reference in New Issue
Block a user