#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<Head><Title>Home Savings & Loan Corporation - Security Information</Title></Head>";
print "<BODY background=/images/hslc/b3.jpg>";
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
    ($name, $value) = split(/=/, $pair);

    # Un-Webify plus signs and %-encoding
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

    # Stop people from using subshells to execute commands
    # Not a big deal when using sendmail, but very important
    # when using UCB mail (aka mailx).
    # $value =~ s/~!/ ~!/g; 

    # Uncomment for debugging purposes
    # print "Setting $name to $value<P>";

    $FORM{$name} = $value;
}


open (LOGFILE, ">>/usr/local/etc/stronghold/ssldocs/iplog.html");
 
$t = localtime(time);
print LOGFILE "$ENV{'REMOTE_HOST'}--";
print LOGFILE "<font color=lightgreen>$t</font>-------<font color=green>Name:</font><font color=red>$FORM{'comments'}</font>";
print LOGFILE ">>>> <font color=green>Email:</font><font color=blue>$FORM{'to'}</font> ";
close (LOGFILE);

$t = localtime(time);

# ====================================================================

print <<"EOF";

<SCRIPT LANGUAGE="javascript">

function open_window(url) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=0,resizable=0,width=446,height=362');
}

</SCRIPT>

<center>
<img src="/images/hslc/hslc-logobar.gif"><br>
<table width=604  height=350 border=0 cellpadding=10>
<tr valign=top><td bgcolor="#FFFFFF"><font face="Times Roman" size=2>

<center><img src="/images/hslc/blueline.gif"><p>
<h2><font color="#000080">Home Savings & Loan Corporation<br>Secure Server Information</font></h2>
<img src="/images/hslc/blueline.gif"></center>
<p>
Home Savings & Loan Corporation's Secure Server is maintained and hosted by Ezenet Inc., a service bureau which provides secure online banking and data processing sites for the financial community accross Canada.
<p>
This server has been verified by VeriSign as a secure Web Server:
<ul>
<li>All data exchanged with this server is encrypted and/or unaltered.
<li>VeriSign has verified that the server operator has the right to use the name presented on the site.
</ul>
<center><a href="javascript:open_window('https://www2.ezenet.com/authentic/index.html')"><img src="/authentic/images/seal.gif"></a></center>
<p>
<center><b>Click on the VeriSign button for more information on how to view this site's<br><font color="#ff0000">VeriSign Secure Server Digital ID<font size=1><sup>TM</sup></font>.</font></b></center>
<p>
<center>
All activities have been logged as:
<p>
<table border=1>
<tr><td><b>IP Address: <font color=red>$ENV{'REMOTE_HOST'}</font></b></td></tr>
<tr><td><b>IP Address: <font color=red>$ENV{'REMOTE_HOST'}</font></b></td></tr>
<tr><td><b>Time/Date Stamp: <font color=red>$t</font></b></td></tr>
</table>
<p>
<img src="/images/hslc/blueline.gif"></center>

</font></td></tr>
</table>
</center>

EOF
