]> andersk Git - moira.git/blobdiff - clients/regapplet/regapplet/Worker.java
If we're an applet, try to connect to port 443 on the host we were
[moira.git] / clients / regapplet / regapplet / Worker.java
index 61e3eaeff6b8976ea64ee93c30a08f25f1153b83..8e7504edb5a49e2cf91e5f88b0db9b9b44cf4b94 100644 (file)
@@ -15,6 +15,7 @@ public class Worker implements Runnable {
   public static final int DIALOG = 5;
   public static final int INIT1 = 6;
   public static final int SENDPIN = 7;
+  public static final int CONFIRMLOGIN = 8;
   int oldstate = INIT;
   int state = INIT;
   int nextstate = INIT;
@@ -43,6 +44,9 @@ public class Worker implements Runnable {
            case SENDLOGIN:
                applet.showLoginDiag();
                break;
+          case CONFIRMLOGIN:
+               applet.showLoginConfirmDiag();
+               break;
           case SENDPASSWD:
                applet.showPassDiag();
                break;
@@ -71,7 +75,9 @@ public class Worker implements Runnable {
        applet.showMessage("Connecting to Server...");
         try {
          String host;
+         int port;
          if (applet.isStandalone) {
+           port = 9001;
            host = (System.getProperties()).getProperty("host", "");
            if (host == null || host.equals("")) {
              System.err.println("Cannot learn host name (application) using localhost");
@@ -80,6 +86,7 @@ public class Worker implements Runnable {
          } else {
            URL cb = applet.getCodeBase();
            String protocol = cb.getProtocol();
+           port = 443; // Use https port for firewall traversal.
            if (protocol.equals("file") || protocol.equals("FILE")) {
              System.err.println("Applet: FILE protocol in use, connecting to localhost");
              host = "localhost";
@@ -87,7 +94,7 @@ public class Worker implements Runnable {
              host = cb.getHost();
            }
          }
-         sock = new Socket(host, 9001);
+         sock = new Socket(host, port);
        } catch (Exception e) {
           e.printStackTrace();
          applet.showError1(true);
@@ -136,6 +143,10 @@ public class Worker implements Runnable {
        applet.showMessage("Please wait...");
        send.SendLogin(applet.LoginName.getText());
        break;
+      case CONFIRMLOGIN:
+       applet.showMessage("Please wait...");
+       send.ConfirmLogin(applet.chosenlogin);
+       break;
       case SENDPASSWD:
        if (!(applet.Password1.getText().equals(applet.Password2.getText()))) {
          applet.Password1.setText("");
This page took 0.478356 seconds and 4 git commands to generate.