From acefeb68c1d31b5c6894bb12535c4257d29d3155 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Wed, 11 Oct 2017 08:29:26 +0200 Subject: [PATCH] chg: improve information about password strength Change-Id: Ib9ef93fd4961df8bbc6bd667af8d1e0b5f49d602 --- src/club/wpia/gigi/pages/PasswordResetForm.templ | 2 +- src/club/wpia/gigi/pages/account/ChangePasswordForm.templ | 2 +- src/club/wpia/gigi/pages/main/RegisterPage.templ | 2 +- src/club/wpia/gigi/pages/main/Signup.java | 2 +- src/club/wpia/gigi/pages/main/Signup.templ | 2 +- src/club/wpia/gigi/util/PasswordStrengthChecker.java | 4 +++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/club/wpia/gigi/pages/PasswordResetForm.templ b/src/club/wpia/gigi/pages/PasswordResetForm.templ index b4ac1e92..a0e46a4f 100644 --- a/src/club/wpia/gigi/pages/PasswordResetForm.templ +++ b/src/club/wpia/gigi/pages/PasswordResetForm.templ @@ -18,7 +18,7 @@ - *'.?> + *'.?> diff --git a/src/club/wpia/gigi/pages/account/ChangePasswordForm.templ b/src/club/wpia/gigi/pages/account/ChangePasswordForm.templ index c77f7434..0fd8f76a 100644 --- a/src/club/wpia/gigi/pages/account/ChangePasswordForm.templ +++ b/src/club/wpia/gigi/pages/account/ChangePasswordForm.templ @@ -18,7 +18,7 @@ - *'.?> + *'.?> diff --git a/src/club/wpia/gigi/pages/main/RegisterPage.templ b/src/club/wpia/gigi/pages/main/RegisterPage.templ index 2cfc3329..29c8219e 100644 --- a/src/club/wpia/gigi/pages/main/RegisterPage.templ +++ b/src/club/wpia/gigi/pages/main/RegisterPage.templ @@ -6,5 +6,5 @@

-'.?> +'.?>

diff --git a/src/club/wpia/gigi/pages/main/Signup.java b/src/club/wpia/gigi/pages/main/Signup.java index 746fd803..07d7f912 100644 --- a/src/club/wpia/gigi/pages/main/Signup.java +++ b/src/club/wpia/gigi/pages/main/Signup.java @@ -139,7 +139,7 @@ public class Signup extends Form { } 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 Pass Phrase 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; diff --git a/src/club/wpia/gigi/pages/main/Signup.templ b/src/club/wpia/gigi/pages/main/Signup.templ index a6ae2b1b..466eaaa3 100644 --- a/src/club/wpia/gigi/pages/main/Signup.templ +++ b/src/club/wpia/gigi/pages/main/Signup.templ @@ -43,7 +43,7 @@ - *'.?> + *'.?> diff --git a/src/club/wpia/gigi/util/PasswordStrengthChecker.java b/src/club/wpia/gigi/util/PasswordStrengthChecker.java index 21aa533f..39a8580d 100644 --- a/src/club/wpia/gigi/util/PasswordStrengthChecker.java +++ b/src/club/wpia/gigi/util/PasswordStrengthChecker.java @@ -1,11 +1,13 @@ package club.wpia.gigi.util; +import java.util.Arrays; import java.util.TreeSet; import java.util.regex.Pattern; import club.wpia.gigi.GigiApiException; import club.wpia.gigi.dbObjects.Name; import club.wpia.gigi.dbObjects.NamePart; +import club.wpia.gigi.output.template.SprintfCommand; public class PasswordStrengthChecker { @@ -78,7 +80,7 @@ public class PasswordStrengthChecker { } } if (checkpw(pw, parts.toArray(new String[parts.size()]), email) < 3) { - throw new GigiApiException("The Pass Phrase you submitted failed to contain enough" + " differing characters and/or contained words from" + " your name and/or email address."); + throw (new GigiApiException(new SprintfCommand("The Pass Phrase you submitted failed to contain enough differing characters and/or contained words from your name and/or email address. For the current requirements, visit our {0}FAQ{1}.", Arrays.asList("!(/wiki/goodPassword", "!''")))); } } -- 2.39.2