RT# 83450 - fixed rateplan export
[freeside.git] / FS / FS / part_export / sqlradius_withdomain.pm
1 package FS::part_export::sqlradius_withdomain;
2
3 use vars qw(@ISA %info);
4 use Tie::IxHash;
5 use FS::part_export::sqlradius;
6
7 tie my %options, 'Tie::IxHash', %FS::part_export::sqlradius::options;
8
9 $options{'strip_tld'} = { type  => 'checkbox',
10                           label => 'Strip TLD from realm names',
11                         };
12
13 %info = (
14   'svc'      => 'svc_acct',
15   'desc'     => 'Real-time export to SQL-backed RADIUS (FreeRADIUS, ICRADIUS) with realms',
16   'options'  => \%options,
17   'nodomain' => '',
18   'default_svc_class' => 'Internet',
19   'notes' => $FS::part_export::sqlradius::notes1.
20              'This export exports domains to RADIUS realms (see also '.
21              'sqlradius).  '.
22              $FS::part_export::sqlradius::notes2
23 );
24
25 @ISA = qw(FS::part_export::sqlradius);
26
27 sub export_username {
28   my($self, $svc_acct) = (shift, shift);
29   my $email = $svc_acct->email;
30   if ( $self->option('strip_tld') ) {
31     $email =~ s/\.\w+$//;
32   }
33   $email;
34 }
35
36 1;
37