Change-Id: Iac7db28c894766efbbd61025d93d4799c845b5df
if ( !myDoB.isValid()) {
outputError(out, req, "Invalid date of birth");
}
if ( !myDoB.isValid()) {
outputError(out, req, "Invalid date of birth");
}
- if ( !"1".equals(req.getParameter("cca_agree"))) {
- outputError(out, req, "You have to agree to the SomeCA Community agreement.");
+ if ( !"1".equals(req.getParameter("tos_agree"))) {
+ outputError(out, req, "Acceptance of the ToS is required to continue.");
}
if (email.equals("")) {
outputError(out, req, "Email Address was blank");
}
if (email.equals("")) {
outputError(out, req, "Email Address was blank");
ps.setBoolean(5, radius);
ps.execute();
}
ps.setBoolean(5, radius);
ps.execute();
}
- Notary.writeUserAgreement(u, "CCA", "account creation", "", true, 0);
+ Notary.writeUserAgreement(u, "ToS", "account creation", "", true, 0);
+
<td colspan="3"><?=_When you click on next, we will send a confirmation email to the email address you have entered above.?></td>
</tr>
<tr>
<td colspan="3"><?=_When you click on next, we will send a confirmation email to the email address you have entered above.?></td>
</tr>
<tr>
- <td colspan="3"><input type="checkbox" name="cca_agree" value="1"><?=_I agree to the terms and conditions of the SomeCA Community Agreement?>: <a href="/policy/CAcertCommunityAgreement.php">http://www.cacert.org/policy/CAcertCommunityAgreement.php</a></td>
+ <td colspan="3"><input type="checkbox" name="tos_agree" value="1"><?=_I agree to the Terms of Service (!'<a href="/policy/TermsOfService.html">'ToS!'</a>').?></td>
registerUser("ab", "b", "correct" + uniq + "@email.de", TEST_PASSWORD);
assertSuccessfullRegMail();
registerUser("ab", "b", "correct" + uniq + "@email.de", TEST_PASSWORD);
assertSuccessfullRegMail();
- String defaultSignup = "fname=" + URLEncoder.encode("ab", "UTF-8") + "&lname=" + URLEncoder.encode("b", "UTF-8") + "&pword1=" + URLEncoder.encode(TEST_PASSWORD, "UTF-8") + "&pword2=" + URLEncoder.encode(TEST_PASSWORD, "UTF-8") + "&day=1&month=1&year=1910&cca_agree=1&mname=mn&suffix=sf&email=";
+ String defaultSignup = "fname=" + URLEncoder.encode("ab", "UTF-8") + "&lname=" + URLEncoder.encode("b", "UTF-8") + "&pword1=" + URLEncoder.encode(TEST_PASSWORD, "UTF-8") + "&pword2=" + URLEncoder.encode(TEST_PASSWORD, "UTF-8") + "&day=1&month=1&year=1910&tos_agree=1&mname=mn&suffix=sf&email=";
String query = defaultSignup + URLEncoder.encode("correct3_" + uniq + "@email.de", "UTF-8") + "&general=1&country=1®ional=1&radius=1";
String data = fetchStartErrorMessage(runRegister(query));
String query = defaultSignup + URLEncoder.encode("correct3_" + uniq + "@email.de", "UTF-8") + "&general=1&country=1®ional=1&radius=1";
String data = fetchStartErrorMessage(runRegister(query));
@Test
public void testNoFname() throws IOException {
@Test
public void testNoFname() throws IOException {
- testFailedForm("lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=1910&cca_agree=1");
+ testFailedForm("lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=1910&tos_agree=1");
}
@Test
public void testNoLname() throws IOException {
}
@Test
public void testNoLname() throws IOException {
- testFailedForm("fname=a&email=e&pword1=ap&pword2=ap&day=1&month=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&email=e&pword1=ap&pword2=ap&day=1&month=1&year=1910&tos_agree=1");
}
@Test
public void testNoEmail() throws IOException {
}
@Test
public void testNoEmail() throws IOException {
- testFailedForm("fname=a&lname=b&pword1=ap&pword2=ap&day=1&month=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&pword1=ap&pword2=ap&day=1&month=1&year=1910&tos_agree=1");
}
@Test
public void testNoPword() throws IOException {
}
@Test
public void testNoPword() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword2=ap&day=1&month=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword2=ap&day=1&month=1&year=1910&tos_agree=1");
}
@Test
public void testDiffPword() throws IOException {
}
@Test
public void testDiffPword() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap2&day=1&month=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap2&day=1&month=1&year=1910&tos_agree=1");
}
@Test
public void testNoDay() throws IOException {
}
@Test
public void testNoDay() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&month=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&month=1&year=1910&tos_agree=1");
}
@Test
public void testNoMonth() throws IOException {
}
@Test
public void testNoMonth() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&year=1910&tos_agree=1");
}
@Test
public void testNoYear() throws IOException {
}
@Test
public void testNoYear() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&tos_agree=1");
}
@Test
public void testInvDay() throws IOException {
}
@Test
public void testInvDay() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=40&month=1&year=1910&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=0&month=1&year=1910&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=-1&month=1&year=1910&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=a&month=1&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=40&month=1&year=1910&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=0&month=1&year=1910&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=-1&month=1&year=1910&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=a&month=1&year=1910&tos_agree=1");
}
@Test
public void testInvMonth() throws IOException {
}
@Test
public void testInvMonth() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=20&year=1910&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=0&year=1910&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=-1&year=1910&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=a&year=1910&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=20&year=1910&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=0&year=1910&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=-1&year=1910&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=a&year=1910&tos_agree=1");
}
@Test
public void testInvYear() throws IOException {
}
@Test
public void testInvYear() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=0&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=100&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=a&cca_agree=1");
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=-1&cca_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=0&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=100&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=a&tos_agree=1");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=-1&tos_agree=1");
}
@Test
public void testNoAgree() throws IOException {
}
@Test
public void testNoAgree() throws IOException {
- testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=1910&cca_agree=a");
+ testFailedForm("fname=a&lname=b&email=e&pword1=ap&pword2=ap&day=1&month=1&year=1910&tos_agree=a");
public static void registerUser(String firstName, String lastName, String email, String password) {
try {
public static void registerUser(String firstName, String lastName, String email, String password) {
try {
- String query = "fname=" + URLEncoder.encode(firstName, "UTF-8") + "&lname=" + URLEncoder.encode(lastName, "UTF-8") + "&email=" + URLEncoder.encode(email, "UTF-8") + "&pword1=" + URLEncoder.encode(password, "UTF-8") + "&pword2=" + URLEncoder.encode(password, "UTF-8") + "&day=1&month=1&year=1910&cca_agree=1";
+ String query = "fname=" + URLEncoder.encode(firstName, "UTF-8") + "&lname=" + URLEncoder.encode(lastName, "UTF-8") + "&email=" + URLEncoder.encode(email, "UTF-8") + "&pword1=" + URLEncoder.encode(password, "UTF-8") + "&pword2=" + URLEncoder.encode(password, "UTF-8") + "&day=1&month=1&year=1910&tos_agree=1";
String data = fetchStartErrorMessage(runRegister(query));
assertNull(data);
} catch (UnsupportedEncodingException e) {
String data = fetchStartErrorMessage(runRegister(query));
assertNull(data);
} catch (UnsupportedEncodingException e) {