Merge pull request #309 from gerandonk/Development
if exist remote ip on pppoe, it will reset on expired
This commit is contained in:
commit
4ffbac878c
@ -33,6 +33,7 @@ class MikrotikPppoe
|
|||||||
$mikrotik = $this->info($plan['routers']);
|
$mikrotik = $this->info($plan['routers']);
|
||||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||||
$cid = self::getIdByCustomer($customer, $client);
|
$cid = self::getIdByCustomer($customer, $client);
|
||||||
|
$exp = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||||
if (empty($cid)) {
|
if (empty($cid)) {
|
||||||
//customer not exists, add it
|
//customer not exists, add it
|
||||||
$this->addPpoeUser($client, $plan, $customer);
|
$this->addPpoeUser($client, $plan, $customer);
|
||||||
@ -49,9 +50,11 @@ class MikrotikPppoe
|
|||||||
} else {
|
} else {
|
||||||
$setRequest->setArgument('name', $customer['username']);
|
$setRequest->setArgument('name', $customer['username']);
|
||||||
}
|
}
|
||||||
if (!empty($customer['pppoe_ip'])) {
|
if ($exp == 0) {
|
||||||
|
$setRequest->setArgument('remote-address', '0.0.0.0');
|
||||||
|
} else if (!empty($customer['pppoe_ip'])){
|
||||||
$setRequest->setArgument('remote-address', $customer['pppoe_ip']);
|
$setRequest->setArgument('remote-address', $customer['pppoe_ip']);
|
||||||
}else{
|
} else {
|
||||||
$setRequest->setArgument('remote-address', '0.0.0.0');
|
$setRequest->setArgument('remote-address', '0.0.0.0');
|
||||||
}
|
}
|
||||||
$setRequest->setArgument('profile', $plan['name_plan']);
|
$setRequest->setArgument('profile', $plan['name_plan']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user