[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 8c45cfb8fd6ad6216ce18f0ab69c9e4f48ee0a8c

Ivan ivan at 420.am
Sun Mar 4 18:35:39 PST 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  8c45cfb8fd6ad6216ce18f0ab69c9e4f48ee0a8c (commit)
      from  71d596e226c4bc1b6a2522edadb99c63b448e031 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8c45cfb8fd6ad6216ce18f0ab69c9e4f48ee0a8c
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Mar 4 18:35:38 2012 -0800

    add "Omit TLD from domains" option, RT#16751

diff --git a/FS/FS/part_export/netsapiens.pm b/FS/FS/part_export/netsapiens.pm
index 2869290..775e374 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 {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_export/netsapiens.pm |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list