[2842] in Moira

home help back first fref pref prev next nref lref last post

regapplet patches

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Mon Jun 27 07:48:11 2005

Message-Id: <200506271148.j5RBm1uE004177@brad-majors.mit.edu>
To: moiradev@MIT.EDU
Date: Mon, 27 Jun 2005 07:48:01 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

These patches take advantage of the server side functionality added by
my last piece of mail.  They're pretty uninteresting.

One note is that the text for the new screen is currently functionality
but not pretty, and I consider it a placeholder.  I've asked the
accounts consultants to provide the text they'd like the user to see
when they confirm their choice of username.

Garry

Index: regapplet/Parser.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Parser.java,v
retrieving revision 1.3
diff -u -r1.3 Parser.java
--- regapplet/Parser.java	25 Feb 2002 16:40:23 -0000	1.3
+++ regapplet/Parser.java	27 Jun 2005 04:31:21 -0000
@@ -72,6 +72,17 @@
           worker.setState(Worker.SENDLOGIN);
 	  worker.applet.showLoginDiag();
        }
+     } else if (pdat[1].equals("LOGC")) {
+       if (!pdat[4].equals("")) {
+	 worker.applet.chosenlogin = pdat[4];
+       } else worker.applet.chosenlogin = "";
+       if (!pdat[2].equals("")) {
+	  worker.setState(Worker.DIALOG, Worker.CONFIRMLOGIN);
+	  worker.applet.showMessage(pdat[2], true);
+       } else {
+	  worker.setState(Worker.CONFIRMLOGIN);
+	  worker.applet.showLoginDiag();
+       }
      } else if (pdat[1].equals("GETP")) {
        if (!pdat[2].equals("")) {
           worker.setState(Worker.DIALOG, Worker.SENDPASSWD);
Index: regapplet/Regapplet.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Regapplet.java,v
retrieving revision 1.6
diff -u -r1.6 Regapplet.java
--- regapplet/Regapplet.java	27 Feb 2003 20:56:47 -0000	1.6
+++ regapplet/Regapplet.java	27 Jun 2005 11:26:22 -0000
@@ -68,6 +68,13 @@
   Label PinLabel = new Label();
   GridBagLayout gridBagLayout7 = new GridBagLayout();
 
+  // login confirmation panel.
+  Panel LoginConfirmPanel = new Panel();
+  TextBlock LoginConfirmInstructions = new TextBlock(600,40);
+  Button LoginConfirmCancelButton = new Button();
+  Button LoginConfirmContButton = new Button();
+  GridBagLayout gridBagLayout8 = new GridBagLayout();
+
   Panel LoginPanel = new Panel();
   TextBlock LoginNameBanner = new TextBlock(600,30);
   Label LoginNameLabel = new Label();
@@ -96,6 +103,7 @@
   public Worker worker = null;
   public Thread workthread = null;
   public String guesslogin = "";
+  public String chosenlogin = "";
  
   //Get a parameter value
   public String getParameter(String key, String def) {
@@ -156,6 +164,12 @@
     PinCancelButton.setBackground(Color.white);
     Pin.setEchoCharacter('*');
 
+    // login confirmation initialization.
+    LoginConfirmContButton.setLabel("Continue");
+    LoginConfirmContButton.setBackground(Color.white);
+    LoginConfirmCancelButton.setLabel("Cancel");
+    LoginConfirmCancelButton.setBackground(Color.white);
+
     ExitButton.setLabel("Exit");
     ExitButton.setBackground(Color.white);
     LoginNameLabel.setText("Chosen Login Name: ");
@@ -251,10 +265,20 @@
     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("LoginConfirmPanel", LoginConfirmPanel);
+    LoginConfirmPanel.add(LoginConfirmInstructions);
+    gridBagLayout8.setConstraints(LoginConfirmInstructions, new GridBagConstraints2(0, 0, 3, 3, 0.0, 0.0
+            ,GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0));
+    LoginConfirmPanel.add(LoginConfirmContButton);
+    gridBagLayout8.setConstraints(LoginConfirmContButton, new GridBagConstraints2(1, 4, 1, 1, 0.0, 1.0
+                  ,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(10, 0, 20, 0), 0, 0));
+    LoginConfirmPanel.add(LoginConfirmCancelButton);
+    gridBagLayout8.setConstraints(LoginConfirmCancelButton, new GridBagConstraints2(2, 4, 1, 1, 0.0, 1.0
+                  ,GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(10, 0, 20, 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));
+    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));
@@ -356,6 +380,7 @@
     Word6.setText("");
     Pin.setText("");
     guesslogin = "";
+    chosenlogin = "";
   }
 
   //Start the applet
@@ -424,6 +449,14 @@
     LoginName.requestFocus();
   }
 
