From 464d6da8fb57fe3e60e4c2c3cae6069bdafff6a5 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 24 Aug 1999 07:40:45 +0000 Subject: initial checkin of signup server --- fs_signup/FS-SignupClient/cgi/signup.cgi | 302 +++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100755 fs_signup/FS-SignupClient/cgi/signup.cgi (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi new file mode 100755 index 000000000..7131ad2e8 --- /dev/null +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -0,0 +1,302 @@ +#!/usr/bin/perl -Tw +# +# $Id: signup.cgi,v 1.1 1999-08-24 07:40:45 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 ); +use subs qw( print_form print_okay expselect ); + +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::SignupClient qw( signup_info new_customer ); + +#@payby = qw( CARD BILL COMP ); +#@payby = qw( CARD BILL ); +@payby = qw( CARD ); + +( $locales, $packages, $pops ) = signup_info(); + +$cgi = new CGI; + +if ( defined $cgi->param('magic') ) { + if ( $cgi->param('magic') eq 'process' ) { + + $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ + or die "Oops, illegal \"state\" param: ". $cgi->param('state'); + $state = $1; + $county = $3 || ''; + $country = $4; + + $payby = $cgi->param('payby'); + $payinfo = $cgi->param( $payby. '_payinfo' ); + $paydate = + $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ); + $payname = $cgi->param( $payby. '_payname' ); + + if ( $invoicing_list = $cgi->param('invoicing_list') ) { + $invoicing_list .= ', POST' if $cgi->param('invoicing_list_POST'); + } else { + $invoicing_list = 'POST'; + } + + ( $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'), + } ) ) + ? print_form() + : print_okay(); + } else { + die "unrecognized magic: ". $cgi->param('magic'); + } +} else { + $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 = ''; + + print_form; +} + +sub print_form { + + my $r = qq!*!; + my $self_url = $cgi->self_url; + + print $cgi->header( '-expires' => 'now' ), <ISP Signup form +ISP Signup form

+END + + print qq!Error: $error! if $error; + + print < + +Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${r}Contact name
(last, first)
, + SS#
Company
${r}Address
 
${r}City${r}State/Country${r}Zip
Day Phone
Night Phone
Fax
$r required fields
+
Billing information +!; + + print <
+END + + print qq!Postal mail invoice
Email invoice ', + qq!
Billing type
+ + +END + + my %payby = ( + 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!, + 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", "12-2037"). qq!
${r}Attention
!, + 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"), + ); + + my %paybychecked = ( + 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD", $paydate). qq!
${r}Name on card
!, + 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", $paydate). qq!
${r}Attention
!, + 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $paydate), + ); + + for (@payby) { + print qq!!; + } else { + print qq!> $payby{$_}!; + } + } + + print <
$paybychecked{$_}
$r required fields for each billing type +

First package + + + + + + + + + + + + + + + + +
Username
Password + (blank to generate)
POP
+

+ +END + +} + +sub print_okay { + print $cgi->header( '-expires' => 'now' ), <Signup successful +Signup successful

+blah blah blah + + +END +} + +sub expselect { + my $prefix = shift; + my $date = shift || ''; + my( $m, $y ) = ( 0, 0 ); + if ( $date =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #PostgreSQL date format + ( $m, $y ) = ( $2, $1 ); + } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { + ( $m, $y ) = ( $1, $3 ); + } + my $return = qq!!; + for ( 1999 .. 2037 ) { + $return .= " Date: Fri, 17 Dec 1999 12:03:03 +0000 Subject: beginning of IEAK support --- fs_signup/FS-SignupClient/cgi/signup.cgi | 80 ++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 3 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 7131ad2e8..15767c151 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,22 +1,34 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.1 1999-08-24 07:40:45 ivan Exp $ +# $Id: signup.cgi,v 1.2 1999-12-17 12:03:03 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 $pkgpart $username $password $popnum + $ieak_docroot $ieak_baseurl ); use subs qw( print_form print_okay expselect ); use CGI; use CGI::Carp qw(fatalsToBrowser); +use HTTP::Headers::UserAgent 2.00; use FS::SignupClient qw( signup_info new_customer ); +#acceptable payment methods +# #@payby = qw( CARD BILL COMP ); #@payby = qw( CARD BILL ); @payby = qw( CARD ); +#to enable ieak signups, you need to specify a directory in the web server's +#document space and the equivalent base URL +# +$ieak_docroot = "/var/www/sisd.420.am/freeside/ieak"; +$ieak_baseurl = "http://sisd.420.am/freeside/ieak"; + +#srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`); + ( $locales, $packages, $pops ) = signup_info(); $cgi = new CGI; @@ -265,13 +277,75 @@ END } sub print_okay { - print $cgi->header( '-expires' => 'now' ), <platform eq 'ia32' + && $user_agent->os =~ /^win/ + && ($user-agent->browser)[0] eq 'IE' + ) + { #send an IEAK config + my $username = $cgi->param('username'); + my $password = $cgi->param('_password'); + my $email_name = $cgi->param('first'). ' '. $cgi->param('last'); + my $ins_file = rand(4294967296). ".ins"; + open(INS_FILE, ">$ieak_docroot/$ins_file"); + print INS_FILE <redirect("$ieak_docroot/$ins_file"); + + } else { #send a simple confirmation + print $cgi->header( '-expires' => 'now' ), <Signup successful Signup successful

blah blah blah END + } } sub expselect { -- cgit v1.2.1 From b202e6a1fd3f2ef13f5bc8d77f44e2869083c494 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 28 Jan 2000 22:49:49 +0000 Subject: proper IEAK stuff --- fs_signup/FS-SignupClient/cgi/signup.cgi | 88 +++++++++++--------------------- 1 file changed, 30 insertions(+), 58 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 15767c151..6fccf11b1 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,19 +1,22 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.2 1999-12-17 12:03:03 ivan Exp $ +# $Id: signup.cgi,v 1.3 2000-01-28 22:49:49 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 - $ieak_docroot $ieak_baseurl ); + $ieak_file $ieak_template $ac $exch $loc + ); + #$ieak_docroot $ieak_baseurl use subs qw( print_form print_okay expselect ); use CGI; use CGI::Carp qw(fatalsToBrowser); use HTTP::Headers::UserAgent 2.00; use FS::SignupClient qw( signup_info new_customer ); +use Text::Template; #acceptable payment methods # @@ -21,11 +24,20 @@ use FS::SignupClient qw( signup_info new_customer ); #@payby = qw( CARD BILL ); @payby = qw( CARD ); -#to enable ieak signups, you need to specify a directory in the web server's -#document space and the equivalent base URL -# -$ieak_docroot = "/var/www/sisd.420.am/freeside/ieak"; -$ieak_baseurl = "http://sisd.420.am/freeside/ieak"; +$ieak_file = '/usr/local/freeside/ieak.template'; + +if ( -e $ieak_file ) { + $ieak_template = new Text::Template ( TYPE => 'FILE', SOURCE => $ieak_file ) + or die "Couldn't construct template: $Text::Template::ERROR"; +} else { + $ieak_template = ''; +} + +# #to enable ieak signups, you need to specify a directory in the web server's +# #document space and the equivalent base URL +# # +# $ieak_docroot = "/var/www/sisd.420.am/freeside/ieak"; +# $ieak_baseurl = "http://sisd.420.am/freeside/ieak"; #srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`); @@ -277,65 +289,25 @@ END } sub print_okay { - $user_agent = new HTTP::Headers::UserAgnet $ENV{HTTP_USER_AGENT}; - if ( defined($ieak_docroot) - && defined($ieak_baseurl) - && defined($ieak_secret) + my $user_agent = new HTTP::Headers::UserAgnet $ENV{HTTP_USER_AGENT}; + if ( $ieak_template && $user_agent->platform eq 'ia32' && $user_agent->os =~ /^win/ - && ($user-agent->browser)[0] eq 'IE' + && ($user_agent->browser)[0] eq 'IE' ) { #send an IEAK config my $username = $cgi->param('username'); my $password = $cgi->param('_password'); my $email_name = $cgi->param('first'). ' '. $cgi->param('last'); - my $ins_file = rand(4294967296). ".ins"; - open(INS_FILE, ">$ieak_docroot/$ins_file"); - print INS_FILE <redirect("$ieak_docroot/$ins_file"); + print $cgi->header('application/x-Internet-signup'), + $ieak_template->fill_in(); + +# my $ins_file = rand(4294967296). ".ins"; +# open(INS_FILE, ">$ieak_docroot/$ins_file"); +# print INS_FILE <redirect("$ieak_docroot/$ins_file"); } else { #send a simple confirmation print $cgi->header( '-expires' => 'now' ), < Date: Mon, 31 Jan 2000 05:22:23 +0000 Subject: prepaid "internet cards" --- fs_signup/FS-SignupClient/cgi/signup.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 6fccf11b1..961ad505a 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.3 2000-01-28 22:49:49 ivan Exp $ +# $Id: signup.cgi,v 1.4 2000-01-31 05:22:23 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $r $error @@ -22,7 +22,8 @@ use Text::Template; # #@payby = qw( CARD BILL COMP ); #@payby = qw( CARD BILL ); -@payby = qw( CARD ); +#@payby = qw( CARD ); +@payby = qw( CARD PREPAY ); $ieak_file = '/usr/local/freeside/ieak.template'; @@ -220,12 +221,14 @@ END 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!, 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", "12-2037"). qq!
${r}Attention
!, 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
${r}!, ); my %paybychecked = ( 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD", $paydate). qq!
${r}Name on card
!, 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", $paydate). qq!
${r}Attention
!, 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
${r}!, ); for (@payby) { -- cgit v1.2.1 From b812b5a4a664e0bd271392ae4a609b18e85ca6b6 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 2 Feb 2000 07:44:00 +0000 Subject: fix some bugs in signup server --- fs_signup/FS-SignupClient/cgi/signup.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 961ad505a..e5cf6d050 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.4 2000-01-31 05:22:23 ivan Exp $ +# $Id: signup.cgi,v 1.5 2000-02-02 07:44:00 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $r $error @@ -292,7 +292,7 @@ END } sub print_okay { - my $user_agent = new HTTP::Headers::UserAgnet $ENV{HTTP_USER_AGENT}; + my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT}; if ( $ieak_template && $user_agent->platform eq 'ia32' && $user_agent->os =~ /^win/ -- cgit v1.2.1 From ee2813f461f788e18c13bf0eabbf6bd242f51c2f Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 1 Mar 2000 08:14:30 +0000 Subject: cvs cruft --- fs_signup/FS-SignupClient/cgi/signup.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index e5cf6d050..48376c219 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.5 2000-02-02 07:44:00 ivan Exp $ +# $Id: signup.cgi,v 1.6 2000-03-01 08:14:30 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $r $error -- cgit v1.2.1 From 11df841f26fa4b5f6531109cbf0db87a376cfc3c Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 10 May 2000 23:57:57 +0000 Subject: Netscape CCK autoconfiguration support --- fs_signup/FS-SignupClient/cgi/signup.cgi | 67 ++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 21 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 48376c219..839ad333d 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,15 +1,15 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.6 2000-03-01 08:14:30 ivan Exp $ +# $Id: signup.cgi,v 1.7 2000-05-10 23:57:57 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 - $ieak_file $ieak_template $ac $exch $loc + $ieak_file $ieak_template $cck_file $cck_template + $ac $exch $loc ); - #$ieak_docroot $ieak_baseurl use subs qw( print_form print_okay expselect ); use CGI; @@ -26,6 +26,7 @@ use Text::Template; @payby = qw( CARD PREPAY ); $ieak_file = '/usr/local/freeside/ieak.template'; +$cck_file = '/usr/local/freeside/cck.template'; if ( -e $ieak_file ) { $ieak_template = new Text::Template ( TYPE => 'FILE', SOURCE => $ieak_file ) @@ -33,14 +34,12 @@ if ( -e $ieak_file ) { } else { $ieak_template = ''; } - -# #to enable ieak signups, you need to specify a directory in the web server's -# #document space and the equivalent base URL -# # -# $ieak_docroot = "/var/www/sisd.420.am/freeside/ieak"; -# $ieak_baseurl = "http://sisd.420.am/freeside/ieak"; - -#srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`); +if ( -e $cck_file ) { + $cck_template = new Text::Template ( TYPE => 'FILE', SOURCE => $cck_file ) + or die "Couldn't construct template: $Text::Template::ERROR"; +} else { + $cck_template = ''; +} ( $locales, $packages, $pops ) = signup_info(); @@ -293,24 +292,41 @@ END sub print_okay { my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT}; + + $cgi->param('username') =~ /^(.+)$/ + or die "fatal: invalid username got past FS::SignupClient::new_customer"; + my $username = $1; + $cgi->param('_password') =~ /^(.+)$/ + or die "fatal: invalid password got past FS::SignupClient::new_customer"; + my $password = $1; + ( $cgi->param('first'). ' '. $cgi->param('last') ) =~ /^(.*)$/ + 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"; + my ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} ); + if ( $ieak_template && $user_agent->platform eq 'ia32' && $user_agent->os =~ /^win/ && ($user_agent->browser)[0] eq 'IE' ) { #send an IEAK config - my $username = $cgi->param('username'); - my $password = $cgi->param('_password'); - my $email_name = $cgi->param('first'). ' '. $cgi->param('last'); - print $cgi->header('application/x-Internet-signup'), $ieak_template->fill_in(); - -# my $ins_file = rand(4294967296). ".ins"; -# open(INS_FILE, ">$ieak_docroot/$ins_file"); -# print INS_FILE <redirect("$ieak_docroot/$ins_file"); + } elsif ( $cck_template + && $user_agent->platform eq 'ia32' + && $user_agent->os =~ /^win/ + && ($user_agent->browser)[0] eq 'Netscape' + ) + { #send a Netscape config + my $cck_data = $cck_template->fill_in(); + print $cgi->header('application/x-netscape-autoconfigure-dialer-v2'), + map { + m/(.*)\s+(.*)$/; + pack("N", length($1)). $1. pack("N", length($2)). $2; + } split(/\n/, $cck_data); } else { #send a simple confirmation print $cgi->header( '-expires' => 'now' ), <{'popnum'} == $popnum ) { return $pop; } + } + ''; +} + sub expselect { my $prefix = shift; my $date = shift || ''; -- cgit v1.2.1 From f01fe96a27912381d4b30ccad3d355d74f76f505 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 24 Aug 2000 07:26:50 +0000 Subject: untaint template source --- fs_signup/FS-SignupClient/cgi/signup.cgi | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 839ad333d..7576b8b42 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.7 2000-05-10 23:57:57 ivan Exp $ +# $Id: signup.cgi,v 1.8 2000-08-24 07:26:50 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $r $error @@ -29,14 +29,22 @@ $ieak_file = '/usr/local/freeside/ieak.template'; $cck_file = '/usr/local/freeside/cck.template'; if ( -e $ieak_file ) { - $ieak_template = new Text::Template ( TYPE => 'FILE', SOURCE => $ieak_file ) - or die "Couldn't construct template: $Text::Template::ERROR"; + my $ieak_txt = Text::Template::_load_text($ieak_file) + or die $Text::Template::ERROR; + $ieak_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $ieak_txt = $1; + $ieak_template = new Text::Template ( TYPE => 'STRING', SOURCE => $ieak_txt ) + or die $Text::Template::ERROR; } else { $ieak_template = ''; } if ( -e $cck_file ) { - $cck_template = new Text::Template ( TYPE => 'FILE', SOURCE => $cck_file ) - or die "Couldn't construct template: $Text::Template::ERROR"; + my $cck_txt = Text::Template::_load_text($cck_file) + or die $Text::Template::ERROR; + $cck_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $cck_txt = $1; + $cck_template = new Text::Template ( TYPE => 'STRING', SOURCE => $cck_txt ) + or die $Text::Template::ERROR; } else { $cck_template = ''; } -- cgit v1.2.1 From 65dea21c4088a0dbf3e8863a6dadc39aed67d4db Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 3 Dec 2000 14:29:15 +0000 Subject: template bugfix from Jason Spence --- fs_signup/FS-SignupClient/cgi/signup.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 7576b8b42..a3fa9e788 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.8 2000-08-24 07:26:50 ivan Exp $ +# $Id: signup.cgi,v 1.9 2000-12-03 14:29:15 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $r $error @@ -313,7 +313,7 @@ sub print_okay { my $pop = pop_info($cgi->param('popnum')) or die "fatal: invalid popnum got past FS::SignupClient::new_customer"; - my ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} ); + ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} ); if ( $ieak_template && $user_agent->platform eq 'ia32' -- cgit v1.2.1 From 5e99168da38e7616fc726242ce7d85e140f22c6f Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 28 Aug 2001 16:58:08 +0000 Subject: customer-to-customer referrals in singup server --- fs_signup/FS-SignupClient/cgi/signup.cgi | 58 +++++++++++++++++--------------- 1 file changed, 31 insertions(+), 27 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index a3fa9e788..5d024a812 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,12 +1,13 @@ #!/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 ); @@ -15,7 +16,7 @@ use subs qw( print_form print_okay expselect ); 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 @@ -75,29 +76,30 @@ if ( defined $cgi->param('magic') ) { } ( $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(); @@ -129,13 +131,14 @@ if ( defined $cgi->param('magic') ) { $username = ''; $password = ''; $popnum = ''; - + $referral_custnum = $cgi->param('ref') || ''; print_form; } sub print_form { my $r = qq!*!; + $cgi->delete('ref'); my $self_url = $cgi->self_url; print $cgi->header( '-expires' => 'now' ), < + Contact Information -- cgit v1.2.1 From 294b8c0914f497b7714bad51dfb000d33e843995 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 30 Aug 2001 16:23:32 +0000 Subject: update signup server: template form and success html, document --- fs_signup/FS-SignupClient/cgi/signup.cgi | 382 ++++++++++++++++------------- fs_signup/FS-SignupClient/cgi/signup.html | 149 +++++++++++ fs_signup/FS-SignupClient/cgi/success.html | 4 + 3 files changed, 365 insertions(+), 170 deletions(-) create mode 100755 fs_signup/FS-SignupClient/cgi/signup.html create mode 100644 fs_signup/FS-SignupClient/cgi/success.html (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 5d024a812..0da960579 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,18 +1,19 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.10 2001-08-28 16:58:08 ivan Exp $ +# $Id: signup.cgi,v 1.11 2001-08-30 16:23:32 ivan Exp $ use strict; -use vars qw( @payby $cgi $locales $packages $pops $r $error +use vars qw( @payby $cgi $locales $packages $pops $error $last $first $ss $company $address1 $address2 $city $state $county $country $zip $daytime $night $fax $invoicing_list $payby $payinfo $paydate $payname $referral_custnum $pkgpart $username $password $popnum $ieak_file $ieak_template $cck_file $cck_template + $signup_html $signup_template $success_html $success_template $ac $exch $loc + $self_url ); -use subs qw( print_form print_okay expselect ); - +use subs qw( print_form print_okay expselect signup_default success_default ); use CGI; use CGI::Carp qw(fatalsToBrowser); use HTTP::Headers::UserAgent 2.00; @@ -28,6 +29,8 @@ use Text::Template; $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'; if ( -e $ieak_file ) { my $ieak_txt = Text::Template::_load_text($ieak_file) @@ -39,6 +42,7 @@ if ( -e $ieak_file ) { } else { $ieak_template = ''; } + if ( -e $cck_file ) { my $cck_txt = Text::Template::_load_text($cck_file) or die $Text::Template::ERROR; @@ -50,6 +54,42 @@ if ( -e $cck_file ) { $cck_template = ''; } +if ( -e $signup_html ) { + my $signup_txt = Text::Template::_load_text($signup_html) + or die $Text::Template::ERROR; + $signup_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $signup_txt = $1; + $signup_template = new Text::Template ( TYPE => 'STRING', + SOURCE => $signup_txt, + DELIMITERS => [ '<%=', '%>' ] + ) + or die $Text::Template::ERROR; +} else { + $signup_template = new Text::Template ( TYPE => 'STRING', + SOURCE => &signup_default, + DELIMITERS => [ '<%=', '%>' ] + ) + or die $Text::Template::ERROR; +} + +if ( -e $success_html ) { + my $success_txt = Text::Template::_load_text($signup_html) + or die $Text::Template::ERROR; + $success_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $success_txt = $1; + $success_template = new Text::Template ( TYPE => 'STRING', + SOURCE => $success_txt, + DELIMITERS => [ '<%=', '%>' ], + ) + or die $Text::Template::ERROR; +} else { + $success_template = new Text::Template ( TYPE => 'STRING', + SOURCE => &success_default, + DELIMITERS => [ '<%=', '%>' ], + ) + or die $Text::Template::ERROR; +} + ( $locales, $packages, $pops ) = signup_info(); $cgi = new CGI; @@ -137,168 +177,13 @@ if ( defined $cgi->param('magic') ) { sub print_form { - my $r = qq!*!; $cgi->delete('ref'); - my $self_url = $cgi->self_url; - - print $cgi->header( '-expires' => 'now' ), <ISP Signup form -ISP Signup form

-END - - print qq!Error: $error! if $error; - - print < - - -Contact Information -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
${r}Contact name
(last, first)
, - SS#
Company
${r}Address
 
${r}City${r}State/Country${r}Zip
Day Phone
Night Phone
Fax
$r required fields
-
Billing information -!; - - print <
-END - - print qq!Postal mail invoice
Email invoice ', - qq!
Billing type
- - -END - - my %payby = ( - 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD"). qq!
${r}Name on card
!, - 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", "12-2037"). qq!
${r}Attention
!, - 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP"), - 'PREPAY' => qq!Prepaid card
${r}!, - ); - - my %paybychecked = ( - 'CARD' => qq!Credit card
${r}
${r}Exp !. expselect("CARD", $paydate). qq!
${r}Name on card
!, - 'BILL' => qq!Billing
P.O.
${r}Exp !. expselect("BILL", $paydate). qq!
${r}Attention
!, - 'COMP' => qq!Complimentary
${r}Approved by
${r}Exp !. expselect("COMP", $paydate), - 'PREPAY' => qq!Prepaid card
${r}!, - ); - - for (@payby) { - print qq!!; - } else { - print qq!> $payby{$_}!; - } - } + $self_url = $cgi->self_url; - print <
$paybychecked{$_}
$r required fields for each billing type -

First package - - - - - - - - - - - - - - - - -
Username
Password - (blank to generate)
POP
-

- -END + print $cgi->header( '-expires' => 'now' ), + $signup_template->fill_in(); } @@ -341,13 +226,8 @@ sub print_okay { } split(/\n/, $cck_data); } else { #send a simple confirmation - print $cgi->header( '-expires' => 'now' ), <Signup successful -Signup successful

-blah blah blah - - -END + print $cgi->header( '-expires' => 'now' ), + $success_template->fill_in(); } } @@ -386,3 +266,165 @@ sub expselect { $return; } +sub success_default { #html to use if you don't specify a success file + <<'END'; +Signup successful +Signup successful

+Thanks for signing up! + +END +} + +sub signup_default { #html to use if you don't specify a template file + <<'END'; +ISP Signup form +ISP Signup form

+<%= $error %> +
+ + + +Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country*Zip
Day Phone
Night Phone
Fax
* required fields
+
Billing information + + +
+ + <%= + $OUT .= ' + + Postal mail invoice +
Email invoice +
Billing type
+ + + + <%= + my %payby = ( + 'CARD' => qq!Credit card
*
*Exp !. expselect("CARD"). qq!
*Name on card
!, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", "12-2037"). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
*!, + ); + + my %paybychecked = ( + 'CARD' => qq!Credit card
*
*Exp !. expselect("CARD", $paydate). qq!
*Name on card
!, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", $paydate). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
*!, + ); + + for (@payby) { + $OUT .= qq!!; + } else { + $OUT .= qq!> $payby{$_}!; + } + } + %> + +
$paybychecked{$_}
* required fields for each billing type +

