From: Paul Mutton Date: Sat, 31 Mar 2001 10:53:58 +0000 (+0000) Subject: So we can keep track of build downloads X-Git-Tag: PRE_WWW_REDESIGN~234 X-Git-Url: http://git.i-scream.org/?a=commitdiff_plain;h=cd95dd29ffb6fd7e70b0ee80e093d973e18e780c;p=www.i-scream.org.git So we can keep track of build downloads --- diff --git a/cgi-bin/download.cgi b/cgi-bin/download.cgi new file mode 100755 index 0000000..d555c7f --- /dev/null +++ b/cgi-bin/download.cgi @@ -0,0 +1,108 @@ +#!/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 < + + + + + + +
+
+

i-scream builds

+ + At the current moment, all i-scream builds may be downloaded free + of charge. 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. + +
+ +

 

+ +
+ + + + + + + + + + + + + + + + + + + + + +
Filename:$file_name
Your name:
Email address:
Country:
 
+
+ + + +EOT + +} + + +exit; \ No newline at end of file