#!/usr/local/bin/perl -w use CGI::Carp qw(fatalsToBrowser carpout); use strict; # Version 13.4 - December 20, 2004 - OFFLINE SCRIPT. my $stype = "OFFLINE SCRIPT"; my $version = "13.4"; # UPDATE in 13.X # Upgrade in Tracking Script. This version will no longer work with the old method of our # tracking script. Please see http://backroom.safepages.com/utilities/instant/tracking/ # for details. Also, added areacode & state check to prevent a user from filling out the # form and getting an error because there is no number available to them. Version 13.1 closes # the option tags, this fixes errors in some browsers. Version 13.2 fixes the display of # some numbers as supporting dual channel ISDN when they do not. # Version 13.3 Added OS, header and footer file names to the top, changed output of the order # form results to show software download for only windows clients and a message saying to call # tech if they select mac. Added ISPWizard header footer, so you can lock down the page for # ISPWizard orders so they can't surf to other parts of your website, using a customized # header and footer file for those ISPWizard orders. Added IP tracking message to button of # the script to try and scare away fraudulent orders. Version 13.4 Script now automatically # knows if you are running email on our servers and if so, puts the email username in the # correct format for our servers. # Your Hosting server must have installed; # a- Perl v5.6.0 or higher # b- OpenSSL v0.9.6d or higher, http://www.openssl.org. # c- Net::SSLeay module # d- Net::SMTP - part of the libnet package. # e- CGI::Carp (optional - helps you debug your script) # f- LWP::ParallelUserAgent module # g- isd files must have a mime type of "application/x-internet-signup-data" # ************************************************************************* # The test CC Number for testing this script is # 41111111111111111 better known as 4 and fifteen 1's. # YOUR INFORMATION # for more information about each of these fields. # Please see the backroom. my $yourid = 'wns'; my $yourpass = '3435024'; # We recommend that you setup a seperate employee for script access and deny # them all other pages besides the the script access. We do not recommend # running the script as your administrative account unless you are the only # one who will ever have acess to it. You can setup employee access in the # "ISP Settings" section of our backroom. my $companyname = 'netphd.net'; my $email = 'billing@netphd.net'; my $emaildomain = 'netphd.net'; my $ftpdomain = 'netphd.net'; my $pop = 'mail.netphd.net'; my $smtp = 'mail.netphd.net'; my $news = 'news.netphd.net'; my $ftp = 'ftp.netphd.net'; # USERNAME FORMATS my $ftpusernameformat = '[username]@[domain]'; my $emailusernameformat = '[username]'; my $ftplocationformat = 'http://members.safepages.com/[username]@[domain]/'; my $techphone = '1-877-995-SURF (7873)'; my $billphone = '1-877-995-SURF (7873)'; my $ccbillingname = 'netphd.net.'; my $smtpserver = 'mail.netphd.net'; my $batchfilename = '10271963batch.txt'; my $batchblock = 'yes'; my $prorate = 'yes'; my $doyouacceptamex = 'yes'; my $doyouacceptdiscover = 'yes'; # OPTIONAL SETTINGS. my $adddatatobackroom = "yes"; # options = yes, no my $askforreferer = "no"; # options = yes, no my $refererboxname = "Referral Code"; my $autolaunchsoftware = "no"; # options = yes, no # ADDONS FOR UPSELL (AS A CHECKBOX) my $offerwebaccel = "yes"; # options = yes, no my $webaccelprice = '5.00'; my $webacceldownloadlink = 'http://www.netphd.net/web_accel.exe'; my $offerspamfilter = "yes"; # options = yes, no my $spamfilterprice = '1.00'; # CALLFINDER SETTINGS. my $ShowHourlyLimits = 'yes'; # options = yes, no my $ShowRealms = 'no'; # options = yes, no my $ShowNetworkName = 'no'; # options = yes, no my %NetworkName; $NetworkName{"surf.net"} = 'te'; # Telia Network $NetworkName{"world.net"} = 'uu'; # UU.net Network $NetworkName{"pop.net"} = 'qw'; # Qwest Network $NetworkName{"usa"} = 'st'; # Starnet Network $NetworkName{"safeusa"} = 'fi'; # Filtered Network $NetworkName{"staticusa"} = 'ip'; # Static IP Network # TERMS OF SERVICE OPTIONS. my $termsfile = 'license.txt'; my $declinedurl = "http://www.${emaildomain}/"; # DEFINE YOUR PRODUCT OFFERINGS my %product; # EXAMPLE - PRODUCT NUMBER 1 $product{"1.realms"} = 'netphd.net'; $product{"1.monthlyfee"} = '9.95'; $product{"1.setupfee"} = '0.00'; $product{"1.description"} = 'Home 56K w/ Email & Webspace'; $product{"1.numofemails"} = '0'; # any value between 0-5 $product{"1.numofftps"} = '0'; # any value between 0-5, cannot be greater than numofemails $product{"1.ShowTheDialupPrefix"} = 'yes'; $product{"1.ShowTheDialupRealm"} = 'yes'; $product{"1.SoftwareLink"} = ''; $product{"1.webaccel"} = 'no'; # options = yes, no $product{"1.spamfilter"} = 'no'; # options = yes, no $product{"1.isdnonlyproduct"} = 'no'; # options = yes, no # EXAMPLE - PRODUCT NUMBER 2 $product{"2.realms"} = 'netphd.net'; $product{"2.monthlyfee"} = '4.95'; $product{"2.setupfee"} = '0.00'; $product{"2.description"} = 'E-Plan'; $product{"2.numofemails"} = '0'; # any value between 0-5 $product{"2.numofftps"} = '0'; # any value between 0-5, cannot be greater than numofemails $product{"2.ShowTheDialupPrefix"} = 'yes'; $product{"2.ShowTheDialupRealm"} = 'yes'; $product{"2.SoftwareLink"} = ''; $product{"2.webaccel"} = 'no'; # options = yes, no $product{"2.spamfilter"} = 'no'; # options = yes, no $product{"2.isdnonlyproduct"} = 'no'; # options = yes, no # HEADER / FOOTER FILES my $head = './head.tmpl'; # Top half of the HTML code. my $foot = './foot.tmpl'; # Bottom half of your HTML code. my $head_ispwizard = './head.tmpl'; # For ISPWizard rquests you will want a locked down version of my $foot_ispwizard = './foot.tmpl'; # your header and footer so they can't surf your whole website. ############################################################### # DO NOT EDIT BELOW HERE IF YOU DON'T KNOW WHAT YOU ARE DOING # ############################################################### # Define the Perl Modules: use CGI qw(:standard); use Net::SMTP; use MIME::Base64; use HTTP::Request; use HTTP::Status; my ($sec,$min,$hour,$day,$mon,$year,$x) = (localtime(time))[0,1,2,3,4,5,6]; $year =~ s/^1//; $mon = $mon + 1; if ($sec !~ /[0-9][0-9]/) { $sec = "0" . $sec; } if ($min !~ /[0-9][0-9]/) { $min = "0" . $min; } if ($hour !~ /[0-9][0-9]/) { $hour = "0" . $hour; } if ($day !~ /[0-9][0-9]/) { $day = "0" . $day; } if ($mon !~ /[0-9][0-9]/) { $mon = "0" . $mon; } my $invoicenum = $year . $mon . $day . $hour . $min . $sec; my ($nmonth,$fmonth); my @month = ('','Jan','Feb','Mar','Apr','May','June','July','Aug','Sept','Oct','Nov','Dec','Jan'); if ($day < 26) { $nmonth = $month[$mon]; $fmonth = $month[$mon+1]; } else { $nmonth = $month[$mon+1]; $fmonth = $month[$mon+2]; } #################################################################### # FORM CHECK, THIS WILL CHECK ALL THE FIELDS SUBMITTED ON THE FORM # #################################################################### my $SCRIPTURL = $ENV{'SCRIPT_NAME'}; my %param = map { $_, param($_) } param(); if (!($param{'termsvalue'})) { $param{'termsvalue'} = ''; } ################################################################## ## THIS DETERMINES THE PAGE FLOW OF THE SIGNUP SCRIPT ############ ################################################################## if ($param{'termsvalue'} eq 'I Decline') { print "Location: ${declinedurl}\n\n"; exit; } print "Content-type: text/html\n\n"; &printHeader; if ($param{'version'}) { print "Special Output:
"; print "$stype - Version # $version\n"; &printFooter; exit; } mkdir("./tmp",0755); my $touch = "/usr/bin/touch"; if (-e "/bin/touch") { $touch = "/bin/touch"; } system("${touch} ./tmp/index.html"); if (!(-e "./tmp/index.html")) { &error('cannot create tmp directory'); } my $i = 0; my $totalproducts = 0; while (1) { if ($i == 10) { last; } my $err1 = 'cannot have web accel offered as both a checkbox and part of a product'; my $err2 = 'cannot have spam filtering offered as both a checkbox and part of a product'; my $err3 = 'webacceldownloadlink must be filled in with the url to the download'; if (($product{"$i.webaccel"} =~ /y/) && ($offerwebaccel =~ /y/)) { &error("$err1"); } if (($product{"$i.spamfilter"} =~ /y/) && ($offerspamfilter =~ /y/)) { &error("$err2"); } if (($product{"$i.webaccel"} =~ /y/) && (!$webacceldownloadlink)) { &error("$err3"); } if ($product{"$i.realms"}) { $totalproducts++; } $i++; } if (!($param{'go'})) { if (-e "${termsfile}") { &ShowLicenseForm; } else { &ShowCallFinder; } } my $num = $param{'product_num'}; if ($param{'go'} eq "1") { &ShowCallFinder; } if (($product{"$num.realms"} =~ /safeusa/) && ($param{'addwebaccel'})) { &error('web acceleration not available with filtered access'); } if ($param{'addwebaccel'}) { $product{"$num.monthlyfee"} += $webaccelprice; } if (!($product{"$num.numofemails"} >= 1)) { $param{'addspamfilter'} = 0; } if ($param{'addspamfilter'}) { $product{"$num.monthlyfee"} += $spamfilterprice; } $product{"$num.monthlyfee"} = sprintf("%0.2f", $product{"$num.monthlyfee"}); if ($param{'go'} eq "2") { if ($num =~ /select/) { &error("service plan not selected"); } if (($param{'npa'} eq '') && ($param{'state'} eq '')) { &error('areacode or state required'); } &ShowOrderForm; } ################################################################## if ($product{"$num.webaccel"} =~ /y/) { $param{'addwebaccel'} = 1; } if ($product{"$num.spamfilter"} =~ /y/) { $param{'addspamfilter'} = 1; } $param{'address'} =~ s/\.|#//g; $param{'card_num'} =~ s/\D//g; $param{'exp_date'} =~ s/\D//g; $param{'username'} =~ tr/A-Z/a-z/; $param{'username'} =~ s/\s//g; $param{'emailuser1'} = $param{'username'}; $param{'emailuser2'} =~ tr/A-Z/a-z/; $param{'emailuser3'} =~ tr/A-Z/a-z/; $param{'emailuser4'} =~ tr/A-Z/a-z/; $param{'emailuser5'} =~ tr/A-Z/a-z/; my @required = ('exp_date','product_num','first_name','last_name','address','city', 'state','zipcode','username','password','card_num','phone','number'); foreach my $attribute (@required) { if ($param{"$attribute"} eq '') { &error("${attribute} not filled in."); } } if ($param{'username'} !~ /^[a-z]\w+$/) { &error('Username Problem. Usernames only support ' . 'lowercase letters and numbers and must begin with a letter'); } if ($param{'number'} eq 'select a number') { &error('number not selected, you must select a number to continue'); } $param{'number'} =~ /^(\S+)\.(\d+)\.(\d+)$/; my ($number,$accesslist) = ($2, $3); if ($batchblock =~ /y/i) { open(BATCH, "${batchfilename}"); while () { if (/$param{'card_num'}/) { &error('CC already in database. Your account has already been ' . 'activated and credit card charged. Please check your email account ' . 'for your setup information or contact us if you are having a problem'); } } close BATCH; } if (($param{'card_num'} =~ /^3/) && ($doyouacceptamex =~ /n/i)) { &error('This type of CC is not accepted'); } if (($param{'card_num'} =~ /^6/) && ($doyouacceptdiscover =~ /n/i)) { &error('This type of CC is not accepted'); } #################################################################### # INITIALIZE SOME GLOBAL VARIABLES my ($charge,$firstmonth); my ($form_data, $form_headers); my ($DialupLogin,$OriginalLogin,$SoftwareLink,$MailOnOurServers); my ($dialuplogin,$dialuppass,$accountnum); my ($testrequest,$transid); #################################################################### if ($param{'card_num'} =~ /^41{15}$/) { $testrequest = "TRUE"; } &prorate_charge_amount; &SetFormValues; &setupaccount; &build_batch; if ($param{'ispwizard'}) { &response_ispwizard; } else { &response; } &sendmailtouser; &sendmailtoyourself; exit; ######## BELOW HERE IS ALL SUBROUTINES ######### sub prorate_charge_amount { $charge = $product{"$num.monthlyfee"}; if ($prorate =~ /y/i) { my @monthdays = ('31','29','31','30','31','30','31','31','30','31','30','31'); my $days_in_month = $monthdays[${mon}-1]; $charge = ($charge * ($days_in_month - ($day - 1))) / $days_in_month; } $charge = $charge + $product{"$num.setupfee"}; $charge = sprintf("%0.2f", $charge); $firstmonth = $charge - $product{"$num.setupfee"}; } sub SetFormValues { if (!$accountnum) { $accountnum = time; } $form_data = make_form ( 'version' => $version ,'monthly_fee' => $product{"$num.monthlyfee"} ,'emaildomain' => $emaildomain ,'ftpdomain' => $ftpdomain ,'login' => $param{'username'} ,'emailuser2' => $param{'emailuser2'} ,'emailuser3' => $param{'emailuser3'} ,'emailuser4' => $param{'emailuser4'} ,'emailuser5' => $param{'emailuser5'} ,'dialuplogin' => $dialuplogin ,'dialuppass' => $dialuppass ,'accountnum' => $accountnum ,'adddata' => $adddatatobackroom ,'passwd' => $param{'password'} ,'number' => $param{'number'} ,'numofemails' => $product{"$num.numofemails"} ,'numofftps' => $product{"$num.numofftps"} ,'addwebaccel' => $param{'addwebaccel'} ,'addspamfilter' => $param{'addspamfilter'} ,'userip' => $ENV{'REMOTE_ADDR'} ,'x_Trans_Id' => $transid ,'x_Test_Request' => $testrequest ,'x_Amount' => $charge ,'x_Cust_Id' => $param{'username'} ,'x_Invoice_Num' => $invoicenum ,'x_Description' => $product{"$num.description"} ,'x_Card_Num' => $param{'card_num'} ,'x_Exp_Date' => $param{'exp_date'} ,'x_First_Name' => $param{'first_name'} ,'x_Last_Name' => $param{'last_name'} ,'x_Address' => $param{'address'} ,'x_City' => $param{'city'} ,'x_State' => $param{'state'} ,'x_Zip' => $param{'zipcode'} ,'x_Phone' => $param{'phone'} ,'x_Email' => $param{'email'} ,'Referer' => $param{'referer'} ,'o2' => $param{'o2'} ,'os' => $param{'os'} ); $form_headers = make_headers ( 'Authorization' => 'Basic ' . MIME::Base64::encode("$yourid:$yourpass") ); } sub setupaccount { $| = 1; use lib '/usr/lib/perl5/site_perl'; my $host = "backroom.safepages.com"; my $script = "/utilities/instant/offline/newprocess2.pl"; my $port = "443"; use Net::SSLeay qw(post_https make_headers make_form); $Net::SSLeay::ssl_version = 3; $Net::SSLeay::slowly = 5; my ($setup_data, $x, %setup_headers) = post_https($host, $port, $script, $form_headers, $form_data); foreach my $key (keys %setup_headers) { } my @data = split (/\|/, $setup_data); my $response_code = $data[1]; if ($setup_data =~ /User Error/) { $setup_data =~ s/^.*User Error: //; &error("$setup_data"); } elsif ($response_code !~ /1/) { &error('No Response - The script may be temporarily down. ' . "Please wait a minute and try again - $setup_data"); } $DialupLogin = $data[2]; $OriginalLogin = $DialupLogin; $MailOnOurServers = $data[3]; if ($MailOnOurServers eq 'Y') { $emailusernameformat = '[username]@[domain]'; } my $Prefix = $product{"$num.ShowTheDialupPrefix"}; my $Suffix = $product{"$num.ShowTheDialupRealm"}; if ($Prefix =~ /n/i) { $DialupLogin =~ s/^\w{3}//; } if ($Suffix =~ /n/i) { $DialupLogin =~ s/\@.*$//; } } sub sendmailtouser { if ($param{'email'} !~ /\@/) { return; } my $body = "Thank you for purchasing internet service through ${companyname}. \n"; $body .= "Please print this out for future reference. Your credit card has been "; $body .= "billed by \"${ccbillingname}\" for an initial charge of $charge, which includes a "; $body .= "$product{\"$num.setupfee\"} setup fee and a $firstmonth first month charge. "; $body .= "Your monthly recurring fee is $product{\"$num.monthlyfee\"}.\n\n"; if ($param{'os'} !~ /Windows/i) { $body .= "You will need to manually setup your computer using the information below.\n "; $body .= "Should you need assistance you can call the tech support line at ${techphone}.\n"; $body .= "We only provide easy setup software for windows machines, if by chance you "; $body .= "selected the wrong Operating System and are using Windows, you can download "; $body .= "the software by at $product{\"$num.SoftwareLink\"} .\n\n"; } if (($product{"$num.SoftwareLink"} ne "") && ($param{'os'} =~ /Windows/i)) { $body .= "Easy Configuration Software (approx 4 min.):\n"; $body .= "$product{\"$num.SoftwareLink\"}\n\n"; $body .= "Download and install. You will want to run\n"; $body .= "the 'existing user setup' and use the information below.\n\n"; } if ($param{'addwebaccel'}) { $body .= "Web Acceleration Software Package (approx 3 min.):\n"; $body .= "$webacceldownloadlink\n"; $body .= "Download and install. You will want to use\n"; $body .= "${OriginalLogin} as your login and a password of $param{'password'}.\n\n"; } $body .= "Dialup Information\n"; $body .= " Username: ${DialupLogin}\n"; $body .= " Password: $param{'password'}\n"; $body .= " Access Number: ${number}\n"; $body .= " Access List: ${accesslist}\n\n"; for (my $i=1; $i <= $product{"$num.numofemails"}; $i++) { my $user = 'emailuser' . $i; my $EmailUsername = $param{"$user"}; my $EmailAddress = $EmailUsername . '@' . $emaildomain; if ($EmailUsername eq '') { next; } my $format = $emailusernameformat; $format =~ s/\[username\]/${EmailUsername}/; $format =~ s/\[domain\]/${emaildomain}/; $body .= "Email Information # ${i}\n"; $body .= " Email Username: $format\n"; $body .= " Email Address: $EmailAddress\n\n"; } for (my $i=1; $i <= $product{"$num.numofftps"}; $i++) { my $user = 'emailuser' . $i; my $FTPUsername = $param{"$user"}; if ($FTPUsername eq '') { next; } my $format = $ftpusernameformat; $format =~ s/\[username\]/${FTPUsername}/; $format =~ s/\[domain\]/${ftpdomain}/; my $urlformat = $ftplocationformat; $urlformat =~ s/\[username\]/${FTPUsername}/; $urlformat =~ s/\[domain\]/${ftpdomain}/; $body .= "FTP Information # ${i}\n"; $body .= " FTP Username: ${format}\n"; $body .= " Web Address: ${urlformat}\n\n"; } $body .= "Your new netphd.net email will be ready within 24 hrs you will receive a notification to this email address.\n"; $body .= "Additional Information\n"; $body .= " Incoming Mail Server (POP3): ${pop}\n"; $body .= " Outgoing Mail Server (SMTP): ${smtp}\n"; $body .= " FTP Server: ${ftp}\n"; $body .= " Billing Phone Number: ${billphone}\n"; $body .= " Tech Phone Number: ${techphone}\n\n"; $body .= "${companyname} Billing Dept.\n"; my $sendmail = "/usr/sbin/sendmail -t"; my $reply_to = "Reply-to: ${email}"; my $subject = "Subject: Internet Service Order Completed.\n\n"; my $content = "${body}"; my $to = 'billing@netphd.net'; open(SENDMAIL, "|$sendmail") or die " $!"; print(SENDMAIL "To: $param{'email'}\n"); print( SENDMAIL "From: $to\n"); print(SENDMAIL "Subject: $subject\n"); print( SENDMAIL "\n\n"); print(SENDMAIL $content ); close( SENDMAIL ); } sub sendmailtoyourself { if ($email !~ /\@/) { return; } my $body = "A order has taken place on the website!"; $body .= "Here is the users information:\n\n"; $body .= "Order Type: $product{\"$num.description\"}\n"; if ($param{'addwebaccel'}) { $body .= "Web Acceleration Added\n"; } if ($param{'addspamfilter'}) { $body .= "Spam Filtering Added\n"; } $body .= "Setup Amount: $product{\"$num.setupfee\"}\n"; $body .= "Initial Charge: $firstmonth\n"; $body .= "Monthly Amount: $product{\"$num.monthlyfee\"}\n\n"; $body .= "Dial-up Username: ${OriginalLogin}\n"; $body .= "Password: $param{'password'}\n"; $body .= "Access Number: ${number}\n"; $body .= "Access List: ${accesslist}\n\n"; for (my $i=1; $i <= $product{"$num.numofemails"}; $i++) { my $user = 'emailuser' . $i; my $EmailUsername = $param{"$user"}; my $EmailAddress = $EmailUsername . '@' . $emaildomain; if ($EmailUsername eq '') { next; } my $format = $emailusernameformat; $format =~ s/\[username\]/${EmailUsername}/; $format =~ s/\[domain\]/${emaildomain}/; $body .= "Email Information # ${i}\n"; $body .= " Username (POP3): $format\n"; $body .= " Email Address: $EmailAddress\n\n"; } for (my $i=1; $i <= $product{"$num.numofftps"}; $i++) { my $user = 'emailuser' . $i; my $FTPUsername = $param{"$user"}; if ($FTPUsername eq '') { next; } my $format = $ftpusernameformat; $format =~ s/\[username\]/${FTPUsername}/; $format =~ s/\[domain\]/${ftpdomain}/; my $urlformat = $ftplocationformat; $urlformat =~ s/\[username\]/${FTPUsername}/; $urlformat =~ s/\[domain\]/${ftpdomain}/; $body .= "FTP Information # ${i}\n"; $body .= " FTP Username: ${format}\n"; $body .= " Web Address: ${urlformat}\n\n"; } $body .= "CC #: $param{'card_num'}\n"; $body .= "Exp Date: $param{'exp_date'}\n\n"; $body .= "Name: $param{'first_name'} $param{'last_name'}\n"; $body .= "Address: $param{'address'}\n"; $body .= "Mailing AdDress :$param{'city'} $param{'state'} $param{'zipcode'}\n"; $body .= "Email: $param{'email'}\n"; $body .= "Phone: $param{'phone'}\n\n"; $body .= "${refererboxname}: $param{'referer'}\n\n"; $body .= "IP: $ENV{'REMOTE_ADDR'}\n"; my $sendmail = "/usr/sbin/sendmail -t"; my $reply_to = "Reply-to: ${email}"; my $subject = "Subject: You Got a dial-up Order!\n\n"; my $content = "${body}"; my $to = 'billing@netphd.net'; open(SENDMAIL, "|$sendmail") or die " $!"; print(SENDMAIL "To: $to\n"); print( SENDMAIL "From: $to\n"); print(SENDMAIL "Subject: $subject\n"); print( SENDMAIL "\n\n"); print(SENDMAIL $content ); close( SENDMAIL ); } sub response { if ($testrequest eq "TRUE") { print "

