From 05aaa6484a46e588cc4af857bdefd68eaccb9c5f Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Mon, 28 Jan 2013 20:50:56 +0100 Subject: freeradius2: Add Acct-Interim-Interval reply attribute CP now supports custom interim-update variables --- config/freeradius2/freeradius.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'config/freeradius2') 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"; -- cgit v1.2.3