From: zacheiss Date: Mon, 25 Feb 2002 16:40:23 +0000 (+0000) Subject: Add a "PIN" screen that's an alternative to the six words screen; X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/c05c41a2e5e0bd746b5d26fcadf453e75b157469 Add a "PIN" screen that's an alternative to the six words screen; functionality requested by Sloan so they don't need to do personalized mailings to get the account coupon to incoming students. --- diff --git a/clients/regapplet/regapplet/Parser.java b/clients/regapplet/regapplet/Parser.java index 1353bc1e..26eba26e 100644 --- a/clients/regapplet/regapplet/Parser.java +++ b/clients/regapplet/regapplet/Parser.java @@ -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]; diff --git a/clients/regapplet/regapplet/Regapplet.java b/clients/regapplet/regapplet/Regapplet.java index e1751414..d8ebba7a 100755 --- a/clients/regapplet/regapplet/Regapplet.java +++ b/clients/regapplet/regapplet/Regapplet.java @@ -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(); diff --git a/clients/regapplet/regapplet/Sender.java b/clients/regapplet/regapplet/Sender.java index f08edc40..7fb599cd 100644 --- a/clients/regapplet/regapplet/Sender.java +++ b/clients/regapplet/regapplet/Sender.java @@ -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'; diff --git a/clients/regapplet/regapplet/Worker.java b/clients/regapplet/regapplet/Worker.java index f3aded9d..61e3eaef 100644 --- a/clients/regapplet/regapplet/Worker.java +++ b/clients/regapplet/regapplet/Worker.java @@ -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()); diff --git a/clients/regapplet/regapplet/mybundle.java b/clients/regapplet/regapplet/mybundle.java index ec42c874..bbf3bb07 100644 --- a/clients/regapplet/regapplet/mybundle.java +++ b/clients/regapplet/regapplet/mybundle.java @@ -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.");