+  public void showLoginConfirmDiag() {
+    if (!chosenlogin.equals("")) {
+      LoginConfirmInstructions.setText(res.getString("logc1") + " " + chosenlogin + "\n" + res.getString("logc2"));
+    }
+    cardLayout1.show(this, "LoginConfirmPanel");
+    LoginConfirmContButton.requestFocus();
+  }
+
   public void showPassDiag() {
     cardLayout1.show(this, "PasswordPanel");
     Password1.requestFocus();
@@ -497,17 +530,21 @@
       return true;
     } else if ((evt.target == WordContButton) ||
 	       (evt.target == PinContButton) || 
-               (evt.target == LoginContButton) ||
+               (evt.target == LoginConfirmContButton) ||
+	       (evt.target == LoginContButton) ||
                (evt.target == PasswordContButton) ||
                (evt.target == NameContButton) ||
 	       (evt.target == MITID) ||
-	       (evt.target == Word6) ||
 	       (evt.target == LoginName) ||
+	       (evt.target == Word6) ||
 	       (evt.target == Password2) ||
 	       (evt.target == RuleButton)) {
       workthread = new Thread(worker);
       workthread.start();
       return true;
+    } else if (evt.target == LoginConfirmCancelButton) {
+	  chosenlogin = "";
+	  showLoginDiag();
     } else if (evt.target == ExitButton) {
       if (isStandalone) System.exit (0);
     } else if (evt.target == NameCancelButton ||
Index: regapplet/Sender.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Sender.java,v
retrieving revision 1.3
diff -u -r1.3 Sender.java
--- regapplet/Sender.java	25 Feb 2002 16:40:23 -0000	1.3
+++ regapplet/Sender.java	27 Jun 2005 04:25:01 -0000
@@ -70,6 +70,11 @@
   }
   public void SendLogin(String Login) {
      String s;
+     s = "v1" + '\0' + "CLGN" + '\0' + Login + '\0';
+     sendstring(s);
+  }
+  public void ConfirmLogin(String Login) {
+     String s;
      s = "v1" + '\0' + "LOGN" + '\0' + Login + '\0';
      sendstring(s);
   }
Index: regapplet/Worker.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Worker.java,v
retrieving revision 1.3
diff -u -r1.3 Worker.java
--- regapplet/Worker.java	25 Feb 2002 16:40:23 -0000	1.3
+++ regapplet/Worker.java	27 Jun 2005 04:28:03 -0000
@@ -15,6 +15,7 @@
   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 @@
            case SENDLOGIN:
 	        applet.showLoginDiag();
 		break;
+	   case CONFIRMLOGIN:
+	        applet.showLoginConfirmDiag();
+		break;
 	   case SENDPASSWD:
 	        applet.showPassDiag();
 		break;
@@ -136,6 +140,10 @@
 	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("");
Index: regapplet/mybundle.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/mybundle.java,v
retrieving revision 1.7
diff -u -r1.7 mybundle.java
--- regapplet/mybundle.java	27 Feb 2003 20:56:47 -0000	1.7
+++ regapplet/mybundle.java	27 Jun 2005 11:16:35 -0000
@@ -16,6 +16,8 @@
     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.");
+    ht.put("logc1", "Are you sure you want to use this as your Athena username:");
+    ht.put("logc2", "If you choose to continue, this username will be registered for you without further confirmation, and CANNOT BE CHANGED.  Are you sure you would like to proceed?");
     ht.put("getp", "You need to invent a secret password to keep your work on Athena secure and private. Make it easy to remember, but something that others won't easily guess--don't use your name, your dog's name, your birthday, or a word from the dictionary.\nYou'll be able to change your password whenever you like. Passwords should be at least 6 characters long, and may contain UPPER- and lower-case letters, numbers, punctuation, and spaces. A good password might be:\n-- some initials, like \"GykoR-66\" for \"Get your kicks on Route 66.\"\n-- an easily pronounced nonsense word, like \"slaRooBey\" or \"krang-its\"\n-- a mis-spelled phrase, like \"2HotPeetzas\" or \"ItzAGurl\"\nTo help keep your new password secret, you won't see it while you're typing, so be sure to type carefully.\nNote: Your password (and everything else you type into this program) is encrypted when sent over the network.");
     ht.put("err","The registration server unexpectedly stopped communicating with us. This may indicate a temporary problem with the registration system, or with the network.\nPlease try again later. If this problem persists, contact the Athena User Accounts Office in N42-105A, x3-1325.");
     ht.put("err1","We were unable to contact the Athena Registration Server. This may indicate a temporary problem with the registration system, or with the network.\nPlease try again later. If this problem persists, contact the Athena User Accounts Office in N42-105A, x3-1325.");

home help back first fref pref prev next nref lref last post