3 #--------------------------------------------------------------
6 # A Perl CGI script that requests some details from the user
7 # before they download a build from the i-scream web site.
8 # To assist the paranoid, all fields are optional.
10 # Copyright Paul Mutton, 2001.
11 #--------------------------------------------------------------
19 #--------------------------------------------------------------
21 #--------------------------------------------------------------
22 my ($build_dir) = "/downloads";
23 my ($log_file) = "download_log";
24 my ($left) = "../htdocs/left.inc" ;
25 my ($title) = "../htdocs/title.inc";
26 my ($bottom) = "../htdocs/bottom.inc";
27 #--------------------------------------------------------------
30 my ($query) = new CGI;
32 my ($file_name) = ($query->param('file_name') =~ /^\s*(.*)\s*$/);
33 my ($your_name) = ($query->param('your_name') =~ /^\s*(.*)\s*$/);
34 my ($email_address) = ($query->param('email_address') =~ /^\s*(.*)\s*$/);
35 my ($country) = ($query->param('country') =~ /^\s*(.*)\s*$/);
36 my ($submit) = ($query->param('submit') =~ /^\s*(.*)\s*$/);
37 my ($date) = scalar localtime time;
39 $your_name =~ s/\|//g;
40 $email_address =~ s/\|//g;
43 if (!defined($file_name) || $file_name eq "") {
44 print "Content-type: text/html\n\n";
45 print "You must specify a filename for use with the i-scream downloader.";
49 if (defined($submit) && $submit eq "Download") {
50 open(LOGFILE, ">>$log_file");
51 print LOGFILE "$date|$ENV{'REMOTE_ADDR'}|$file_name|$your_name|$email_address|$country\n";
53 print $query->redirect("$build_dir/$file_name");
56 print "Content-type: text/html\n\n";
59 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
63 Created by pjm2 31/03/2001
64 Last modified 31/03/2001
70 <title>i-scream downloads</title>
71 <meta name="description" content="The i-scream Project is a central monitoring system for Unix, Linux and NT servers.">
72 <meta name="keywords" content="i-scream, project, central monitoring system, unix, linux, nt, server, alert">
73 <meta name="generator" content="notepad on acid, aye.">
76 <body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" text="#000066">
78 <table border="0" cellpadding="2" cellspacing="2">
93 <table align="center" width="500">
96 <font face="arial,sans-serif">
97 <center><h3>i-scream builds</h3></center>
99 If you wish your details to be kept so we can contact you in the
100 future about i-scream, please enter them below. At the moment we
101 are not using this information, but we may collate a list of
102 details for when we make a new major release. All details are
103 optional - do not feel obliged to enter anything!
112 <form action="/cgi-bin/download.cgi" method="POST">
113 <table border="0" align="center">
115 <td><font face="arial,sans-serif">Filename:</font></td>
116 <td><font face="arial,sans-serif"><b>$file_name</b></font><input type="hidden" name="file_name" value="$file_name"></td>
119 <td><font face="arial,sans-serif">Your name:</font></td>
120 <td><input type="text" name="your_name" value=""></td>
123 <td><font face="arial,sans-serif">Email address:</font></td>
124 <td><input type="text" name="email_address" value=""></td>
127 <td><font face="arial,sans-serif">Country:</font></td>
128 <td><input type="text" name="country" value=""></td>
132 <td><input type="submit" name="submit" value="Download"></td>
141 &print_html($bottom);
155 # Print a file without escaping HTML: -
158 print `cat $filename 2>&1`;