[1929] in Moira
regapplet changes for Sloan reg
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Feb 21 00:07:50 2002
Message-Id: <200202210507.AAA05836@brad-majors.mit.edu>
To: moiradev@MIT.EDU
Date: Thu, 21 Feb 2002 00:07:48 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
Sloan is doing entirely online admission for their MBA students
this year, and wants to avoid doing any personalized mailings
whatsoever, including no account coupon mailing. Instead, they want to
use the 9 digit PIN the incoming students chose when they applied online
as their preauthentication to register for their account. Susan and
Jeff had no problems with this, and it was pretty easy, so I implemented
it.
Here are the regapplet changes necessary. The help text in
mybundle.java might not be final; I'm waiting to hear back from vgifford
about it.
Garry
Index: Parser.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Parser.java,v
retrieving revision 1.2
diff -u -r1.2 Parser.java
--- Parser.java 1998/08/05 01:37:59 1.2
+++ Parser.java 2002/02/20 03:43:28
@@ -53,6 +53,14 @@
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: Regapplet.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Regapplet.java,v
retrieving revision 1.4
diff -u -r1.4 Regapplet.java
--- Regapplet.java 1999/07/29 01:10:30 1.4
+++ Regapplet.java 2002/02/20 04:46:19
@@ -58,6 +58,16 @@
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 @@
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 @@
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 @@
Word4.setText("");
Word5.setText("");
Word6.setText("");
+ Pin.setText("");
guesslogin = "";
}
@@ -371,6 +409,11 @@
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 @@
}
return true;
} else if ((evt.target == WordContButton) ||
+ (evt.target == PinContButton) ||
(evt.target == LoginContButton) ||
(evt.target == PasswordContButton) ||
(evt.target == NameContButton) ||
@@ -468,6 +512,7 @@
if (isStandalone) System.exit (0);
} else if (evt.target == NameCancelButton ||
evt.target == WordCancelButton ||
+ evt.target == PinCancelButton ||
evt.target == LoginCancelButton ||
evt.target == PasswordCancelButton) {
doBale();
Index: Sender.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Sender.java,v
retrieving revision 1.2
diff -u -r1.2 Sender.java
--- Sender.java 2001/02/04 02:49:43 1.2
+++ Sender.java 2002/02/20 03:13:48
@@ -63,6 +63,11 @@
+ 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: Worker.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/Worker.java,v
retrieving revision 1.2
diff -u -r1.2 Worker.java
--- Worker.java 1998/08/05 01:44:04 1.2
+++ Worker.java 2002/02/20 04:36:02
@@ -14,6 +14,7 @@
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 @@
case SENDWORDS:
applet.showWordsDiag();
break;
- case SENDNAME:
+ case SENDPIN:
+ applet.showPinDiag();
+ break;
+ case SENDNAME:
applet.showNameDiag();
break;
case SENDLOGIN:
@@ -123,6 +127,11 @@
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: mybundle.java
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/regapplet/regapplet/mybundle.java,v
retrieving revision 1.3
diff -u -r1.3 mybundle.java
--- mybundle.java 2000/09/19 19:24:35 1.3
+++ mybundle.java 2002/02/20 04:43:53
@@ -12,6 +12,7 @@
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.");