]> andersk Git - moira.git/commitdiff
Add a "PIN" screen that's an alternative to the six words screen;
authorzacheiss <zacheiss>
Mon, 25 Feb 2002 16:40:23 +0000 (16:40 +0000)
committerzacheiss <zacheiss>
Mon, 25 Feb 2002 16:40:23 +0000 (16:40 +0000)
functionality requested by Sloan so they don't need to do personalized
mailings to get the account coupon to incoming students.

clients/regapplet/regapplet/Parser.java
clients/regapplet/regapplet/Regapplet.java
clients/regapplet/regapplet/Sender.java
clients/regapplet/regapplet/Worker.java
clients/regapplet/regapplet/mybundle.java

index 1353bc1e4b23b14aae209422dd4c2a414dda5b04..26eba26e0c8636649057d312eb08c5b940cb1789 100644 (file)
@@ -53,6 +53,14 @@ public class Parser {
           worker.setState(Worker.SENDWORDS);
           worker.applet.showWordsDiag();
         }
+     } else if (pdat[1].equals("GETI")) {
+       if (!pdat[2].equals("")) {
+         worker.setState(Worker.DIALOG, Worker.SENDPIN);
+         worker.applet.showMessage(pdat[2], true);
+       } else {
+        worker.setState(Worker.SENDPIN);
+        worker.applet.showPinDiag();
+       }
      } else if (pdat[1].equals("GETL")) {
        if (!pdat[4].equals("")) {
         worker.applet.guesslogin = pdat[4];
index e1751414884082639dbbce0727066607a7c4d730..d8ebba7a1b337596b73012059ec912a254647dc8 100755 (executable)
@@ -58,6 +58,16 @@ public class Regapplet extends Applet {
   GridBagLayout gridBagLayout2 = new GridBagLayout();
   GridLayout gridLayout1 = new GridLayout(3, 1);
   Button ExitButton = new Button();
+
+  // PIN Panel.
+  Panel PinPanel = new Panel();
+  TextBlock PinInstructions = new TextBlock(600,40);
+  Button PinCancelButton = new Button();
+  Button PinContButton = new Button();
+  TextField Pin = new TextField("", 9);
+  Label PinLabel = new Label();
+  GridBagLayout gridBagLayout7 = new GridBagLayout();
+
   Panel LoginPanel = new Panel();
   TextBlock LoginNameBanner = new TextBlock(600,30);
   Label LoginNameLabel = new Label();
@@ -135,6 +145,17 @@ public class Regapplet extends Applet {
     WordContButton.setBackground(Color.white);
     WordCancelButton.setLabel("Cancel");
     WordCancelButton.setBackground(Color.white);
+
+    // PIN initialization.
+    PinInstructions.setText(res.getString("geti"));
+    PinLabel.setText("PIN:");
+    PinLabel.setBackground(Color.white);
+    PinContButton.setLabel("Continue");
+    PinContButton.setBackground(Color.white);
+    PinCancelButton.setLabel("Cancel");
+    PinCancelButton.setBackground(Color.white);
+    Pin.setEchoCharacter('*');
+
     ExitButton.setLabel("Exit");
     ExitButton.setBackground(Color.white);
     LoginNameLabel.setText("Chosen Login Name: ");
@@ -230,6 +251,22 @@ public class Regapplet extends Applet {
     WordPanel.add(WordCancelButton);
     gridBagLayout1.setConstraints(WordCancelButton, new GridBagConstraints2(4, 3, 2, 2, 0.0, 1.0
             ,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(10, 0, 10, 0), 0, 0));
+
+    this.add("PinPanel", PinPanel);
+    PinPanel.add(PinInstructions);
+        gridBagLayout7.setConstraints(PinInstructions, new GridBagConstraints2(0, 0, 4, 1, 0.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(20, 10, 10, 20), 0, 0));
+    PinPanel.add(PinLabel);
+    gridBagLayout7.setConstraints(PinLabel, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0
+            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(20, 10, 0, 0), 0, 0));
+    PinPanel.add(Pin);
+    gridBagLayout7.setConstraints(Pin, new GridBagConstraints2(1, 1, 1, 1, 0.0, 0.0
+            ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(20, 0, 0, 10), 2, 0));
+    PinPanel.add(PinContButton);
+    gridBagLayout7.setConstraints(PinContButton, new GridBagConstraints2(1, 2, 1, 1, 0.0, 1.0
+            ,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0));
+    PinPanel.add(PinCancelButton);
+    gridBagLayout7.setConstraints(PinCancelButton, new GridBagConstraints2(3, 2, 1, 1, 0.0, 1.0
+            ,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(10, 10, 10, 10), 0, 0));
     this.add("LoginPanel", LoginPanel);
     LoginPanel.add(LoginNameBanner);
     gridBagLayout3.setConstraints(LoginNameBanner, new GridBagConstraints2(0, 0, 4, 1, 0.0, 0.0
@@ -317,6 +354,7 @@ public class Regapplet extends Applet {
     Word4.setText("");
     Word5.setText("");
     Word6.setText("");
+    Pin.setText("");
     guesslogin = "";
   }
 
@@ -371,6 +409,11 @@ public class Regapplet extends Applet {
     Word1.requestFocus();
   }
 
+  public void showPinDiag() {
+    cardLayout1.show(this, "PinPanel");
+    Pin.requestFocus();
+  }
+
   public void showLoginDiag() {
     if (!guesslogin.equals("")) {
       LoginNameBanner.setText(res.getString("getl1") + "\n" + res.getString("getl2") + " " + guesslogin + "\n" + res.getString("getl3"));
@@ -453,6 +496,7 @@ public class Regapplet extends Applet {
       }
       return true;
     } else if ((evt.target == WordContButton) ||
+              (evt.target == PinContButton) || 
                (evt.target == LoginContButton) ||
                (evt.target == PasswordContButton) ||
                (evt.target == NameContButton) ||
@@ -468,6 +512,7 @@ public class Regapplet extends Applet {
       if (isStandalone) System.exit (0);
     } else if (evt.target == NameCancelButton ||
                evt.target == WordCancelButton ||
+               evt.target == PinCancelButton ||
                evt.target == LoginCancelButton ||
                evt.target == PasswordCancelButton) {
       doBale();
index f08edc40e922e65d0d1a64c06b693a3656a36554..7fb599cd6dc27156b5e423d0fac59762a2969bea 100644 (file)
@@ -63,6 +63,11 @@ public class Sender {
         + Word3 + '\0' + Word4 + '\0' + Word5 + '\0' + Word6 + '\0';
      sendstring(s);
   }
+  public void SendPin(String Pin) {
+     String s;
+     s = "v1" + "\0" + "SPIN" + '\0' + Pin + '\0';
+     sendstring(s);
+  }
   public void SendLogin(String Login) {
      String s;
      s = "v1" + '\0' + "LOGN" + '\0' + Login + '\0';
index f3aded9d29534b683b64057de3765a67490e7b3b..61e3eaeff6b8976ea64ee93c30a08f25f1153b83 100644 (file)
@@ -14,6 +14,7 @@ public class Worker implements Runnable {
   public static final int INIT = 4;
   public static final int DIALOG = 5;
   public static final int INIT1 = 6;
+  public static final int SENDPIN = 7;
   int oldstate = INIT;
   int state = INIT;
   int nextstate = INIT;
@@ -33,7 +34,10 @@ public class Worker implements Runnable {
            case SENDWORDS:
                 applet.showWordsDiag();
                 break;
-           case SENDNAME:
+          case SENDPIN:
+               applet.showPinDiag();
+               break;
+          case SENDNAME:
                 applet.showNameDiag();
                 break;
            case SENDLOGIN:
@@ -123,6 +127,11 @@ public class Worker implements Runnable {
                       applet.Word5.getText(),
                       applet.Word6.getText());
        break;
+      case SENDPIN:
+       applet.showMessage("Please wait...");
+       send.SendPin(applet.Pin.getText());
+       break;
+
       case SENDLOGIN:
        applet.showMessage("Please wait...");
        send.SendLogin(applet.LoginName.getText());
index ec42c874b88db97d9aa8e5fa59918b266c45561d..bbf3bb07e7658f68982bb06b647d541f1c7c0af6 100644 (file)
@@ -12,6 +12,7 @@ public class mybundle {
     ht = new Hashtable();
     ht.put("welcome", "Welcome to the Athena Computing Environment");
     ht.put("getw", "You should have received an \"Athena Account Coupon\" containing six secret Key Words to be used to verify your identity. Please enter those six words below.\n(If you are a freshmen entering in the fall term, you should have received this Coupon in your orientation packet. If you are a transfer student or graduate student, you should have picked up your Coupon at the Student Services Center.)\nIf you do not have your Athena Account Coupon, you will not be able to register for an account at this time. You can bring your MIT ID to the Student Services Center in Building 11 to pick up a new Coupon.");
+    ht.put("geti", "When applying on-line, you should have chosen a 9 character long PIN to be used to verify your identity. Please enter that PIN below.\nIf you do not have your PIN, you will not be able to register for an account at this time.  Please contact the Athena User Accounts office in N42-105A, x3-1325 for further assistance.");
     ht.put("getl1", "Now you must pick an Athena username. Your Athena username will also be used for your MIT.EDU email address. Friends, colleagues, and others will use this username to communicate with you. No two people may have the same Athena username.\nA username must be at least 3 characters, and not more than 8. It must start with a lowercase letter, and may contain only lowercase letters, numbers, and the underscore character (_).\nMost people choose a username which is similar to their real name. A common choice is to use the first initial (or first and middle initials) followed by the last name (for example, \"jdoe\" for John Doe).");
     ht.put("getl2", "Some example usernames based on your name are:");
     ht.put("getl3", "You may choose whatever you want for your username, but the username you choose now will stay with you for your entire career at MIT. Once it is registered for you, it CANNOT be changed.");
This page took 0.049946 seconds and 5 git commands to generate.