Change-Id: I76635ecbfc5a164f6509cec3262ff37e7db92b0e
outputError(out, req, "You need to enter location and date!");
}
outputError(out, req, "You need to enter location and date!");
}
- if ( !"1".equals(req.getParameter("certify")) || !"1".equals(req.getParameter("rules")) || !"1".equals(req.getParameter("CCAAgreed")) || !"1".equals(req.getParameter("assertion"))) {
+ if ( !"1".equals(req.getParameter("certify")) || !"1".equals(req.getParameter("rules")) || !"1".equals(req.getParameter("tos_agree")) || !"1".equals(req.getParameter("assertion"))) {
outputError(out, req, "You failed to check all boxes to validate" + " your adherence to the rules and policies of SomeCA");
outputError(out, req, "You failed to check all boxes to validate" + " your adherence to the rules and policies of SomeCA");
}
if ("1".equals(req.getParameter("passwordReset"))) {
aword = req.getParameter("passwordResetValue");
}
if ("1".equals(req.getParameter("passwordReset"))) {
aword = req.getParameter("passwordResetValue");
<td><?=_I certify that ${name} has appeared in person.?></td>
</tr>
<tr>
<td><?=_I certify that ${name} has appeared in person.?></td>
</tr>
<tr>
- <td><input type="checkbox" name="CCAAgreed" value="1"></td>
- <td><?=_I verify that ${name} has accepted the SomeCA Community Agreement.?></td>
+ <td><input type="checkbox" name="tos_agree" value="1"></td>
+ <td><?=_I verify that ${name} has accepted the Terms of Service (!'<a href="/policy/TermsOfService.html">'ToS!'</a>').?></td>
</tr>
<tr>
<td><?=_Location?></td>
</tr>
<tr>
<td><?=_Location?></td>
</tr>
<tr>
<td><input type="checkbox" name="rules" value="1"></td>
</tr>
<tr>
<td><input type="checkbox" name="rules" value="1"></td>
- <td><?=_I have read and understood the SomeCA Community Agreement (CCA), Assurance Policy and the Assurance Handbook. I am making this Assurance subject to and in compliance with the CCA, Assurance policy and handbook.?></td>
+ <td><?=_I have read and understood the Terms of Service (!'<a href="/policy/TermsOfService.html">'ToS!'</a>'), Assurance Policy and the Assurance Handbook. I am making this Assurance subject to and in compliance with the ToS, Assurance policy and handbook.?></td>
</tr>
<tr>
<td><?=_Policy?>: </td>
<td>
</tr>
<tr>
<td><?=_Policy?>: </td>
<td>
- <a href="/policy/CAcertCommunityAgreement.php" target="_blank"><?=_CAcert Community Agreement?></a>
+ <a href="/policy/TermsOfService.html" target="_blank"><?=_Terms of Service?></a>
- <a href="/policy/AssurancePolicy.php" target="_blank"><?=_Assurance Policy?></a>
- <a href="http://wiki.cacert.org/AssuranceHandbook2" target="_blank"><?=_Assurance Handbook?></a>
</td>
- <a href="/policy/AssurancePolicy.php" target="_blank"><?=_Assurance Policy?></a>
- <a href="http://wiki.cacert.org/AssuranceHandbook2" target="_blank"><?=_Assurance Handbook?></a>
</td>
String cookie2 = login(u.getEmail(), TEST_PASSWORD);
URLConnection uc = TestAssurance.buildupAssureFormConnection(cookie2, email, true);
String avalue = RandomToken.generateToken(32);
String cookie2 = login(u.getEmail(), TEST_PASSWORD);
URLConnection uc = TestAssurance.buildupAssureFormConnection(cookie2, email, true);
String avalue = RandomToken.generateToken(32);
- uc.getOutputStream().write(("date=1910-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10&passwordReset=1&passwordResetValue=" + URLEncoder.encode(avalue, "UTF-8")).getBytes("UTF-8"));
+ uc.getOutputStream().write(("date=1910-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10&passwordReset=1&passwordResetValue=" + URLEncoder.encode(avalue, "UTF-8")).getBytes("UTF-8"));
uc.getOutputStream().flush();
String error = fetchStartErrorMessage(IOUtils.readURL(uc));
assertNull(error);
uc.getOutputStream().flush();
String error = fetchStartErrorMessage(IOUtils.readURL(uc));
assertNull(error);
@Test
public void testAssureSearch() throws IOException {
String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910");
@Test
public void testAssureSearch() throws IOException {
String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910");
- assertTrue(loc, loc.contains("type=\"checkbox\" name=\"CCAAgreed\""));
+ assertTrue(loc, loc.contains("type=\"checkbox\" name=\"tos_agree\""));
}
@Test
public void testAssureSearchEmail() throws IOException {
String loc = search("email=1" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910");
}
@Test
public void testAssureSearchEmail() throws IOException {
String loc = search("email=1" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1910");
- assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"CCAAgreed\""));
+ assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"tos_agree\""));
}
@Test
public void testAssureSearchDob() throws IOException {
String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=2&month=1&year=1910");
}
@Test
public void testAssureSearchDob() throws IOException {
String loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=2&month=1&year=1910");
- assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"CCAAgreed\""));
+ assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"tos_agree\""));
loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=2&year=1910");
loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=2&year=1910");
- assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"CCAAgreed\""));
+ assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"tos_agree\""));
loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1911");
loc = search("email=" + URLEncoder.encode(assureeM, "UTF-8") + "&day=1&month=1&year=1911");
- assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"CCAAgreed\""));
+ assertTrue(loc, !loc.contains("type=\"checkbox\" name=\"tos_agree\""));
}
private String search(String query) throws MalformedURLException, IOException, UnsupportedEncodingException {
}
private String search(String query) throws MalformedURLException, IOException, UnsupportedEncodingException {
@Test
public void testAssureForm() throws IOException {
@Test
public void testAssureForm() throws IOException {
- String error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertNull(error);
}
@Test
public void testAssureFormContanisData() throws IOException {
URLConnection uc = buildupAssureFormConnection(true);
assertNull(error);
}
@Test
public void testAssureFormContanisData() throws IOException {
URLConnection uc = buildupAssureFormConnection(true);
- uc.getOutputStream().write(("date=2000-01-01&location=testcase&rules=1&CCAAgreed=1&assertion=1&points=10").getBytes("UTF-8"));
+ uc.getOutputStream().write(("date=2000-01-01&location=testcase&rules=1&tos_agree=1&assertion=1&points=10").getBytes("UTF-8"));
uc.getOutputStream().flush();
String data = IOUtils.readURL(uc);
assertThat(data, containsString("2000-01-01"));
uc.getOutputStream().flush();
String data = IOUtils.readURL(uc);
assertThat(data, containsString("2000-01-01"));
public void testAssureFormNoCSRF() throws IOException {
// override csrf
HttpURLConnection uc = (HttpURLConnection) buildupAssureFormConnection(false);
public void testAssureFormNoCSRF() throws IOException {
// override csrf
HttpURLConnection uc = (HttpURLConnection) buildupAssureFormConnection(false);
- uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10").getBytes("UTF-8"));
+ uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10").getBytes("UTF-8"));
uc.getOutputStream().flush();
assertEquals(500, uc.getResponseCode());
}
uc.getOutputStream().flush();
assertEquals(500, uc.getResponseCode());
}
public void testAssureFormWrongCSRF() throws IOException {
// override csrf
HttpURLConnection uc = (HttpURLConnection) buildupAssureFormConnection(false);
public void testAssureFormWrongCSRF() throws IOException {
// override csrf
HttpURLConnection uc = (HttpURLConnection) buildupAssureFormConnection(false);
- uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10&csrf=aragc").getBytes("UTF-8"));
+ uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10&csrf=aragc").getBytes("UTF-8"));
uc.getOutputStream().flush();
assertEquals(500, uc.getResponseCode());
}
uc.getOutputStream().flush();
assertEquals(500, uc.getResponseCode());
}
assertNull(executeBasicWebInteraction(assureeCookie, MyDetails.PATH, newName + "&" + newDob + "&processDetails", 0));
assertNull(executeBasicWebInteraction(assureeCookie, MyDetails.PATH, newName + "&" + newDob + "&processDetails", 0));
- uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10").getBytes("UTF-8"));
+ uc.getOutputStream().write(("date=2000-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10").getBytes("UTF-8"));
uc.getOutputStream().flush();
String error = fetchStartErrorMessage(IOUtils.readURL(uc));
if (succeed) {
uc.getOutputStream().flush();
String error = fetchStartErrorMessage(IOUtils.readURL(uc));
if (succeed) {
public void testAssureFormFuture() throws IOException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
int year = Integer.parseInt(sdf.format(new Date(System.currentTimeMillis()))) + 2;
public void testAssureFormFuture() throws IOException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
int year = Integer.parseInt(sdf.format(new Date(System.currentTimeMillis()))) + 2;
- String error = getError("date=" + year + "-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=" + year + "-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
}
assertTrue(error, !error.startsWith("</div>"));
}
c.setTimeInMillis(System.currentTimeMillis());
c.add(Calendar.HOUR_OF_DAY, 12);
c.setTimeInMillis(System.currentTimeMillis());
c.add(Calendar.HOUR_OF_DAY, 12);
- String error = getError("date=" + sdf.format(new Date(c.getTimeInMillis())) + "&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=" + sdf.format(new Date(c.getTimeInMillis())) + "&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertNull(error);
}
@Test
public void testAssureFormNoLoc() throws IOException {
assertNull(error);
}
@Test
public void testAssureFormNoLoc() throws IOException {
- String error = getError("date=2000-01-01&location=a&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=2000-01-01&location=a&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ error = getError("date=2000-01-01&location=&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
}
@Test
public void testAssureFormInvalDate() throws IOException {
assertTrue(error, !error.startsWith("</div>"));
}
@Test
public void testAssureFormInvalDate() throws IOException {
- String error = getError("date=20000101&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=20000101&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ error = getError("date=&location=testcase&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
}
@Test
public void testAssureFormBoxes() throws IOException {
assertTrue(error, !error.startsWith("</div>"));
}
@Test
public void testAssureFormBoxes() throws IOException {
- String error = getError("date=2000-01-01&location=testcase&certify=0&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=2000-01-01&location=testcase&certify=0&rules=1&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=testcase&certify=1&rules=&CCAAgreed=1&assertion=1&points=10");
+ error = getError("date=2000-01-01&location=testcase&certify=1&rules=&tos_agree=1&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=a&assertion=1&points=10");
+ error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&tos_agree=a&assertion=1&points=10");
assertTrue(error, !error.startsWith("</div>"));
assertTrue(error, !error.startsWith("</div>"));
- error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&CCAAgreed=1&assertion=z&points=10");
+ error = getError("date=2000-01-01&location=testcase&certify=1&rules=1&tos_agree=1&assertion=z&points=10");
assertTrue(error, !error.startsWith("</div>"));
}
@Test
public void testAssureListingValid() throws IOException {
String uniqueLoc = createUniqueName();
assertTrue(error, !error.startsWith("</div>"));
}
@Test
public void testAssureListingValid() throws IOException {
String uniqueLoc = createUniqueName();
- String error = getError("date=2000-01-01&location=" + uniqueLoc + "&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=2000-01-01&location=" + uniqueLoc + "&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertNull(error);
String cookie = login(assureeM, TEST_PASSWORD);
URLConnection url = get(cookie, MyPoints.PATH);
assertNull(error);
String cookie = login(assureeM, TEST_PASSWORD);
URLConnection url = get(cookie, MyPoints.PATH);
@Test
public void testAssurerListingValid() throws IOException {
String uniqueLoc = createUniqueName();
@Test
public void testAssurerListingValid() throws IOException {
String uniqueLoc = createUniqueName();
- String error = getError("date=2000-01-01&location=" + uniqueLoc + "&certify=1&rules=1&CCAAgreed=1&assertion=1&points=10");
+ String error = getError("date=2000-01-01&location=" + uniqueLoc + "&certify=1&rules=1&tos_agree=1&assertion=1&points=10");
assertNull(error);
String cookie = login(assurerM, TEST_PASSWORD);
URLConnection url = get(cookie, MyPoints.PATH);
assertNull(error);
String cookie = login(assurerM, TEST_PASSWORD);
URLConnection url = get(cookie, MyPoints.PATH);