8f104ce97d57e1117e1ab839c816a38b94d5e1c3
[spider.git] / spider-web / spider.cgi
1 #!/usr/bin/perl
2
3 # cluster-web.pl - perl login script for cluster web interface.
4 # @author Ian Norton 
5 # - Based on clx-web by DL6DBH (ftp://clx.muc.de/pub/clx/clx-java_10130001.tgz)
6 # - Modified by PA4AB
7 # @version 0.1 beta.  20010610.
8
9 # Work out the hostname of this server.
10 use Sys::Hostname;
11 my $HOSTNAME = hostname();
12
13 # Set the hostname manually here if the above fails.
14 # $HOSTNAME = "gb7mbc.spoo.org" ;
15 $PORT = "8000" ;
16
17 # Send text/html header to the browser.
18 print "Content-type: text/html\n\n";
19
20 # Get the parameters passed to the script.
21 read (STDIN, $post_data, $ENV{CONTENT_LENGTH});
22 @call = split (/=/, $post_data) ;
23
24 # Print the page header.
25
26 print <<'EOF';
27
28 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
29 <HTML LANG="EN">
30     <HEAD>
31         <TITLE>Cluster Web - DX Cluster Web Interface.</TITLE>
32         <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1">
33         <META NAME="Author" CONTENT="Ian Norton.">
34         <META NAME="DESCRIPTION" CONTENT="DX Cluster web interface">
35     </HEAD>
36  
37 <BODY BGCOLOR="#FFFFFF" LINK="#008080" ALINK="#000099" VLINK="#000099">         
38
39     <H1>
40     <CENTER>
41         <FONT FACE="arial, helvicta" COLOR="#008080" SIZE=+2>
42         <B><BR>Cluster Web - DX Cluster Web Interface.</B><BR>
43 EOF
44
45         print("Welcome to $HOSTNAME<BR>") ;
46
47 print <<'EOF';
48         </FONT>
49     </CENTER>
50     </H1>
51
52 <BR CLEAR="ALL">
53
54 <HR>
55 EOF
56
57 if($ENV{CONTENT_LENGTH} > 0)
58     {
59     # Callsign is set - print the whole <APPLET> stuff....
60     # print("Callsign is $call[1]<BR>\n") ;
61
62     print("<CENTER>\n") ;
63     print("    <APPLET CODE=\"spiderclient.class\" CODEBASE=\"/client/\" width=800 height=130>\n") ;
64     print("        <PARAM NAME=\"CALL\" VALUE=\"$call[1]\">\n") ;
65     print("        <PARAM NAME=\"HOSTNAME\" VALUE=\"$HOSTNAME\">\n") ;
66     print("        <PARAM NAME=\"PORT\" VALUE=\"$PORT\">\n") ;
67     print("    </APPLET>\n") ;
68     print("</CENTER>\n") ;
69     }
70 else
71     {
72     # Callsign isn't set - print the login page.
73     print <<'EOF';
74     <CENTER>
75     <FORM METHOD=POST>
76         <STRONG>Please enter your callsign: </STRONG><BR>
77         <INPUT name="call" size=10><BR>
78         <INPUT type=submit value="Click here to Login">
79     </FORM>
80     </CENTER>
81 EOF
82     }
83
84 print <<'EOF';
85 <HR>
86
87 <ADDRESS>
88 <A HREF="http://www.dxcluster.org/">Spider Homepage</A>.
89 </HTML>
90
91 EOF