]> WPIA git - gigi.git/commitdiff
ToS: replacement of CCA/ToS in AssuranceForm
authorINOPIAE <m.maengel@inopiae.de>
Mon, 16 May 2016 18:14:55 +0000 (20:14 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 9 Jun 2016 07:42:48 +0000 (09:42 +0200)
Change-Id: I76635ecbfc5a164f6509cec3262ff37e7db92b0e

src/org/cacert/gigi/pages/wot/AssuranceForm.java
src/org/cacert/gigi/pages/wot/AssuranceForm.templ
tests/org/cacert/gigi/pages/account/TestPasswordResetExternal.java
tests/org/cacert/gigi/pages/wot/TestAssurance.java

index 05aed3d2a465a2cd8e5d2d072a3f6e316d678342..6a9956d5539aee0a85bdb51e23b6ddaf1a3479aa 100644 (file)
@@ -109,9 +109,8 @@ public class AssuranceForm extends Form {
             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");
-
         }
         if ("1".equals(req.getParameter("passwordReset"))) {
             aword = req.getParameter("passwordResetValue");
index 73b102ecd673c80ab1d7709382f79579cdc8e045..2e346be390c18645e01a6f641549e06ee6dfefb4 100644 (file)
@@ -19,8 +19,8 @@
                <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><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>
-                       <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>
index 04b927a37a38f2e1a291061ef2569b6341315752..91456f59177b907f29becc41245589052e42d2e0 100644 (file)
@@ -28,7 +28,7 @@ public class TestPasswordResetExternal extends ClientTest {
         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);
index 3468f1f4c669b014b1847f65ec28173ad11bb837..260a88bdda720a0f079a136f59d26c2245ebeca1 100644 (file)
@@ -43,23 +43,23 @@ public class TestAssurance extends ManagedTest {
     @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");
-        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");
-        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");
-        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");
-        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 {
@@ -73,14 +73,14 @@ public class TestAssurance extends ManagedTest {
 
     @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);
-        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"));
@@ -91,7 +91,7 @@ public class TestAssurance extends ManagedTest {
     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());
     }
@@ -100,7 +100,7 @@ public class TestAssurance extends ManagedTest {
     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());
     }
@@ -134,7 +134,7 @@ public class TestAssurance extends ManagedTest {
 
         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) {
@@ -149,7 +149,7 @@ public class TestAssurance extends ManagedTest {
     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>"));
     }
 
@@ -160,42 +160,42 @@ public class TestAssurance extends ManagedTest {
         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 {
-        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>"));
-        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 {
-        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>"));
-        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 {
-        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>"));
-        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>"));
-        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>"));
-        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();
-        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);
@@ -207,7 +207,7 @@ public class TestAssurance extends ManagedTest {
     @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);