diff options
author | Alexander Wilke <nachtfalkeaw@web.de> | 2013-01-28 20:50:56 +0100 |
---|---|---|
committer | Alexander Wilke <nachtfalkeaw@web.de> | 2013-01-28 20:50:56 +0100 |
commit | 05aaa6484a46e588cc4af857bdefd68eaccb9c5f (patch) | |
tree | ae73dd54e294047b8312af3893dfb147d554d1f9 | |
parent | 95b583ca4bc7f23ae5cdb1e8891aff982db0cf4a (diff) | |
download | pfsense-packages-05aaa6484a46e588cc4af857bdefd68eaccb9c5f.tar.gz pfsense-packages-05aaa6484a46e588cc4af857bdefd68eaccb9c5f.tar.bz2 pfsense-packages-05aaa6484a46e588cc4af857bdefd68eaccb9c5f.zip |
freeradius2: Add Acct-Interim-Interval reply attribute
CP now supports custom interim-update variables
-rw-r--r-- | config/freeradius2/freeradius.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 60ccbdf4..38093780 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -432,6 +432,13 @@ if (is_array($arrusers) && !empty($arrusers)) { $varusersmaxbandwidthdown = ($users['varusersmaxbandwidthdown']?$users['varusersmaxbandwidthdown']:''); $varusersmaxbandwidthdown = $varusersmaxbandwidthdown * 1024; + // Accounting-Interim-Interval - Must not be smaller than 60 and should be bigger than 600s + if (($users['varusersacctinteriminterval'] >= '0') && ($users['varusersacctinteriminterval'] < '60')) { + $varusersacctinteriminterval = 60; + } else { + $varusersacctinteriminterval = $users['varusersacctinteriminterval']; + } + // Clear variables for next user foreach additional options TOP $varuserstopadditionaloptions = ''; $varusersadditionaloptionstop = ''; @@ -542,6 +549,10 @@ if (is_array($arrusers) && !empty($arrusers)) { if ($varusersreplyitem != '') { $varusersreplyitem .=","; } $varusersreplyitem .= "\n\tWISPr-Bandwidth-Max-Down := $varusersmaxbandwidthdown"; } + if ($varusersacctinteriminterval != '') { + if ($varusersreplyitem != '') { $varusersreplyitem .=","; } + $varusersreplyitem .= "\n\tAcct-Interim-Interval := $varusersacctinteriminterval"; + } if ($varuserswisprredirectionurl != '') { if ($varusersreplyitem != '') { $varusersreplyitem .=","; } $varusersreplyitem .= "\n\tWISPr-Redirection-URL := $varuserswisprredirectionurl"; @@ -629,6 +640,15 @@ if (is_array($arrmacs) && !empty($arrmacs)) { $varmacsmaxbandwidthdown = ($macs['varmacsmaxbandwidthdown']?$macs['varmacsmaxbandwidthdown']:''); $varmacsmaxbandwidthdown = $varmacsmaxbandwidthdown * 1024; + + // Accounting-Interim-Interval + if (($users['varmacsacctinteriminterval'] >= '0') && ($users['varmacsacctinteriminterval'] < '60')) { + $varmacsacctinteriminterval = 60; + } else { + $varmacsacctinteriminterval = $users['varmacsacctinteriminterval']; + } + + // Clear variables for next mac foreach additional options TOP $varmacstopadditionaloptions = ''; $varmacsadditionaloptionstop = ''; @@ -723,6 +743,10 @@ if (is_array($arrmacs) && !empty($arrmacs)) { if ($varmacsreplyitem != '') { $varmacsreplyitem .=","; } $varmacsreplyitem .= "\n\tWISPr-Bandwidth-Max-Down := $varmacsmaxbandwidthdown"; } + if ($varmacsacctinteriminterval != '') { + if ($varmacsreplyitem != '') { $varmacsreplyitem .=","; } + $varmacsreplyitem .= "\n\tAcct-Interim-Interval := $varmacsacctinteriminterval"; + } if ($varmacswisprredirectionurl != '') { if ($varmacsreplyitem != '') { $varmacsreplyitem .=","; } $varmacsreplyitem .= "\n\tWISPr-Redirection-URL := $varmacsswisprredirectionurl"; |