This is a test request:\n"; } my $step = 2; print "

Step # 1) Print Out This Page.

"; if ($param{'os'} !~ /Windows/) { print "

"; } print ""; if (($product{"$num.SoftwareLink"} ne '') && ($param{'os'} =~ /Windows/)) { print ""; $step++; } if ($param{"addwebaccel"}) { print ""; } print ""; my $useemail = 0; for (my $i=1; $i <= $product{"$num.numofemails"}; $i++) { my $user = 'emailuser' . $i; my $EmailUsername = $param{"$user"}; my $EmailAddress = $EmailUsername . '@' . $emaildomain; if ($EmailUsername eq '') { next; } my $format = $emailusernameformat; $format =~ s/\[username\]/${EmailUsername}/; $format =~ s/\[domain\]/${emaildomain}/; print " "; $useemail = 1; } if ($useemail) { print ""; } print ""; if ($product{"$num.numofftps"} >= 1) { print ""; print ""; } for (my $i=1; $i <= $product{"$num.numofftps"}; $i++) { my $user = 'emailuser' . $i; my $FTPUsername = $param{"$user"}; if ($FTPUsername eq '') { next; } my $format = $ftpusernameformat; $format =~ s/\[username\]/${FTPUsername}/; $format =~ s/\[domain\]/${ftpdomain}/; my $urlformat = $ftplocationformat; $urlformat =~ s/\[username\]/${FTPUsername}/; $urlformat =~ s/\[domain\]/${ftpdomain}/; print " "; } print "
Step # 2) Download Our Software Package (approx 4 min.):

