diff options
author | ivan <ivan> | 2002-12-17 09:47:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-12-17 09:47:06 +0000 |
commit | d37105c93eae1366ee72ef93ae3d79cc5b04ade6 (patch) | |
tree | 198e7f377f0f4b395c8cad016577111bfe253948 | |
parent | eb3e4b97673b20b626774b9e000c5c327c991d5b (diff) |
is this broken or is the calculation?
-rw-r--r-- | FS/bin/freeside-sqlradius-seconds | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/FS/bin/freeside-sqlradius-seconds b/FS/bin/freeside-sqlradius-seconds index d2358cd5e..0539cb4d2 100644 --- a/FS/bin/freeside-sqlradius-seconds +++ b/FS/bin/freeside-sqlradius-seconds @@ -10,16 +10,13 @@ my $fs_user = shift or die &usage; adminsuidsetup( $fs_user ); my $target_user = shift or die &usage; -my $start = shift or die &usage; -my $stop = scalar(@_) ? shift : ''; +my $start = scalar(@_) && str2time(shift) or die &usage; +my $stop = scalar(@_) ? str2time(shift) : time; my $svc_acct = qsearchs( 'svc_acct', { 'username' => $target_user } ); die "username $target_user not found\n" unless $svc_acct; -print $svc_acct->seconds_since_sqlradacct( - str2time($start), - $stop ? str2time($stop) : time ). - "\n"; +print $svc_acct->seconds_since_sqlradacct( $start, $stop ). "\n"; sub usage { die "Usage:\n\n freeside-sqlradius-seconds freeside_username target_username start_date stop_date\n"; |