diff options
| author | Mark Wells <mark@freeside.biz> | 2013-03-23 13:45:47 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2013-03-23 13:45:47 -0700 |
| commit | 6bf3df8177a22d2275b1a68045ab5ff2e831af42 (patch) | |
| tree | c7e183b0ef1a3159ae519b36a8350e91c95ab9ee /httemplate/search/sqlradius.cgi | |
| parent | c3d0d1fba9dfc9988f148cbf7bd07de33d5025d8 (diff) | |
option to show both open and closed RADIUS sessions, #21483
Diffstat (limited to 'httemplate/search/sqlradius.cgi')
| -rw-r--r-- | httemplate/search/sqlradius.cgi | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/httemplate/search/sqlradius.cgi b/httemplate/search/sqlradius.cgi index 5363944e4..22984731a 100644 --- a/httemplate/search/sqlradius.cgi +++ b/httemplate/search/sqlradius.cgi @@ -51,7 +51,7 @@ % @{ $part_export->usage_sessions( { % 'stoptime_start' => $beginning, % 'stoptime_end' => $ending, -% 'open_sessions' => $open_sessions, +% 'session_status' => $status, % 'starttime_start' => $starttime_beginning, % 'starttime_end' => $starttime_ending, % 'svc_acct' => $cgi_svc_acct, @@ -117,9 +117,9 @@ if ( $cgi->param('end') && $cgi->param('end') =~ /^(\d+)$/ ) { $ending = $1; } -my $open_sessions = ''; -if ( $cgi->param('open_sessions') =~ /^(\d*)$/ ) { - $open_sessions = $1; +my $status = ''; +if ( $cgi->param('session_status') =~ /^(closed|open)$/ ) { + $status = $1; } my( $starttime_beginning, $starttime_ending ) = ( '', '' ); @@ -242,8 +242,15 @@ my $time_format = sub { $pretty; }; +my $time_format_or_open = sub { + my $time = shift; + return '<CENTER>OPEN</CENTER>' if $time == 0; + &{$time_format}($time); +}; + my $duration_format = sub { my $seconds = shift; + return '' if $seconds eq ''; # open session my $hour = int($seconds/3600); my $min = int( ($seconds%3600) / 60 ); my $sec = $seconds%60; @@ -339,7 +346,7 @@ tie %fields, 'Tie::IxHash', 'acctstoptime' => { name => 'End time', attrib => 'Acct-Stop-Time', - fmt => $time_format, + fmt => $time_format_or_open, align => 'left', }, 'acctsessiontime' => { |
