From cf9abbfb456c5d99d9078ce6c660527fa4fb574e Mon Sep 17 00:00:00 2001 From: gerandonk Date: Sat, 8 Mar 2025 18:01:21 +0700 Subject: [PATCH] bandwith 0=unlimited add bandwith 0=unlimited or null for device MikrotikHotspot and MikrotikPppoe --- system/devices/MikrotikHotspot.php | 6 ++++++ system/devices/MikrotikPppoe.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/system/devices/MikrotikHotspot.php b/system/devices/MikrotikHotspot.php index c82d74df..389a20c9 100644 --- a/system/devices/MikrotikHotspot.php +++ b/system/devices/MikrotikHotspot.php @@ -122,6 +122,9 @@ class MikrotikHotspot if (!empty(trim($bw['burst']))) { $rate .= ' ' . $bw['burst']; } + if ($bw['rate_up'] == '0' || $bw['rate_down'] == '0') { + $rate = ''; + } $addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add'); $client->sendSync( $addRequest @@ -202,6 +205,9 @@ class MikrotikHotspot if (!empty(trim($bw['burst']))) { $rate .= ' ' . $bw['burst']; } + if ($bw['rate_up'] == '0' || $bw['rate_down'] == '0') { + $rate = ''; + } $setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set'); $client->sendSync( $setRequest diff --git a/system/devices/MikrotikPppoe.php b/system/devices/MikrotikPppoe.php index 7b3fdac6..b3e5c9ec 100644 --- a/system/devices/MikrotikPppoe.php +++ b/system/devices/MikrotikPppoe.php @@ -149,6 +149,9 @@ class MikrotikPppoe if(!empty(trim($bw['burst']))){ $rate .= ' '.$bw['burst']; } + if ($bw['rate_up'] == '0' || $bw['rate_down'] == '0') { + $rate = ''; + } $pool = ORM::for_table("tbl_pool")->where("pool_name", $plan['pool'])->find_one(); $addRequest = new RouterOS\Request('/ppp/profile/add'); $client->sendSync( @@ -205,6 +208,9 @@ class MikrotikPppoe if(!empty(trim($bw['burst']))){ $rate .= ' '.$bw['burst']; } + if ($bw['rate_up'] == '0' || $bw['rate_down'] == '0') { + $rate = ''; + } $pool = ORM::for_table("tbl_pool")->where("pool_name", $new_plan['pool'])->find_one(); $setRequest = new RouterOS\Request('/ppp/profile/set'); $client->sendSync(