mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-03 01:34:53 +02:00
Burst Limit
This commit is contained in:
parent
91c90f05f8
commit
cfb81596ae
8 changed files with 130 additions and 53 deletions
|
@ -67,6 +67,7 @@ switch ($action) {
|
|||
$rate_down_unit = _post('rate_down_unit');
|
||||
$rate_up = _post('rate_up');
|
||||
$rate_up_unit = _post('rate_up_unit');
|
||||
$burst = _post('burst');
|
||||
run_hook('add_bandwidth'); #HOOK
|
||||
$msg = '';
|
||||
if(Validator::Length($name,16,4) == false){
|
||||
|
@ -88,6 +89,7 @@ switch ($action) {
|
|||
$d->rate_down_unit = $rate_down_unit;
|
||||
$d->rate_up = $rate_up;
|
||||
$d->rate_up_unit = $rate_up_unit;
|
||||
$d->burst = $burst;
|
||||
$d->save();
|
||||
|
||||
r2(U . 'bandwidth/list', 's', Lang::T('Data Created Successfully'));
|
||||
|
@ -102,6 +104,7 @@ switch ($action) {
|
|||
$rate_down_unit = _post('rate_down_unit');
|
||||
$rate_up = _post('rate_up');
|
||||
$rate_up_unit = _post('rate_up_unit');
|
||||
$burst = _post('burst');
|
||||
run_hook('edit_bandwidth'); #HOOK
|
||||
$msg = '';
|
||||
if(Validator::Length($name,16,4) == false){
|
||||
|
@ -128,6 +131,7 @@ switch ($action) {
|
|||
$d->rate_down_unit = $rate_down_unit;
|
||||
$d->rate_up = $rate_up;
|
||||
$d->rate_up_unit = $rate_up_unit;
|
||||
$d->burst = $burst;
|
||||
$d->save();
|
||||
|
||||
r2(U . 'bandwidth/list', 's', Lang::T('Data Updated Successfully'));
|
||||
|
|
|
@ -173,7 +173,7 @@ switch ($action) {
|
|||
Mikrotik::removeHotspotPlan($client, $d['name_plan']);
|
||||
} catch (Exception $e) {
|
||||
//ignore exception, it means router has already deleted
|
||||
} catch(Throwable $e){
|
||||
} catch (Throwable $e) {
|
||||
//ignore exception, it means router has already deleted
|
||||
}
|
||||
}
|
||||
|
@ -200,6 +200,7 @@ switch ($action) {
|
|||
$validity_unit = _post('validity_unit');
|
||||
$routers = _post('routers');
|
||||
$pool_expired = _post('pool_expired');
|
||||
$list_expired = _post('list_expired');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
|
||||
|
@ -243,6 +244,7 @@ switch ($action) {
|
|||
}
|
||||
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
||||
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown;
|
||||
$rate = trim($rate . " " . $b['burst']);
|
||||
|
||||
$d = ORM::for_table('tbl_plans')->create();
|
||||
$d->name_plan = $name;
|
||||
|
@ -264,8 +266,9 @@ switch ($action) {
|
|||
} else {
|
||||
$d->is_radius = 0;
|
||||
$d->routers = $routers;
|
||||
$d->pool_expired = $pool_expired;
|
||||
}
|
||||
$d->pool_expired = $pool_expired;
|
||||
$d->list_expired = $list_expired;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->save();
|
||||
|
@ -305,6 +308,7 @@ switch ($action) {
|
|||
$validity = _post('validity');
|
||||
$validity_unit = _post('validity_unit');
|
||||
$pool_expired = _post('pool_expired');
|
||||
$list_expired = _post('list_expired');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
$routers = _post('routers');
|
||||
|
@ -343,6 +347,8 @@ switch ($action) {
|
|||
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
||||
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown;
|
||||
|
||||
$rate = trim($rate . " " . $b['burst']);
|
||||
|
||||
if ($d['is_radius']) {
|
||||
Radius::planUpSert($id, $radiusRate);
|
||||
} else {
|
||||
|
@ -367,6 +373,7 @@ switch ($action) {
|
|||
$d->validity_unit = $validity_unit;
|
||||
$d->shared_users = $sharedusers;
|
||||
$d->pool_expired = $pool_expired;
|
||||
$d->list_expired = $list_expired;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->save();
|
||||
|
@ -443,7 +450,7 @@ switch ($action) {
|
|||
Mikrotik::removePpoePlan($client, $d['name_plan']);
|
||||
} catch (Exception $e) {
|
||||
//ignore exception, it means router has already deleted
|
||||
} catch(Throwable $e){
|
||||
} catch (Throwable $e) {
|
||||
//ignore exception, it means router has already deleted
|
||||
}
|
||||
}
|
||||
|
@ -506,6 +513,7 @@ switch ($action) {
|
|||
}
|
||||
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
||||
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown;
|
||||
$rate = trim($rate . " " . $b['burst']);
|
||||
|
||||
$d = ORM::for_table('tbl_plans')->create();
|
||||
$d->type = 'PPPOE';
|
||||
|
@ -593,6 +601,7 @@ switch ($action) {
|
|||
}
|
||||
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
||||
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown;
|
||||
$rate = trim($rate . " " . $b['burst']);
|
||||
|
||||
if ($d['is_radius']) {
|
||||
Radius::planUpSert($id, $radiusRate, $pool);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue