diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-03-04 18:35:37 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-03-04 18:35:37 -0800 |
commit | abda8f1ecbf9161a3828e778aec5cb3762105475 (patch) | |
tree | 5836cbed967d4d93d02522f6882c804471740867 | |
parent | 0995724c15003c7c8a734c895c3044fa1af46506 (diff) |
add "Omit TLD from domains" option, RT#16751
-rw-r--r-- | FS/FS/part_export/netsapiens.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/part_export/netsapiens.pm b/FS/FS/part_export/netsapiens.pm index 286929069..775e374ca 100644 --- a/FS/FS/part_export/netsapiens.pm +++ b/FS/FS/part_export/netsapiens.pm @@ -41,6 +41,7 @@ tie my %options, 'Tie::IxHash', 'device_password' => { label=>'NetSapiens tac2 Device API password' }, 'device_url' => { label=>'NetSapiens tac2 Device URL' }, 'domain' => { label=>'NetSapiens Domain' }, + 'domain_no_tld' => { label=>'Omit TLD from domains', type=>'checkbox' }, 'debug' => { label=>'Enable debugging', type=>'checkbox' }, %subscriber_fields, %registrar_fields, @@ -105,7 +106,12 @@ sub _ns_command { sub ns_domain { my($self, $svc_phone) = (shift, shift); - $svc_phone->domain || $self->option('domain'); + my $domain = $svc_phone->domain || $self->option('domain'); + + $domain =~ s/\.\w{2,4}$// + if $self->option('domain_no_tld'); + + $domain; } sub ns_subscriber { |