Do not apply bw limits if the setting is not enabled in CP. Though still respect radius attributes for now with this setting. Resolves #4127
This commit is contained in:
parent
be544b9025
commit
b57ea0b75a
|
@ -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;
|
||||
|
||||
|
|
Reference in New Issue