INTERNET CONFIGURATION SOFTWARE (Click Here)

This should automatically download, if it does not click on the link above. You will want to use the information below. Be sure to save this information before you install the software.

Supports all windows versions.
Non Supported Users (Mac) - if you need assistance please call tech support.

"; if ($autolaunchsoftware =~ /y/i) { print ""; } print "

Step # ${step}) Download the Web Acceleration Package (approx 3 min.):

WEB ACCELERATION SOFTWARE DOWNLOAD

You will want to use the login of ${OriginalLogin} and a password of $param{'password'}.
Be sure to save this information before you install the software.

Supports windows 95b/98/2000/ME/XP/NT 4.0 .

Dialup Information
Dialup Username:${DialupLogin}
Password:$param{'password'}
Access Number:${number}
Access List:${accesslist}
Email Information (POP3):
# ${i} Email Username:$format
# ${i} Email Address:$EmailAddress
Incoming POP Server:${pop}
Outgoing Mail Server:${smtp}
FTP Information
FTP Server:${ftp}
FTP Username:${format}
URL Address:${urlformat}
NewsGroup Information:
News Username:${DialupLogin}
News Password:$param{'password'}
News Server:${news}
Our Contact Information:
Billing Phone Number:${billphone}
Tech Phone Number:${techphone}

