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

src/org/cacert/gigi/pages/main/Signup.java
src/org/cacert/gigi/pages/main/Signup.templ
tests/org/cacert/gigi/pages/main/RegisterPageTest.java
tests/org/cacert/gigi/testUtils/ManagedTest.java

index f55c2fdc56e25d5deb1f1f07afe36ab308d1ba06..52fddbebbd2f022484ce61bc26b339701c5b569f 100644 (file)
@@ -98,8 +98,8 @@ public class Signup extends Form {
         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");
@@ -183,6 +183,7 @@ public class Signup extends Form {
             ps.setBoolean(5, radius);
             ps.execute();
         }
-        Notary.writeUserAgreement(u, "CCA", "account creation", "", true, 0);
+        Notary.writeUserAgreement(u, "ToS", "account creation", "", true, 0);
+
     }
 }
index c20ff0622352f49a3ef27691e321b193d08265ca..c9c18ccf07fcb63959efdb87918f6f5aac658c19 100644 (file)
@@ -73,7 +73,7 @@
     <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>
   </tr>
 
   <tr>
index 9e68c0ba77efc6ef847e8302339a8d35644bae6d..542de8b7b4503f451ffc316641fd8bf1969f9999 100644 (file)
@@ -29,7 +29,7 @@ public class RegisterPageTest extends ManagedTest {
         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&regional=1&radius=1";
         String data = fetchStartErrorMessage(runRegister(query));
@@ -53,71 +53,71 @@ public class RegisterPageTest extends ManagedTest {
 
     @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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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 {
-        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");
     }
 
     @Test
index 098c257f9adb7e6202bdfb72d1eed4a2f834a0b4..77418641e6c07fe72b66c703d9f57b4154a652ee 100644 (file)
@@ -258,7 +258,7 @@ public class ManagedTest extends ConfiguredTest {
 
     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) {