summaryrefslogtreecommitdiff
path: root/FS/FS/part_export/sqlradius_withdomain.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-07-31 14:00:14 -0700
committerIvan Kohler <ivan@freeside.biz>2012-07-31 14:00:14 -0700
commit6cce5ada4fbf1e9ad7debd0451336e8005c12195 (patch)
tree1aff6d44da7090ba280d84cb639db1c2b1330f47 /FS/FS/part_export/sqlradius_withdomain.pm
parentee8a023fff0a259b0c62b46b260a396805ad2f00 (diff)
add strip_tld option to sqlradius_withdomain export, RT#18718
Diffstat (limited to 'FS/FS/part_export/sqlradius_withdomain.pm')
-rw-r--r--FS/FS/part_export/sqlradius_withdomain.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/FS/FS/part_export/sqlradius_withdomain.pm b/FS/FS/part_export/sqlradius_withdomain.pm
index e5a7151..2af9e8d 100644
--- a/FS/FS/part_export/sqlradius_withdomain.pm
+++ b/FS/FS/part_export/sqlradius_withdomain.pm
@@ -6,11 +6,16 @@ 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). '.
@@ -21,7 +26,11 @@ tie my %options, 'Tie::IxHash', %FS::part_export::sqlradius::options;
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;