First package + + + + + + + + + + + + + + + + +
Username
Password + (blank to generate)
POP
+

+
+END +} diff --git a/fs_signup/FS-SignupClient/cgi/signup.html b/fs_signup/FS-SignupClient/cgi/signup.html new file mode 100755 index 000000000..bc02db230 --- /dev/null +++ b/fs_signup/FS-SignupClient/cgi/signup.html @@ -0,0 +1,149 @@ +ISP Signup form +ISP Signup form

+<%= $error %> +
+ + + +Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country*Zip
Day Phone
Night Phone
Fax
* required fields
+
Billing information + + +
+ + <%= + $OUT .= ' + + Postal mail invoice +
Email invoice +
Billing type
+ + + + <%= + my %payby = ( + 'CARD' => qq!Credit card
*
*Exp !. expselect("CARD"). qq!
*Name on card
!, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", "12-2037"). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
*!, + ); + + my %paybychecked = ( + 'CARD' => qq!Credit card
*
*Exp !. expselect("CARD", $paydate). qq!
*Name on card
!, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", $paydate). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
*!, + ); + + for (@payby) { + $OUT .= qq!!; + } else { + $OUT .= qq!> $payby{$_}!; + } + } + %> + +
$paybychecked{$_}
* required fields for each billing type +

First package + + + + + + + + + + + + + + + + +
Username
Password + (blank to generate)
POP
+

+
diff --git a/fs_signup/FS-SignupClient/cgi/success.html b/fs_signup/FS-SignupClient/cgi/success.html new file mode 100644 index 000000000..6bc2d1fd7 --- /dev/null +++ b/fs_signup/FS-SignupClient/cgi/success.html @@ -0,0 +1,4 @@ +Signup successful +Signup successful

+Thanks for signing up! + -- cgit v1.2.1 From fa0a72bfd08ec131523df6c40da96296ddadbb30 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 11:03:06 +0000 Subject: missing quote in new template --- fs_signup/FS-SignupClient/cgi/signup.cgi | 4 ++-- fs_signup/FS-SignupClient/cgi/signup.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'fs_signup/FS-SignupClient/cgi') diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index 0da960579..4ed5bf7d9 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.11 2001-08-30 16:23:32 ivan Exp $ +# $Id: signup.cgi,v 1.12 2001-09-11 11:03:06 ivan Exp $ use strict; use vars qw( @payby $cgi $locales $packages $pops $error @@ -414,7 +414,7 @@ Contact Information <%= foreach my $pop ( @{$pops} ) { - $OUT .= '