--- /dev/null
+#!/usr/bin/perl -w
+
+#--------------------------------------------------------------
+# download.cgi
+#
+# A Perl CGI script that requests a user's email address
+# before they may download a build from the i-scream web site.
+# It is not essential for them to enter their email address.
+#
+# Copyright Paul Mutton, 2001.
+#--------------------------------------------------------------
+
+use strict;
+use CGI;
+
+$| = 1;
+
+
+#--------------------------------------------------------------
+# Essential Settings
+#--------------------------------------------------------------
+my $build_dir = "/builds";
+my $log_file = "download_log";
+#--------------------------------------------------------------
+
+
+my $query = new CGI;
+
+my ($file_name) = ($query->param('file_name') =~ /^\s*(.*)\s*$/);
+my ($your_name) = ($query->param('your_name') =~ /^\s*(.*)\s*$/);
+my ($email_address) = ($query->param('email_address') =~ /^\s*(.*)\s*$/);
+my ($country) = ($query->param('country') =~ /^\s*(.*)\s*$/);
+my ($submit) = ($query->param('submit') =~ /^\s*(.*)\s*$/);
+my ($date) = scalar localtime time;
+
+$your_name =~ s/\|//g;
+$email_address =~ s/\|//g;
+$country =~ s/\|//g;
+
+if (!defined($file_name) || $file_name eq "") {
+ print "Content-type: text/html\n\n";
+ print "You must specify a filename for use with the i-scream downloader.";
+ exit;
+}
+
+if (defined($submit) && $submit eq "Download") {
+ open(LOGFILE, ">>$log_file");
+ print LOGFILE "$date|$file_name|$your_name|$email_address|$country\n";
+ close(LOGFILE);
+ print "Location: $build_dir/$file_name\n\n";
+}
+else {
+ print "Content-type: text/html\n\n";
+
+ print <<EOT;
+ <html>
+ <basefont face="arial,sans-serif" size="2">
+ <body bgcolor="white" text="#000066">
+ <table align="center" width="600">
+ <tr>
+ <td>
+ <center><img src="/i-scream.gif" width="502" height="37" border="0"></center>
+ <center><h3>i-scream builds</h3></center>
+ <font size="2">
+ At the current moment, all i-scream builds may be downloaded <b>free
+ of charge</b>. If you wish to be alerted infrequently about important issues
+ regarding the i-scream montoring system, then we would recommend that
+ you provide your contact details below. All fields are optional.
+ </font>
+ </td>
+ </tr>
+ </table>
+
+ <p> </p>
+
+ <form action="download.cgi" method="POST">
+ <table border="0" align="center">
+ <tr>
+ <td>Filename:</td>
+ <td><b>$file_name</b><input type="hidden" name="file_name" value="$file_name"></td>
+ </tr>
+ <tr>
+ <td>Your name:</td>
+ <td><input type="text" name="your_name" value=""></td>
+ </tr>
+ <tr>
+ <td>Email address:</td>
+ <td><input type="text" name="email_address" value=""></td>
+ </tr>
+ <tr>
+ <td>Country:</td>
+ <td><input type="text" name="country" value=""></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input type="submit" name="submit" value="Download"></td>
+ </tr>
+ </table>
+ </form>
+
+ </body>
+ </html>
+EOT
+
+}
+
+
+exit;
\ No newline at end of file