summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-04-21 21:39:03 +0000
committerErmal <eri@pfsense.org>2011-04-21 21:39:03 +0000
commit2d4003aab1d969ed9ba3e52f2fe3ec083e4bef8c (patch)
treedf726b1b378db3c2be3f33eac2ff055b4f0b7e09
parent908cbaf91a98b223386709ba64a75179a323e1d1 (diff)
downloadpfsense-2d4003aab1d969ed9ba3e52f2fe3ec083e4bef8c.zip
pfsense-2d4003aab1d969ed9ba3e52f2fe3ec083e4bef8c.tar.gz
If the bandwidth value is coming from radius scale it up to the requested Kbit/s unit.
-rw-r--r--etc/inc/captiveportal.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 196d83c..a66c6cb 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1659,8 +1659,8 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
*/
$peruserbw = isset($config['captiveportal']['peruserbw']);
- $bw_up = isset($attributes['bw_up']) ? trim($attributes['bw_up']) : $config['captiveportal']['bwdefaultup'];
- $bw_down = isset($attributes['bw_down']) ? trim($attributes['bw_down']) : $config['captiveportal']['bwdefaultdn'];
+ $bw_up = isset($attributes['bw_up']) ? round(intval($attributes['bw_up'])/1000, 2) : $config['captiveportal']['bwdefaultup'];
+ $bw_down = isset($attributes['bw_down']) ? round(intval($attributes['bw_down'])/1000, 2) : $config['captiveportal']['bwdefaultdn'];
if ($passthrumac) {
$mac = array();
OpenPOWER on IntegriCloud