X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fmain%2FSignup.java;h=c5dcadf75c48585cf2912b5b6a00296befc8e690;hp=134df159bc13d9db8b479b89dadea7cba17c8a4b;hb=9d1ec1c5fd4d1d792c8507d88cab9330d4a6c487;hpb=bccd4cc0dba0f89aa045b113bac46eb8cc1dab4e diff --git a/src/club/wpia/gigi/pages/main/Signup.java b/src/club/wpia/gigi/pages/main/Signup.java index 134df159..c5dcadf7 100644 --- a/src/club/wpia/gigi/pages/main/Signup.java +++ b/src/club/wpia/gigi/pages/main/Signup.java @@ -2,6 +2,7 @@ package club.wpia.gigi.pages.main; import java.io.IOException; import java.io.PrintWriter; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -50,7 +51,7 @@ public class Signup extends Form { @Override public void outputContent(PrintWriter out, Language l, Map outerVars) { - HashMap vars = new HashMap(); + HashMap vars = new HashMap(outerVars); vars.put("name", ni); vars.put("dob", myDoB); vars.put("email", HTMLEncoder.encodeHTML(email)); @@ -58,7 +59,7 @@ public class Signup extends Form { vars.put("country", country ? " checked=\"checked\"" : ""); vars.put("regional", regional ? " checked=\"checked\"" : ""); vars.put("radius", radius ? " checked=\"checked\"" : ""); - vars.put("helpOnNames", String.format(l.getTranslation("Help on Names %sin the wiki%s"), "", "")); + vars.put("helpOnNames", new SprintfCommand("Help on Names {0}in the wiki{1}", Arrays.asList("!(/wiki/names", "!'"))); vars.put("csrf", getCSRFToken()); vars.put("dobmin", User.MINIMUM_AGE + ""); vars.put("countryCode", cs); @@ -119,7 +120,7 @@ public class Signup extends Form { ga.mergeInto(new GigiApiException("Entered date of birth is below the restricted age requirements.")); } - if (CalendarUtil.isOfAge(myDoB.getDate(), User.MAXIMUM_PLAUSIBLE_AGE)) { + if (CalendarUtil.isYearsInFuture(myDoB.getDate().end(), User.MAXIMUM_PLAUSIBLE_AGE)) { ga.mergeInto(new GigiApiException("Entered date of birth exceeds the maximum age set in our policies. Please check your DoB is correct and contact support if the issue persists.")); } @@ -132,13 +133,13 @@ public class Signup extends Form { String pw1 = req.getParameter("pword1"); String pw2 = req.getParameter("pword2"); if (pw1 == null || pw1.equals("")) { - ga.mergeInto(new GigiApiException("Pass Phrases were blank")); + ga.mergeInto(new GigiApiException("Passwords were blank")); } else if ( !pw1.equals(pw2)) { - ga.mergeInto(new GigiApiException("Pass Phrases don't match")); + ga.mergeInto(new GigiApiException("Passwords don't match")); } int pwpoints = PasswordStrengthChecker.checkpw(pw1, ni.getNamePartsPlain(), email); if (pwpoints < 3) { - ga.mergeInto(new GigiApiException("The Pass Phrase you submitted failed to contain enough" + " differing characters and/or contained words from" + " your name and/or email address.")); + ga.mergeInto(new GigiApiException(new SprintfCommand("The Password you submitted failed to contain enough differing characters and/or contained words from your name and/or email address. For the current requirements and to learn more, visit our {0}FAQ{1}.", Arrays.asList("!(/wiki/goodPassword", "!''")))); } if ( !ga.isEmpty()) { throw ga;