X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fsqlradius_withdomain.pm;h=2af9e8d769d97645730aa4f1125d5214a8dedc40;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hp=1c8f38c9ddbfb3ba07ee2f6c33a7465bfd73e79d;hpb=c0567c688084e89fcd11bf82348b6c418f1254ac;p=freeside.git diff --git a/FS/FS/part_export/sqlradius_withdomain.pm b/FS/FS/part_export/sqlradius_withdomain.pm index 1c8f38c9d..2af9e8d76 100644 --- a/FS/FS/part_export/sqlradius_withdomain.pm +++ b/FS/FS/part_export/sqlradius_withdomain.pm @@ -1,12 +1,37 @@ package FS::part_export::sqlradius_withdomain; -use vars qw(@ISA); +use vars qw(@ISA %info); +use Tie::IxHash; use FS::part_export::sqlradius; +tie my %options, 'Tie::IxHash', %FS::part_export::sqlradius::options; + +$options{'strip_tld'} = { type => 'checkbox', + label => 'Strip TLD from realm names', + }; + +%info = ( + 'svc' => 'svc_acct', + 'desc' => 'Real-time export to SQL-backed RADIUS (FreeRADIUS, ICRADIUS) with realms', + 'options' => \%options, + 'nodomain' => '', + 'default_svc_class' => 'Internet', + 'notes' => $FS::part_export::sqlradius::notes1. + 'This export exports domains to RADIUS realms (see also '. + 'sqlradius). '. + $FS::part_export::sqlradius::notes2 +); + @ISA = qw(FS::part_export::sqlradius); sub export_username { my($self, $svc_acct) = (shift, shift); - $svc_acct->email; + my $email = $svc_acct->email; + if ( $self->option('strip_tld') ) { + $email =~ s/\.\w+$//; + } + $email; } +1; +