"; &printFooter; } sub response_ispwizard { &CreateISPWizardFile; if ($testrequest eq "TRUE") { print "

This is a test request:\n"; } my $step = 2; print "

Step # 1) Print Out This Page.

"; if ($param{"addwebaccel"}) { print "

Step # 2) Download the Web Acceleration Software: (3-4 minutes)

WEB ACCELERATION SOFTWARE DOWNLOAD

This should download automatically. If it does not, clink on the link above. Once downloaded, save it to your desktop. Do not install the software yet. Only install if you are running windows 95/98/2000/ME or XP. You will want to use your dial-up username / password when it prompts you for a username in the software

"; $step++; } print "

Step # ${step}) Click on this link to Configure your computer.

Manual Setup Information:

"; my $useemail = 0; for (my $i=1; $i <= $product{"$num.numofemails"}; $i++) { if ($product{"$num.numofemails"} < 1) { last; } my $user = 'emailuser' . $i; my $EmailUsername = $param{"$user"}; my $EmailAddress = $EmailUsername . '@' . $emaildomain; if ($EmailUsername eq '') { next; } my $format = $emailusernameformat; $format =~ s/\[username\]/${EmailUsername}/; $format =~ s/\[domain\]/${emaildomain}/; print " "; $useemail = 1; } if ($useemail) { print ""; } print ""; my $useftp = 0; for (my $i=1; $i <= $product{"$num.numofftps"}; $i++) { if ($product{"$num.numofftps"} < 1) { last; } my $user = 'emailuser' . $i; my $FTPUsername = $param{"$user"}; if ($FTPUsername eq '') { next; } my $format = $ftpusernameformat; $format =~ s/\[username\]/${FTPUsername}/; $format =~ s/\[domain\]/${ftpdomain}/; my $urlformat = $ftplocationformat; $urlformat =~ s/\[username\]/${FTPUsername}/; $urlformat =~ s/\[domain\]/${ftpdomain}/; print " "; $useftp = 1; } if ($useftp) { print ""; } print "
(Questions) Billing Phone Number:${billphone}
(Questions) Tech Phone Number:${techphone}
(Dialup) Username:${DialupLogin}
(Dialup) Password:$param{'password'}
(Dialup) Access Number:${number}
(Email) # ${i} Username:$format
(Email) # ${i} Address:$EmailAddress
(Email) Incoming POP Server:${pop}
(Email) Outgoing Mail Server:${smtp}
(FTP) Username:${format}
(FTP) Web Address:${urlformat}
(FTP) FTP Server:${ftp}
(News) Username:${DialupLogin}
(News) Password:$param{'password'}
(News) Server:${news}

"; &printFooter; } sub build_batch { if ($testrequest eq "TRUE") { return; } open(FILE, ">>${batchfilename}"); if ($prorate =~ /y/i) { print FILE "\"${day}\","; } print FILE "\"${invoicenum}\","; print FILE "\"$product{\"$num.description\"}\","; print FILE "\"$product{\"$num.monthlyfee\"}\","; print FILE "\"$param{'card_num'}\","; print FILE "\"$param{'exp_date'}\","; print FILE "\"${OriginalLogin}\","; print FILE "\"$param{'first_name'}\","; print FILE "\"$param{'last_name'}\","; print FILE "\"$param{'address'}\","; print FILE "\"$param{'city'}\","; print FILE "\"$param{'state'}\","; print FILE "\"$param{'zipcode'}\","; print FILE "\"$param{'email'}\","; print FILE "\"$param{'phone'}\","; print FILE "\"$param{'referer'}\","; print FILE "\"$param{'o2'}\"\n"; close FILE; } sub error { my($error) = @_; print "

The Following Errors Were Encountered!"; print "
ERROR: $error


"; print "

Press your browser's BACK button to Go back to "; print "the form and fix them. Thank you."; &printFooter; exit; } sub ShowLicenseForm { print "

"; print "

Please read and then click on \"I Accept\" below to continue."; print "

"; print ""; print "\n"; print "\n"; print "\n"; print "

"; print ""; print ""; print "

"; print ""; &printFooter; exit; } sub ShowCallFinder { print "
"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print ""; print ""; print "
"; if ($totalproducts > 1) { print "First, Choose Your Rate Plan:"; print "

"; print "\n"; } else { print "Your Selected Product is:"; print "

"; my $num = 0; while (1) { if ($num == 10) { last; } if ($product{"$num.monthlyfee"} eq "") { $num++; next; } print "\n"; my $Show = "\$$product{\"$num.monthlyfee\"}"; if ($product{"$num.setupfee"} > 0) { $Show .= " \+ \$$product{\"$num.setupfee\"} Setup"; } $Show .= " \- $product{\"$num.description\"}"; print "$Show\n"; last; } } print "
\n"; print "

"; if (($offerwebaccel =~ /y/) && ($webacceldownloadlink ne '')) { print ""; } if ($offerspamfilter =~ /y/) { print ""; } print "
"; print " "; print "\$ $webaccelprice Monthly Add. - Web Acceleration (up to 5x faster) [Windows Only]"; print "
"; print " "; print "\$ $spamfilterprice Monthly Add. - Spam Filter your Mailbox"; print "
"; print "

"; print "Next, type in your AreaCode or State below.

\n"; print ""; print "

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Area Code:\n"; print "
State:\n"; print "
\n"; print "

\n"; print "\n"; print "\n"; print "

\n"; print "
\n"; &printFooter; exit; } sub ShowOrderForm { use LWP::UserAgent; use HTTP::Request; use HTTP::Status; $| = 1; ############################################################# my $ua = new LWP::UserAgent; my $host = "scripts.safepages.com"; my $script = "/usa/callfind/loclist3.pl"; my $postdata = 'rid=' . ${yourid} . '&'; $postdata .= 'npa=' . $param{'npa'} . '&'; $postdata .= 'state=' . $param{'state'} . '&'; $postdata .= 'realms=' . $product{"$num.realms"} . '&'; my $fullurl = "http://" . $host . $script . "?" . $postdata; my $request = new HTTP::Request 'GET', $fullurl; my $response = $ua->request ($request); my $resp = $response->content(); my @locations = split(/\|/, $resp); my $go = 0; foreach my $loclist (@locations) { if ($loclist =~ /\d/) { $go = 1; last; } } if ($go == 0) { print "Invalid areacode or state.

