[freeside-commits] branch FREESIDE_4_BRANCH updated. 53d924408e0e8d772b984d817897933215ec2094
Ivan
ivan at 420.am
Sat Jun 6 14:57:28 PDT 2015
The branch, FREESIDE_4_BRANCH has been updated
via 53d924408e0e8d772b984d817897933215ec2094 (commit)
from aa5a298db560ebe2c57dc7cb010e0c2ad818c833 (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 53d924408e0e8d772b984d817897933215ec2094
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sat Jun 6 14:57:27 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