#!/usr/bin/perl -Tw
#
-# $Id: signup.cgi,v 1.20 2002-04-10 13:42:48 ivan Exp $
+# $Id: signup.cgi,v 1.23 2002-04-17 12:14:37 ivan Exp $
use strict;
use vars qw( @payby $cgi $locales $packages $pops $init_data $error
$country $zip $daytime $night $fax $invoicing_list $payby $payinfo
$paydate $payname $referral_custnum
$pkgpart $username $password $password2 $sec_phrase $popnum
+ $agentnum
$ieak_file $ieak_template $cck_file $cck_template
$signup_html $signup_template $success_html $success_template
$ac $exch $loc
$ieak_file = '/usr/local/freeside/ieak.template';
$cck_file = '/usr/local/freeside/cck.template';
-$signup_html = '/usr/local/freeside/signup.html';
-$success_html = '/usr/local/freeside/success.html';
+$signup_html = -e 'signup.html'
+ ? 'signup.html'
+ : '/usr/local/freeside/signup.html';
+$success_html = -e 'success.html'
+ ? 'success.html'
+ : '/usr/local/freeside/success.html';
if ( -e $ieak_file ) {
my $ieak_txt = Text::Template::_load_text($ieak_file)
'sec_phrase' => $sec_phrase = $cgi->param('sec_phrase'),
'_password' => $password = $cgi->param('_password'),
'popnum' => $popnum = $cgi->param('popnum'),
+ 'agentnum' => $agentnum = $cgi->param('agentnum'),
} );
}
or die "fatal: invalid email_name got past FS::SignupClient::new_customer";
my $email_name = $1;
- my $pop = pop_info($cgi->param('popnum'))
- or die "fatal: invalid popnum got past FS::SignupClient::new_customer";
- ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} );
+ my $pop = pop_info($cgi->param('popnum'));
+ #or die "fatal: invalid popnum got past FS::SignupClient::new_customer";
+ if ( $pop ) {
+ ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} );
+ } else {
+ ( $ac, $exch, $loc ) = ( '', '', ''); #presumably you're not using them.
+ }
my $pkg = ( grep { $_->{'pkgpart'} eq $pkgpart } @$packages )[0]->{'pkg'};