[freeside-commits] freeside/httemplate/search sqlradius.html, 1.9, 1.9.8.1 sqlradius.cgi, 1.20, 1.20.4.1
Erik Levinson
levinse at wavetail.420.am
Wed May 11 08:23:58 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv17074/httemplate/search
Modified Files:
Tag: FREESIDE_2_1_BRANCH
sqlradius.html sqlradius.cgi
Log Message:
add summarized RADIUS report feature, RT11776
Index: sqlradius.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/sqlradius.cgi,v
retrieving revision 1.20
retrieving revision 1.20.4.1
diff -u -w -d -r1.20 -r1.20.4.1
--- sqlradius.cgi 9 Apr 2010 08:18:24 -0000 1.20
+++ sqlradius.cgi 11 May 2011 15:23:56 -0000 1.20.4.1
@@ -57,6 +57,7 @@
% 'svc_acct' => $cgi_svc_acct,
% 'ip' => $ip,
% 'prefix' => $prefix,
+% 'summarize' => $summarize,
% } )
% }
% ) {
@@ -96,6 +97,9 @@
# parse cgi params
###
+my $summarize = 0;
+$summarize = 1 if $cgi->param('summarize') eq 'Y';
+
#sort of false laziness w/cust_pay.cgi
my( $beginning, $ending ) = ( '', '' );
if ( $cgi->param('stoptime_beginning')
@@ -265,7 +269,42 @@
# the fields
###
-tie my %fields, 'Tie::IxHash',
+my %fields;
+if ( $summarize ) {
+tie %fields, 'Tie::IxHash',
+ 'username' => {
+ name => 'User',
+ attrib => 'UserName',
+ fmt => $user_format,
+ align => 'left',
+ },
+ 'dummy' => {
+ name => 'Customer',
+ attrib => '',
+ fmt => $customer_format,
+ align => 'left',
+ },
+ 'acctsessiontime' => {
+ name => 'Duration',
+ attrib => 'Acct-Session-Time',
+ fmt => $duration_format,
+ align => 'right',
+ },
+ 'acctinputoctets' => {
+ name => 'Upload', # (from user)',
+ attrib => 'Acct-Input-Octets',
+ fmt => $octets_format,
+ align => 'right',
+ },
+ 'acctoutputoctets' => {
+ name => 'Download', # (to user)',
+ attrib => 'Acct-Output-Octets',
+ fmt => $octets_format,
+ align => 'right',
+ },
+;
+} else {
+tie %fields, 'Tie::IxHash',
'username' => {
name => 'User',
attrib => 'UserName',
@@ -322,6 +361,7 @@
align => 'right',
},
;
+}
$fields{$_}->{fmt} ||= sub { length($_[0]) ? shift : ' '; }
foreach keys %fields;
Index: sqlradius.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/sqlradius.html,v
retrieving revision 1.9
retrieving revision 1.9.8.1
diff -u -w -d -r1.9 -r1.9.8.1
--- sqlradius.html 22 Oct 2008 04:39:54 -0000 1.9
+++ sqlradius.html 11 May 2011 15:23:56 -0000 1.9.8.1
@@ -8,6 +8,12 @@
<TD ALIGN="right">Username: </TD>
<TD><INPUT TYPE="text" NAME="username"></TD>
</TR>
+<% include( '/elements/tr-checkbox.html',
+ 'field' => 'summarize',
+ 'label' => 'Summarize',
+ 'value' => 'Y',
+ )
+%>
<TR>
<TD></TD>
<TD><FONT SIZE="-1"><I>(leave blank to show all users)</I></FONT></TD>
More information about the freeside-commits
mailing list