use FileHandle;
use IO::Handle;
-$VERSION = '0.01';
+$VERSION = '0.02';
@ISA = qw( Exporter );
@EXPORT_OK = qw( signup_info new_customer );
( $locales, $packages, $pops ) = signup_info;
$error = new_customer ( {
- 'first' => $first,
- 'last' => $last,
- 'ss' => $ss,
- 'comapny' => $company,
- 'address1' => $address1,
- 'address2' => $address2,
- 'city' => $city,
- 'county' => $county,
- 'state' => $state,
- 'zip' => $zip,
- 'country' => $country,
- 'daytime' => $daytime,
- 'night' => $night,
- 'fax' => $fax,
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paydate' => $paydate,
- 'payname' => $payname,
- 'invoicing_list' => $invoicing_list,
- 'pkgpart' => $pkgpart,
- 'username' => $username,
- '_password' => $password,
- 'popnum' => $popnum,
+ 'first' => $first,
+ 'last' => $last,
+ 'ss' => $ss,
+ 'comapny' => $company,
+ 'address1' => $address1,
+ 'address2' => $address2,
+ 'city' => $city,
+ 'county' => $county,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'country' => $country,
+ 'daytime' => $daytime,
+ 'night' => $night,
+ 'fax' => $fax,
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paydate' => $paydate,
+ 'payname' => $payname,
+ 'invoicing_list' => $invoicing_list,
+ 'referral_custnum' => $referral_custnum,
+ 'pkgpart' => $pkgpart,
+ 'username' => $username,
+ '_password' => $password,
+ 'popnum' => $popnum,
} );
=head1 DESCRIPTION
paydate
payname
invoicing_list
+ referral_custnum
pkgpart
username
_password
sub new_customer {
my $hashref = shift;
+ #things that aren't necessary in base class, but are for signup server
+ return "Empty password" unless $hashref->{'_password'};
+ return "No POP selected" unless $hashref->{'popnum'};
+
socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
connect(SOCK, sockaddr_un($fs_signupd_socket)) or die "connect: $!";
print SOCK "new_customer\n";
print SOCK join("\n", map { $hashref->{$_} } qw(
first last ss company address1 address2 city county state zip country
daytime night fax payby payinfo paydate payname invoicing_list
- pkgpart username _password popnum
+ referral_custnum pkgpart username _password popnum
) ), "\n";
SOCK->flush;
=back
-=head1 VERSION
-
-$Id: SignupClient.pm,v 1.3 2000-02-02 07:44:00 ivan Exp $
-
=head1 BUGS
=head1 SEE ALSO
#!/usr/bin/perl -Tw
#
-# $Id: signup.cgi,v 1.9 2000-12-03 14:29:15 ivan Exp $
+# $Id: signup.cgi,v 1.10 2001-08-28 16:58:08 ivan Exp $
use strict;
use vars qw( @payby $cgi $locales $packages $pops $r $error
$last $first $ss $company $address1 $address2 $city $state $county
$country $zip $daytime $night $fax $invoicing_list $payby $payinfo
- $paydate $payname $pkgpart $username $password $popnum
+ $paydate $payname $referral_custnum
+ $pkgpart $username $password $popnum
$ieak_file $ieak_template $cck_file $cck_template
$ac $exch $loc
);
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use HTTP::Headers::UserAgent 2.00;
-use FS::SignupClient qw( signup_info new_customer );
+use FS::SignupClient 0.02 qw( signup_info new_customer );
use Text::Template;
#acceptable payment methods
}
( $error = new_customer ( {
- 'last' => $last = $cgi->param('last'),
- 'first' => $first = $cgi->param('first'),
- 'ss' => $ss = $cgi->param('ss'),
- 'company' => $company = $cgi->param('company'),
- 'address1' => $address1 = $cgi->param('address1'),
- 'address2' => $address2 = $cgi->param('address2'),
- 'city' => $city = $cgi->param('city'),
- 'county' => $county,
- 'state' => $state,
- 'zip' => $zip = $cgi->param('zip'),
- 'country' => $country,
- 'daytime' => $daytime = $cgi->param('daytime'),
- 'night' => $night = $cgi->param('night'),
- 'fax' => $fax = $cgi->param('fax'),
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paydate' => $paydate,
- 'payname' => $payname,
- 'invoicing_list' => $invoicing_list,
- 'pkgpart' => $pkgpart = $cgi->param('pkgpart'),
- 'username' => $username = $cgi->param('username'),
- '_password' => $password = $cgi->param('_password'),
- 'popnum' => $popnum = $cgi->param('popnum'),
+ 'last' => $last = $cgi->param('last'),
+ 'first' => $first = $cgi->param('first'),
+ 'ss' => $ss = $cgi->param('ss'),
+ 'company' => $company = $cgi->param('company'),
+ 'address1' => $address1 = $cgi->param('address1'),
+ 'address2' => $address2 = $cgi->param('address2'),
+ 'city' => $city = $cgi->param('city'),
+ 'county' => $county,
+ 'state' => $state,
+ 'zip' => $zip = $cgi->param('zip'),
+ 'country' => $country,
+ 'daytime' => $daytime = $cgi->param('daytime'),
+ 'night' => $night = $cgi->param('night'),
+ 'fax' => $fax = $cgi->param('fax'),
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paydate' => $paydate,
+ 'payname' => $payname,
+ 'invoicing_list' => $invoicing_list,
+ 'referral_custnum' => $referral_custnum = $cgi->param('ref'),
+ 'pkgpart' => $pkgpart = $cgi->param('pkgpart'),
+ 'username' => $username = $cgi->param('username'),
+ '_password' => $password = $cgi->param('_password'),
+ 'popnum' => $popnum = $cgi->param('popnum'),
} ) )
? print_form()
: print_okay();
$username = '';
$password = '';
$popnum = '';
-
+ $referral_custnum = $cgi->param('ref') || '';
print_form;
}
sub print_form {
my $r = qq!<font color="#ff0000">*</font>!;
+ $cgi->delete('ref');
my $self_url = $cgi->self_url;
print $cgi->header( '-expires' => 'now' ), <<END;
print <<END;
<FORM ACTION="$self_url" METHOD=POST>
<INPUT TYPE="hidden" NAME="magic" VALUE="process">
+<INPUT TYPE="hidden" NAME="ref" VALUE="$referral_custnum">
Contact Information
<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
<TR>
my(
$first, $last, $ss, $company, $address1, $address2, $city, $county,
$state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
- $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
- $popnum,
- ) = map { scalar(<Client>) } ( 1 .. 23 );
+ $paydate, $payname, $invoicing_list, $referral_custnum,
+ $pkgpart, $username, $password, $popnum,
+ ) = map { scalar(<Client>) } ( 1 .. 24 );
warn "[fs_signupd] sending customer data to remote server...\n" if $Debug;
print
$first, $last, $ss, $company, $address1, $address2, $city, $county,
$state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
- $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
- $popnum,
+ $paydate, $payname, $invoicing_list, $referral_custnum,
+ $pkgpart, $username, $password, $popnum,
;
warn "[fs_signupd] reading error from remote server...\n" if $Debug;
chop( my(
$first, $last, $ss, $company, $address1, $address2, $city, $county,
$state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
- $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
- $popnum,
- ) = map { scalar(<$reader>) } ( 1 .. 23 ) );
+ $paydate, $payname, $invoicing_list, $referral_custnum,
+ $pkgpart, $username, $password, $popnum,
+ ) = map { scalar(<$reader>) } ( 1 .. 24 ) );
warn "[fs_signup_server] Processing signup...\n" if $Debug;
#shares some stuff with htdocs/edit/process/cust_main.cgi... take any
# common that are still here and library them.
my $cust_main = new FS::cust_main ( {
- 'custnum' => '',
- 'agentnum' => $agentnum,
- 'refnum' => $refnum,
- 'last' => $last,
- 'first' => $first,
- 'ss' => $ss,
- 'company' => $company,
- 'address1' => $address1,
- 'address2' => $address2,
- 'city' => $city,
- 'county' => $county,
- 'state' => $state,
- 'zip' => $zip,
- 'country' => $country,
- 'daytime' => $daytime,
- 'night' => $night,
- 'fax' => $fax,
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paydate' => $paydate,
- 'payname' => $payname,
+ 'custnum' => '',
+ 'agentnum' => $agentnum,
+ 'refnum' => $refnum,
+ 'last' => $last,
+ 'first' => $first,
+ 'ss' => $ss,
+ 'company' => $company,
+ 'address1' => $address1,
+ 'address2' => $address2,
+ 'city' => $city,
+ 'county' => $county,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'country' => $country,
+ 'daytime' => $daytime,
+ 'night' => $night,
+ 'fax' => $fax,
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paydate' => $paydate,
+ 'payname' => $payname,
+ 'referral_custnum' => $referral_custnum,
} );
$error = "Illegal payment type" unless grep { $_ eq $payby } @payby;
<ul>
<li>Add the user `freeside' to the the external machine.
<li>Copy or symlink fs_signup/FS-SignupClient/cgi/signup.cgi into the web server's document space.
+ <li>When linking to signup.cgi, you can include a referring custnum in the URL as follows: <code>http://public.web.server/path/signup.cgi?ref=1542</code>
<li>Enable CGI execution for files with the `.cgi' extension. (with <a href="http://www.apache.org/docs/mod/mod_mime.html#addhandler">Apache</a>)
<li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user).
<li>touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket
<pre>
ALTER TABLE cust_main ADD COLUMN comments varchar NULL;
</pre>
+ <li>If you are using the signup server, reinstall it according to the <a href="signup.html">instructions</a>. The 1.3.x signup server is not compatible with 1.4.x.
<li>Run bin/dbdef-create.
<li>create a service based on svc_forward
<li>Run bin/fs-migrate-svc_acct_sm
<%
-#<!-- $Id: cust_main.cgi,v 1.3 2001-08-28 14:34:14 ivan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.4 2001-08-28 16:58:08 ivan Exp $ -->
use strict;
#use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
END
print ' <SELECT NAME="referral_depth" SIZE="1" onChange="changed(this)">';
my $max = 8; #config file
- $cgi->param('referral_depth') =~ /^(\d+)$/
+ $cgi->param('referral_depth') =~ /^(\d*)$/
or eidiot "Illegal referral_depth";
my $referral_depth = $1;