[freeside-commits] branch FREESIDE_3_BRANCH updated. b1cfcb4b7edeff225f746837684e7ff956aafefd

Ivan ivan at 420.am
Sat Jun 6 14:57:33 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  b1cfcb4b7edeff225f746837684e7ff956aafefd (commit)
      from  3b7ae729e52eb04e5d9974f0c635998a7e9176ff (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 b1cfcb4b7edeff225f746837684e7ff956aafefd
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Jun 6 14:57:32 2015 -0700

    signup without a service

diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 67d11dc..547f230 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -667,7 +667,6 @@ sub new_customer {
   my $part_pkg =
     qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } )
       or return { 'error' => "WARNING: unknown pkgpart: $pkgpart" };
-  my $svcpart = $part_pkg->svcpart($svc_x);
 
   my $reg_code = '';
   if ( $packet->{'reg_code'} ) {
@@ -685,50 +684,55 @@ sub new_customer {
   #my $error = $cust_pkg->check;
   #return { 'error' => $error } if $error;
 
-  #should be all auto-magic and shit
   my @svc = ();
-  if ( $svc_x eq 'svc_acct' ) {
-
-    my $svc = new FS::svc_acct {
-      'svcpart'   => $svcpart,
-      map { $_ => $packet->{$_} }
-        qw( username _password sec_phrase popnum domsvc ),
-    };
+  unless ( $svc_x eq 'none' ) {
 
-    my @acct_snarf;
-    my $snarfnum = 1;
-    while (    exists($packet->{"snarf_machine$snarfnum"})
-            && length($packet->{"snarf_machine$snarfnum"}) ) {
-      my $acct_snarf = new FS::acct_snarf ( {
-        'machine'   => $packet->{"snarf_machine$snarfnum"},
-        'protocol'  => $packet->{"snarf_protocol$snarfnum"},
-        'username'  => $packet->{"snarf_username$snarfnum"},
-        '_password' => $packet->{"snarf_password$snarfnum"},
-      } );
-      $snarfnum++;
-      push @acct_snarf, $acct_snarf;
-    }
-    $svc->child_objects( \@acct_snarf );
-    push @svc, $svc;
+    my $svcpart = $part_pkg->svcpart($svc_x);
+    #should be all auto-magic and shit
+    if ( $svc_x eq 'svc_acct' ) {
 
-  } elsif ( $svc_x eq 'svc_phone' ) {
+      my $svc = new FS::svc_acct {
+        'svcpart'   => $svcpart,
+        map { $_ => $packet->{$_} }
+          qw( username _password sec_phrase popnum domsvc ),
+      };
 
-    push @svc, new FS::svc_phone ( {
-      'svcpart' => $svcpart,
-       map { $_ => $packet->{$_} }
-         qw( countrycode phonenum sip_password pin ),
-    } );
+      my @acct_snarf;
+      my $snarfnum = 1;
+      while (    exists($packet->{"snarf_machine$snarfnum"})
+              && length($packet->{"snarf_machine$snarfnum"}) ) {
+        my $acct_snarf = new FS::acct_snarf ( {
+          'machine'   => $packet->{"snarf_machine$snarfnum"},
+          'protocol'  => $packet->{"snarf_protocol$snarfnum"},
+          'username'  => $packet->{"snarf_username$snarfnum"},
+          '_password' => $packet->{"snarf_password$snarfnum"},
+        } );
+        $snarfnum++;
+        push @acct_snarf, $acct_snarf;
+      }
+      $svc->child_objects( \@acct_snarf );
+      push @svc, $svc;
 
-  } elsif ( $svc_x eq 'svc_pbx' ) {
+    } elsif ( $svc_x eq 'svc_phone' ) {
 
-    push @svc, new FS::svc_pbx ( {
+      push @svc, new FS::svc_phone ( {
         'svcpart' => $svcpart,
-        map { $_ => $packet->{$_} } 
-          qw( id title ),
-        } );
+         map { $_ => $packet->{$_} }
+           qw( countrycode phonenum sip_password pin ),
+      } );
+
+    } elsif ( $svc_x eq 'svc_pbx' ) {
+
+      push @svc, new FS::svc_pbx ( {
+          'svcpart' => $svcpart,
+          map { $_ => $packet->{$_} } 
+            qw( id title ),
+          } );
   
-  } else {
-    die "unknown signup service $svc_x";
+    } else {
+      die "unknown signup service $svc_x";
+    }
+
   }
 
   if ($packet->{'mac_addr'} && $conf->exists('signup_server-mac_addr_svcparts'))

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

Summary of changes:
 FS/FS/ClientAPI/Signup.pm |   78 ++++++++++++++++++++++++---------------------
 1 file changed, 41 insertions(+), 37 deletions(-)




More information about the freeside-commits mailing list