diff options
author | ivan <ivan> | 2005-11-28 16:21:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-11-28 16:21:50 +0000 |
commit | f8057cbccbb028ad33891e8c735cb4f40cf54b2d (patch) | |
tree | d41aaec2b687af0e030fa70d45a0380ce921e38e /FS/FS/cust_svc.pm | |
parent | afab30d6058351d2ca875b089424b7a1323992a4 (diff) |
update cust_svc::seconds_since_sqlradacct to deal with any usage-capable export
Diffstat (limited to 'FS/FS/cust_svc.pm')
-rw-r--r-- | FS/FS/cust_svc.pm | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index e69befca2..ecb3e725a 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -410,14 +410,7 @@ sub seconds_since_sqlradacct { $str2time = 'extract(epoch from '; } - my $username; - if ( $part_export->exporttype eq 'sqlradius' ) { - $username = $svc_x->username; - } elsif ( $part_export->exporttype eq 'sqlradius_withdomain' ) { - $username = $svc_x->email; - } else { - die 'unknown exporttype '. $part_export->exporttype; - } + my $username = $part_export->export_username($svc_x); my $query; @@ -567,11 +560,8 @@ sub get_session_history { #$attrib ??? - #my @part_export = $cust_svc->part_svc->part_export->can('usage_sessions'); - my @part_export = $self->part_svc->part_export('sqlradius'); - push @part_export, $self->part_svc->part_export('sqlradius_withdomain'); - die "no sqlradius or sqlradius_withdomain export configured for this". - "service type" + my @part_export = $self->part_svc->part_export_usage; + die "no accounting-capable exports are enabled for this service definition" unless @part_export; #or return undef; |