From 7c415d3935d157aa4ae56a9542ce1a62bdf595eb Mon Sep 17 00:00:00 2001 From: jdegraeve Date: Fri, 10 Feb 2006 15:26:48 +0000 Subject: [PATCH] Fixes problem with integer values which are internally stored as string which need to be really integer git-svn-id: https://svn.m0n0.ch/wall/trunk@82 e36fee2c-cc09-0410-a7cc-ebac5c6737de --- captiveportal/radius_accounting.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/captiveportal/radius_accounting.inc b/captiveportal/radius_accounting.inc index 168ee4a..2ad5d25 100644 --- a/captiveportal/radius_accounting.inc +++ b/captiveportal/radius_accounting.inc @@ -32,7 +32,7 @@ This code cannot simply be copied and put under the GNU Public License or any other GPL-like (LGPL, GPL2) License. - +settype($foo, "integer") This code is made possible thx to samples made by Michael Bretterklieber author of the PHP PECL Radius package @@ -165,6 +165,14 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radius $volume['output_bytes_radius'] = remainder($volume['output_bytes']); $volume['output_gigawords'] = gigawords($volume['output_bytes']); + // Make the volume data safe for our radius.inc functions (It really needs to be integer or we get an error) + settype($volume['input_pkts'], "integer"); + settype($volume['input_bytes_radius'], "integer"); + settype($volume['input_gigawords'], "integer"); + settype($volume['output_pkts'], "integer"); + settype($volume['output_bytes_radius'], "integer"); + settype($volume['output_gigawords'], "integer"); + switch($radiusvendor) { case 'cisco': -- 2.43.0