Did you type in the correct state abbrev?

Try typing "; print "in your areacode and leaving the state blank. Push Back to try again."; &printFooter; exit; } print "

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
"; print "
"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; for (my $i=2; $i <= $product{"$num.numofemails"}; $i++) { print ""; print ""; print ""; print ""; } print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; if ($askforreferer =~ /y/i) { print ""; print ""; print ""; print ""; } print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
"; print "ORDER TYPE: $product{\"$num.description\"}

"; print "
"; print "  ACCOUNT INFORMATION:"; print "
"; print "

"; print ""; print "

"; print ""; print "Choose a Dial-Up Number:"; print ""; print ""; print "\n"; print "
"; print "Username:"; print ""; print ""; print ""; if ($emaildomain ne '') { print "\@${emaildomain}"; } print ""; print "
"; print "Password:"; print ""; print ""; print "
"; print "# ${i} Email Account:"; print ""; print ""; print "\@${emaildomain}"; print "
"; print "  PAYMENT INFORMATION:"; print "
"; print "Name (First | Last):"; print ""; print ""; print ""; print "
"; print "Address:"; print ""; print ""; print "
"; print "City, State, Zip:"; print ""; print ""; print ""; print ""; print "
"; print "AreaCode & Phone:"; print ""; print ""; print "
"; print "Credit Card Number:"; print ""; print ""; print "
"; print "Exp Date:(MMYY)"; print ""; print ""; print ""; print ""; print "Do not enter a dash, slash or space in your exp date."; print ""; print "
"; print "  ADDITIONAL INFORMATION:"; print "
"; print "Your Current Email:"; print ""; print ""; print ""; print ""; print "Setup instructions will be sent to this email.
"; print "Leave blank if you do not have an email address."; print "
"; print "
"; print "${refererboxname}:"; print ""; print ""; print "
"; print "Operating System:"; print ""; print ""; print ""; print ""; print "  To help us provide tech support, select your OS"; print ""; print "
 
"; print ""; print ""; print ""; print ""; print "
"; print "
"; print "
"; print "

"; print "

"; print ""; print "It may take a minute or two to process the transaction. Do not click 'Activate My Account' twice."; if ($prorate =~ /y/) { print "
Your credit card will be charged for the initial prorated monthly charge upon signup. "; } else { print "
Your credit card will be charged for the full monthly rate upon signup. "; } print "

We report all fraud, and log your IP on signup: $ENV{'REMOTE_ADDR'}"; print ""; print "

"; &printFooter; exit; } sub CreateISPWizardFile { # Removes old ISD files. my @list = glob("./tmp/*.isd"); foreach my $name (@list) { my $mtime = (stat($name))[9]; my $t = time(); my $FileAccessAge = $t - $mtime; if ($FileAccessAge > 30 * 60) { unlink($name); } } # Creates the new ISD file. $number =~ s/\D//g; $number =~ /^(\d{3})(\d{3})(\d{4})$/; my ($areacode,$npa,$nxx) = ($1, $2, $3); open(FILE, ">./tmp/signup-${DialupLogin}.isd"); print FILE "Fullname=$param{'first_name'} $param{'last_name'}\n"; print FILE "Username=${DialupLogin}\n"; print FILE "Password=$param{'password'}\n"; print FILE "EmailAddress=$param{'emailuser1'}\n"; print FILE "EmailUsername=$param{'emailuser1'}\n"; print FILE "EmailPassword=$param{'password'}\n"; print FILE "DialupDesc=Default Entry\n"; print FILE "DialupCountry=1\n"; print FILE "DialupAreaCode=${areacode}\n"; print FILE "DialupNumber=${npa}${nxx}\n"; close FILE; } ######################################################################## # PRINT HEADER # sub printHeader { my $use_head = $head; if ($param{'ispwizard'} eq '1') { $use_head = $head_ispwizard; } if (!$use_head) { return; } if(open( HEADER, "${use_head}" )) { while(
) { print; } close( HEADER ); } else { print "Open [ HEADER ] failed: $!\n"; } } ######################################################################## # PRINT FOOTER # sub printFooter { my $use_foot = $foot; if ($param{'ispwizard'} eq '1') { $use_foot = $foot_ispwizard; } if (!$use_foot) { return; } if(open( FOOTER, "$use_foot" )) { while(