bug 1123: implement CCA acception for client certs
authorBenny Baumann <BenBE@geshi.org>
Sun, 14 Jul 2013 20:26:44 +0000 (22:26 +0200)
committerBenny Baumann <BenBE@geshi.org>
Sun, 14 Jul 2013 20:26:44 +0000 (22:26 +0200)
includes/account.php
pages/account/3.php

index 05b07a7..0899ba6 100644 (file)
@@ -18,6 +18,7 @@
        require_once("../includes/loggedin.php");
        require_once("../includes/lib/l10n.php");
        require_once('lib/check_weak_key.php');
+       require_once('notary.inc.php');
 
        loadem("account");
 
 
        if($process != "" && $oldid == 3)
        {
+               if(!array_key_exists('CCA',$_REQUEST))
+               {
+                       showheader(_("My CAcert.org Account!"));
+                       echo _("You did not accept the CAcert Community Agreement (CCA), hit the back button and try again.");
+                       showfooter();
+                       exit;
+               }
+
                if(!(array_key_exists('addid',$_REQUEST) && is_array($_REQUEST['addid'])) && $_REQUEST['SSO'] != '1')
                {
                        showheader(_("My CAcert.org Account!"));
                                exit;
                        }
 
+                       write_user_agreement(intval($_SESSION['profile']['id']), "CCA", "certificate creation", "", 1);
+
                        $query = "insert into emailcerts set
                                                `CN`='$defaultemail',
                                                `keytype`='NS',
index 87484f9..2402ae4 100644 (file)
@@ -114,6 +114,15 @@ if($_SESSION['profile']['points'] >= 50)
  <tr name="expert">
     <td class="DataTD" colspan="2"><textarea name="optionalCSR" cols="80" rows="5"></textarea></td>
  </tr>
+   <tr>
+    <td class="DataTD">
+      <input type="checkbox" name="CCA"" />
+    </td>
+    <td class="DataTD" align="left">
+      <strong><?=sprintf(_("I accept the CAcert Community Agreement (%s)."),"<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>")?></strong><br />
+        <?=_("Please Note: You need to accept the CCA to proceed.")?>
+    </td>
+  </tr>
  <tr>
     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td>
   </tr>