From b202e6a1fd3f2ef13f5bc8d77f44e2869083c494 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 28 Jan 2000 22:49:49 +0000 Subject: [PATCH] proper IEAK stuff --- fs_signup/FS-SignupClient/cgi/signup.cgi | 88 +++++++++++--------------------- 1 file changed, 30 insertions(+), 58 deletions(-) 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' ), <