[freeside-commits] branch master updated. e6cf968df114ffc735b1daf74f6259a81859c3f9

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


The branch, master has been updated
       via  e6cf968df114ffc735b1daf74f6259a81859c3f9 (commit)
      from  1388ec62da5eda6fe8b39eec31d61be30502e4ef (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 e6cf968df114ffc735b1daf74f6259a81859c3f9
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Jun 6 14:57:17 2015 -0700

    signup without a service

diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 4e2827c..8272b20 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -657,7 +657,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'} ) {
@@ -675,50 +674,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