summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2014-12-22 12:03:13 +0100
committerErmal LUÇI <eri@pfsense.org>2014-12-22 12:04:12 +0100
commitb57ea0b75a722f86ba01f72393950ac49610b9b2 (patch)
treee10b46f661bf246e39f8727306b4066fdffad06f
parentbe544b90257dae5aacbed80955cf9f91cc845551 (diff)
downloadpfsense-RELENG_2_1.zip
pfsense-RELENG_2_1.tar.gz
Do not apply bw limits if the setting is not enabled in CP. Though still respect radius attributes for now with this setting. Resolves #4127RELENG_2_1
-rw-r--r--etc/inc/captiveportal.inc14
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index c3dfe10..67a942c 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1744,8 +1744,11 @@ function portal_mac_radius($clientmac,$clientip) {
function captiveportal_reapply_attributes($cpentry, $attributes) {
global $config, $cpzone, $g;
- $dwfaultbw_up = isset($config['captiveportal'][$cpzone]['bwdefaultup']) ? $config['captiveportal'][$cpzone]['bwdefaultup'] : 0;
- $dwfaultbw_down = isset($config['captiveportal'][$cpzone]['bwdefaultdn']) ? $config['captiveportal'][$cpzone]['bwdefaultdn'] : 0;
+ if (isset($config['captiveportal'][$cpzone]['peruserbw'])) {
+ $dwfaultbw_up = isset($config['captiveportal'][$cpzone]['bwdefaultup']) ? $config['captiveportal'][$cpzone]['bwdefaultup'] : 0;
+ $dwfaultbw_down = isset($config['captiveportal'][$cpzone]['bwdefaultdn']) ? $config['captiveportal'][$cpzone]['bwdefaultdn'] : 0;
+ } else
+ $dwfaultbw_up = $dwfaultbw_down = 0;
$bw_up = isset($attributes['bw_up']) ? round(intval($attributes['bw_up'])/1000, 2) : $dwfaultbw_up;
$bw_down = isset($attributes['bw_down']) ? round(intval($attributes['bw_down'])/1000, 2) : $dwfaultbw_down;
$bw_up_pipeno = $cpentry[1];
@@ -1917,8 +1920,11 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
return;
}
- $dwfaultbw_up = isset($config['captiveportal'][$cpzone]['bwdefaultup']) ? $config['captiveportal'][$cpzone]['bwdefaultup'] : 0;
- $dwfaultbw_down = isset($config['captiveportal'][$cpzone]['bwdefaultdn']) ? $config['captiveportal'][$cpzone]['bwdefaultdn'] : 0;
+ if (isset($config['captiveportal'][$cpzone]['peruserbw'])) {
+ $dwfaultbw_up = isset($config['captiveportal'][$cpzone]['bwdefaultup']) ? $config['captiveportal'][$cpzone]['bwdefaultup'] : 0;
+ $dwfaultbw_down = isset($config['captiveportal'][$cpzone]['bwdefaultdn']) ? $config['captiveportal'][$cpzone]['bwdefaultdn'] : 0;
+ } else
+ $dwfaultbw_up = $dwfaultbw_down = 0;
$bw_up = isset($attributes['bw_up']) ? round(intval($attributes['bw_up'])/1000, 2) : $dwfaultbw_up;
$bw_down = isset($attributes['bw_down']) ? round(intval($attributes['bw_down'])/1000, 2) : $dwfaultbw_down;
OpenPOWER on IntegriCloud