]> i-scream Git - www.i-scream.org.git/blobdiff - cgi-bin/download.cgi
VRMLgraph is still on i-scream.org.uk until Paul moves it :-)
[www.i-scream.org.git] / cgi-bin / download.cgi
index 9ae0bbfab27f075390082fffe3393dc8e7f9690b..51727ec1df5da4170750dcf2acf0a9d43e2f99c3 100755 (executable)
@@ -19,8 +19,11 @@ $| = 1;
 #--------------------------------------------------------------
 # Essential Settings
 #--------------------------------------------------------------
-my ($build_dir) = "/builds";
+my ($build_dir) = "/downloads";
 my ($log_file) = "download_log";
+my ($left) = "../htdocs/left.inc" ;
+my ($title) = "../htdocs/title.inc";
+my ($bottom) = "../htdocs/bottom.inc";
 #--------------------------------------------------------------
 
 
@@ -45,27 +48,60 @@ if (!defined($file_name) || $file_name eq "") {
 
 if (defined($submit) && $submit eq "Download") {
     open(LOGFILE, ">>$log_file");
-    print LOGFILE "$date|$file_name|$your_name|$email_address|$country\n";
+    print LOGFILE "$date|$ENV{'REMOTE_ADDR'}|$file_name|$your_name|$email_address|$country\n";
     close(LOGFILE);
     print $query->redirect("$build_dir/$file_name");
 }
 else {
     print "Content-type: text/html\n\n";
-   
-    print <<EOT;
+
+    print <<"END";
+        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+        <!--
+            download.cgi
+            Created by pjm2 31/03/2001
+            Last modified 31/03/2001
+        -->
+
         <html>
-        <basefont face="arial,sans-serif" size="2">
-        <body bgcolor="white" text="#000066">
-        <table align="center" width="600">
+
+        <head>
+         <title>i-scream downloads</title>
+         <meta name="description" content="The i-scream Project is a central monitoring system for Unix, Linux and NT servers.">
+         <meta name="keywords" content="i-scream, project, central monitoring system, unix, linux, nt, server, alert">
+         <meta name="generator" content="notepad on acid, aye.">
+        </head>
+
+        <body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" text="#000066">
+
+        <table border="0" cellpadding="2" cellspacing="2">
+         <tr>
+          <td valign="top">
+END
+
+    &print_html($left);
+
+    print <<"END";
+        </td>
+        <td valign="top">
+END
+
+    &print_html($title);
+
+    print <<EOT;
+        <table align="center" width="500">
          <tr>
           <td>
-           <center><img src="/i-scream.gif" width="502" height="37" border="0"></center>
+           <font face="arial,sans-serif">
            <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.
+            If you wish your details to be kept so we can contact you in the
+            future about i-scream, please enter them below. At the moment we
+            are not using this information, but we may collate a list of
+            details for when we make a new major release. All details are
+            optional - do not feel obliged to enter anything!
+           </font>
            </font>
           </td>
          </tr>
@@ -73,22 +109,22 @@ else {
         
         <p>&nbsp;</p>
         
-        <form action="download.cgi" method="POST">
+        <form action="/cgi-bin/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>
+           <td><font face="arial,sans-serif">Filename:</font></td>
+           <td><font face="arial,sans-serif"><b>$file_name</b></font><input type="hidden" name="file_name" value="$file_name"></td>
           </tr>
           <tr>
-           <td>Your name:</td>
+           <td><font face="arial,sans-serif">Your name:</font></td>
            <td><input type="text" name="your_name" value=""></td>
           </tr>
           <tr>
-           <td>Email address:</td>
+           <td><font face="arial,sans-serif">Email address:</font></td>
            <td><input type="text" name="email_address" value=""></td>
           </tr>
           <tr>
-           <td>Country:</td>
+           <td><font face="arial,sans-serif">Country:</font></td>
            <td><input type="text" name="country" value=""></td>
           </tr>
           <tr>
@@ -102,7 +138,22 @@ else {
         </html>
 EOT
 
+    &print_html($bottom);
+
+    print <<"END";
+
+          </td>
+         </tr>
+        </table>
+END
+
 }
 
+exit;
 
-exit;
\ No newline at end of file
+
+# Print a file without escaping HTML: -
+sub print_html ($) {
+    my ($filename) = @_;
+    print `cat $filename 2>&1`;
+}