]> dxcluster.net Git - spider.git/commitdiff
Updated the Java Web Interface to allow passwords. If a user has no password
authorg0vgs <g0vgs>
Sat, 17 Nov 2001 08:17:22 +0000 (08:17 +0000)
committerg0vgs <g0vgs>
Sat, 17 Nov 2001 08:17:22 +0000 (08:17 +0000)
it will cheerfully allow any input, including null.. and ignore it.

spider-web/spider.cgi
spider-web/spiderclient.class
spider-web/spiderclient.java
spider-web/spiderframe.class
spider-web/spiderframe.java

index 8f104ce97d57e1117e1ab839c816a38b94d5e1c3..248ccd5e02c9c6707dddbd9b0b3eebe41de9ca1a 100755 (executable)
@@ -19,10 +19,16 @@ print "Content-type: text/html\n\n";
 
 # Get the parameters passed to the script.
 read (STDIN, $post_data, $ENV{CONTENT_LENGTH});
-@call = split (/=/, $post_data) ;
 
-# Print the page header.
+$callstart = index($post_data, "=") + 1 ;
+$callend = index($post_data, "&") ;
+
+$call = substr($post_data, $callstart, $callend - $callstart), 
+$password = substr($post_data, index($post_data, "=", $callend) + 1, length($post_data)) ;
 
+# Print the page header.
+#print("Callsign : $call") ;
+#print("Password : $password") ;
 print <<'EOF';
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
@@ -57,11 +63,12 @@ EOF
 if($ENV{CONTENT_LENGTH} > 0)
     {
     # Callsign is set - print the whole <APPLET> stuff....
-    # print("Callsign is $call[1]<BR>\n") ;
+    # print("Callsign is $call<BR>\n") ;
 
     print("<CENTER>\n") ;
     print("    <APPLET CODE=\"spiderclient.class\" CODEBASE=\"/client/\" width=800 height=130>\n") ;
-    print("        <PARAM NAME=\"CALL\" VALUE=\"$call[1]\">\n") ;
+    print("        <PARAM NAME=\"CALL\" VALUE=\"$call\">\n") ;
+    print("        <PARAM NAME=\"PASSWORD\" VALUE=\"$password\">\n") ;
     print("        <PARAM NAME=\"HOSTNAME\" VALUE=\"$HOSTNAME\">\n") ;
     print("        <PARAM NAME=\"PORT\" VALUE=\"$PORT\">\n") ;
     print("    </APPLET>\n") ;
@@ -75,6 +82,8 @@ else
     <FORM METHOD=POST>
         <STRONG>Please enter your callsign: </STRONG><BR>
         <INPUT name="call" size=10><BR>
+        <STRONG>Please enter your password: </STRONG><BR>
+        <INPUT name="password" size=10 TYPE=PASSWORD><BR>
         <INPUT type=submit value="Click here to Login">
     </FORM>
     </CENTER>
index 679401f392f41d5a99c1fa35060140742f06ed8e..4d45a246520f52b62fb36c0f2cce18f2104229d1 100644 (file)
Binary files a/spider-web/spiderclient.class and b/spider-web/spiderclient.class differ
index 51ddf9056cb8775cd57a08a24b1e0a72d29dba38..d47fa93164a51fee6d8ff7441ff520434885913a 100755 (executable)
@@ -15,6 +15,9 @@ public class spiderclient extends Applet {
                p = getParameter("CALL");
                if (p != null) cf.setCall(p);
                
+        p = getParameter("PASSWORD");
+        if (p != null) cf.setPassword(p);
+        
                p = getParameter("FULLNAME");
                if (p != null) cf.setFullname(p);
 
@@ -44,7 +47,12 @@ public class spiderclient extends Applet {
                        listener = new StreamListener(cf, in);
                        
                        out.println(cf.getCall());
-                       out.println(cf.getFullname());
+
+                       if(cf.getPassword().length() > 0) {
+                out.println(cf.getPassword());
+            }
+
+                       // out.println(cf.getFullname());
                }
                catch (IOException e) { 
                        InfoDialog id = new InfoDialog(cf, "Error", e.toString());
index b4d08dbdce0197a74c4faf609f2def8904c08bcd..1a4e11a60c8e8be9c52594e6ae2780721e9366b5 100644 (file)
Binary files a/spider-web/spiderframe.class and b/spider-web/spiderframe.class differ
index ae6e12e8e10bf720dad8d50aaae8c10e9d3949c7..1630f9e7d2f393d988bb33f00207ac6891db4300 100755 (executable)
@@ -173,6 +173,10 @@ menubar.add(mailbox);
                Call = s;
        }
 
+    public void setPassword(String s) {
+        Password = s ;
+    }
+
        public void setPrefix(String s) {
                Prefix = s;
                }
@@ -207,6 +211,10 @@ menubar.add(mailbox);
                return Call;
        }
        
+    public String getPassword() {
+        return Password;
+    }
+    
        public String setPrefix(){
               return Prefix;
               }
@@ -563,6 +571,7 @@ menubar.add(mailbox);
        private Font InFont = new Font("Courier", Font.BOLD, 13);
        
        private String Call = new String("NOCALL");
+       private String Password = new String();
        private String Fullname = new String("NOBODY");
        private String Hostname = new String("localhost");
        private String Port = new String("3600");