forked from kevinowino869/mitrobill
Fix Mikrotik-Rate-Limit burst
This commit is contained in:
parent
1704fe563d
commit
307abd64d3
@ -41,13 +41,11 @@ class Radius
|
|||||||
$unitup = 'M';
|
$unitup = 'M';
|
||||||
}
|
}
|
||||||
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
|
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
|
||||||
if (!empty(trim($bw['burst']))) {
|
|
||||||
$rate .= ' ' . $bw['burst'];
|
|
||||||
}
|
|
||||||
$rates = explode('/', $rate);
|
$rates = explode('/', $rate);
|
||||||
##burst fixed
|
|
||||||
if (strpos($rate, ' ')) {
|
// cek jika punya burst
|
||||||
$ratos = $rates[0] . '/' . $rates[1] . ' ' . $rates[2] . '/' . $rates[3] . '/' . $rates[4] . '/' . $rates[5] . '/' . $rates[6];
|
if (!empty(trim($bw['burst']))) {
|
||||||
|
$ratos = $rate . ' ' . $bw['burst'];
|
||||||
} else {
|
} else {
|
||||||
$ratos = $rates[0] . '/' . $rates[1];
|
$ratos = $rates[0] . '/' . $rates[1];
|
||||||
}
|
}
|
||||||
@ -156,24 +154,6 @@ class Radius
|
|||||||
return $n->save();
|
return $n->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function planUpSert($plan_id, $rate, $pool = null)
|
|
||||||
{
|
|
||||||
$rates = explode('/', $rate);
|
|
||||||
##burst fixed
|
|
||||||
if (strpos($rate, ' ')) {
|
|
||||||
$ratos = $rates[0] . '/' . $rates[1] . ' ' . $rates[2] . '/' . $rates[3] . '/' . $rates[4] . '/' . $rates[5] . '/' . $rates[6];
|
|
||||||
} else {
|
|
||||||
$ratos = $rates[0] . '/' . $rates[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->upsertPackage($plan_id, 'Ascend-Data-Rate', $this->stringToInteger($rates[1]), ':=');
|
|
||||||
$this->upsertPackage($plan_id, 'Ascend-Xmit-Rate', $this->stringToInteger($rates[0]), ':=');
|
|
||||||
$this->upsertPackage($plan_id, 'Mikrotik-Rate-Limit', $ratos, ':=');
|
|
||||||
// if ($pool != null) {
|
|
||||||
// $this->upsertPackage($plan_id, 'Framed-Pool', $pool, ':=');
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public function customerChangeUsername($from, $to)
|
public function customerChangeUsername($from, $to)
|
||||||
{
|
{
|
||||||
$c = $this->getTableCustomer()->where_equal('username', $from)->findMany();
|
$c = $this->getTableCustomer()->where_equal('username', $from)->findMany();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user