X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fmain%2FSignup.java;h=8cfaa2c498765e298a795331d62220306f702bd7;hp=5c68c38e1f3e0a9dfa06199c48fbeb6a6ada0e1a;hb=a62ba7752bf2a56c6325bc34fb1dce04d02323ff;hpb=15f6a8ada052ca217dc9203b32f9d1fdb2f27e17 diff --git a/src/club/wpia/gigi/pages/main/Signup.java b/src/club/wpia/gigi/pages/main/Signup.java index 5c68c38e..8cfaa2c4 100644 --- a/src/club/wpia/gigi/pages/main/Signup.java +++ b/src/club/wpia/gigi/pages/main/Signup.java @@ -8,6 +8,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; +import club.wpia.gigi.Gigi; import club.wpia.gigi.GigiApiException; import club.wpia.gigi.database.GigiPreparedStatement; import club.wpia.gigi.database.GigiResultSet; @@ -26,7 +27,6 @@ import club.wpia.gigi.pages.Page; import club.wpia.gigi.util.CalendarUtil; import club.wpia.gigi.util.HTMLEncoder; import club.wpia.gigi.util.Notary; -import club.wpia.gigi.util.PasswordStrengthChecker; import club.wpia.gigi.util.RateLimit.RateLimitException; public class Signup extends Form { @@ -114,9 +114,6 @@ public class Signup extends Form { 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.")); } - if ( !"1".equals(req.getParameter("tos_agree"))) { - ga.mergeInto(new GigiApiException("Acceptance of the ToS is required to continue.")); - } if (email.equals("")) { ga.mergeInto(new GigiApiException("Email Address was blank")); } @@ -127,13 +124,22 @@ public class Signup extends Form { } else if ( !pw1.equals(pw2)) { ga.mergeInto(new GigiApiException("Passwords don't match")); } - int pwpoints = PasswordStrengthChecker.checkpw(pw1, ni.getNamePartsPlain(), email); - if (pwpoints < 3) { - 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("!(/kb/goodPassword", "!''")))); + + if ( !"1".equals(req.getParameter("tos_agree"))) { + ga.mergeInto(new GigiApiException("Acceptance of the ToS is required to continue.")); + } + + if ( !"1".equals(req.getParameter("dp_agree"))) { + ga.mergeInto(new GigiApiException("Acceptance of the Data Protection Policy is required to continue.")); } + if ( !ga.isEmpty()) { throw ga; } + GigiApiException gaPassword = Gigi.getPasswordChecker().checkPassword(pw1, ni.getNamePartsPlain(), email); + if (gaPassword != null) { + throw gaPassword; + } GigiApiException ga2 = new GigiApiException(); try (GigiPreparedStatement q1 = new GigiPreparedStatement("SELECT * FROM `emails` WHERE `email`=? AND `deleted` IS NULL"); GigiPreparedStatement q2 = new GigiPreparedStatement("SELECT * FROM `certOwners` INNER JOIN `users` ON `users`.`id`=`certOwners`.`id` WHERE `email`=? AND `deleted` IS NULL")) { q1.setString(1, email); @@ -181,6 +187,7 @@ public class Signup extends Form { private void run(HttpServletRequest req, String password) throws GigiApiException { User u = new User(email, password, myDoB.getDate(), Page.getLanguage(req).getLocale(), cs.getCountry(), ni.getNameParts()); Notary.writeUserAgreement(u, "ToS", "account creation", "", true, 0); + Notary.writeUserAgreement(u, "Data Protection Policy", "account creation", "", true, 0); } }