Draft for "Add mail certificate"
authorFelix Dörre <felix@dogcraft.de>
Tue, 8 Jul 2014 22:22:25 +0000 (00:22 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 10 Jul 2014 22:35:12 +0000 (00:35 +0200)
src/org/cacert/gigi/Gigi.java
src/org/cacert/gigi/pages/account/MailCertificateAdd.java [new file with mode: 0644]
src/org/cacert/gigi/pages/account/MailCertificateAdd.templ [new file with mode: 0644]
static/static/default.css
static/static/menu.js

index 4f51029c45b7f2db61441ac9e8b59241783ecc96..2ede0a525330db9fcade3e424f60a58268160743 100644 (file)
@@ -27,6 +27,7 @@ import org.cacert.gigi.pages.TestSecure;
 import org.cacert.gigi.pages.Verify;
 import org.cacert.gigi.pages.account.ChangePasswordPage;
 import org.cacert.gigi.pages.account.MailAdd;
+import org.cacert.gigi.pages.account.MailCertificateAdd;
 import org.cacert.gigi.pages.account.MailCertificates;
 import org.cacert.gigi.pages.account.MailOverview;
 import org.cacert.gigi.pages.account.MyDetails;
@@ -57,6 +58,7 @@ public class Gigi extends HttpServlet {
                pages.put(MyDetails.PATH, new MyDetails());
                pages.put(ChangePasswordPage.PATH, new ChangePasswordPage());
                pages.put(RegisterPage.PATH, new RegisterPage());
+               pages.put(MailCertificateAdd.PATH, new MailCertificateAdd());
                pages.put(MailOverview.DEFAULT_PATH, new MailOverview(
                                "My email addresses"));
                pages.put(MailAdd.DEFAULT_PATH, new MailAdd("Add new email"));
diff --git a/src/org/cacert/gigi/pages/account/MailCertificateAdd.java b/src/org/cacert/gigi/pages/account/MailCertificateAdd.java
new file mode 100644 (file)
index 0000000..7d8a877
--- /dev/null
@@ -0,0 +1,25 @@
+package org.cacert.gigi.pages.account;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.cacert.gigi.pages.Page;
+
+public class MailCertificateAdd extends Page {
+       public static final String PATH = "/account/certs/email/new";
+
+       public MailCertificateAdd() {
+               super("Create Email certificate");
+       }
+
+       @Override
+       public void doGet(HttpServletRequest req, HttpServletResponse resp)
+                       throws IOException {
+               HashMap<String, Object> vars = new HashMap<String, Object>();
+               getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
+       }
+
+}
diff --git a/src/org/cacert/gigi/pages/account/MailCertificateAdd.templ b/src/org/cacert/gigi/pages/account/MailCertificateAdd.templ
new file mode 100644 (file)
index 0000000..553ddda
--- /dev/null
@@ -0,0 +1,121 @@
+<h3><?=_CAcert Certificate Acceptable Use Policy?></h3>
+<p><?=_Once you decide to subscribe for an SSL Server Certificate you will need to complete this agreement. Please read it carefully. Your Certificate Request can only be processed with your acceptance and understanding of this agreement.?></p>
+
+<p><?=_I hereby represent that I am fully authorized by the owner of the information contained in the CSR sent to CAcert Inc. to apply for an Digital Certificate for secure and authenticated electronic transactions. I understand that a digital certificate serves to identify the Subscriber for the purposes of electronic communication and that the management of the private keys associated with such certificates is the responsibility of the subscriber's technical staff and/or contractors.?></p>
+
+<p><?=_CAcert Inc.'s public certification services are governed by a CPS as amended from time to time which is incorporated into this Agreement by reference. The Subscriber will use the SSL Server Certificate in accordance with CAcert Inc.'s CPS and supporting documentation published at?> <a href="http://www.cacert.org/cps.php">http://www.cacert.org/cps.php</a></p>
+
+<p><?=_If the Subscriber's name and/or domain name registration change the subscriber will immediately inform CAcert Inc. who shall revoke the digital certificate. When the Digital Certificate expires or is revoked the company will permanently remove the certificate from the server on which it is installed and will not use it for any purpose thereafter. The person responsible for key management and security is fully authorized to install and utilize the certificate to represent this organization's electronic presence.?></p>
+
+<form method="post" action="account.php">
+<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+  <tr>
+    <td colspan="2" class="title"><?=_New Client Certificate?></td>
+  </tr>
+  <tr>
+    <td class="DataTD"><?=_Add?></td>
+    <td class="DataTD"><?=_Address?></td>
+  </tr>
+<!-- For each mail -->
+  <tr>
+    <td class="DataTD"><input type="checkbox" id="addid<=intval($row['id'])>" name="addid[]" value="<=intval($row['id'])>"></td>
+    <td class="DataTD" align="left"><label for="addid<=intval($row['id'])>"><=sanitizeHTML($row['email'])></label></td>
+  </tr>
+<!-- For each mail -->
+<!-- if points > 50 -->
+  <tr>
+    <td class="DataTD" colspan="2" align="left">
+      <input type="radio" id="incname0" name="incname" value="0" checked="checked" />
+        <label for="incname0"><?=_No Name?></label><br />
+        <input type="radio" id="incname1" name="incname" value="1" />
+        <label for="incname1"><?=_Include?> 'fnamelname'</label><br />
+    </td>
+  </tr>
+
+  <tr>
+    <td class="DataTD">
+      <input type="checkbox" id="login" name="login" value="1" checked="checked" />
+    </td>
+    <td class="DataTD" align="left">
+      <label for="login"><?=_Enable certificate login with this certificate?><br />
+      <?=_By allowing certificate login, this certificate can be used to login into this account at https://secure.cacert.org/ .?></label>
+    </td>
+  </tr>
+  <tr>
+    <td class="DataTD" colspan="2" align="left">
+      <label for="description"><?=_Optional comment, only used in the certificate overview?></label><br />
+      <input type="text" id="description" name="description" maxlength="100" size="100" />
+    </td>
+  </tr>
+
+  <tr class="expertoff" style="display:none">
+    <td class="DataTD">
+      <input type="checkbox" id="expertbox" name="expertbox" onchange="showExpert(this.checked)" />
+    </td>
+    <td class="DataTD" align="left">
+      <label for="expertbox"><?=_Show advanced options?></label>
+    </td>
+  </tr>
+
+<!-- if >50 points -->
+  <tr class="expert">
+    <td class="DataTD" colspan="2" align="left">
+      <input type="radio" id="root1" name="rootcert" value="1" /> <label for="root1"><?=_Sign by class 1 root certificate?></label><br />
+      <input type="radio" id="root2" name="rootcert" value="2" checked="checked" /> <label for="root2"><?=_Sign by class 3 root certificate?></label><br />
+      <?=_Please note: If you use a certificate signed by the class 3 root, the class 3 root certificate needs to be imported into your email program as well as the class 1 root certificate so your email program can build a full trust path chain.?>
+    </td>
+  </tr>
+<!-- if >50 points -->
+
+  <tr class="expert">
+    <td class="DataTD" colspan="2" align="left">
+      <?=_Hash algorithm used when signing the certificate:?><br />
+      <!-- Hash algs!!! -->
+    </td>
+  </tr>
+
+<!-- if codesign -->
+  <tr class="expert">
+    <td class="DataTD">
+      <input type="checkbox" id="codesign" name="codesign" value="1" />
+    </td>
+    <td class="DataTD" align="left">
+      <label for="codesign"><?=_Code Signing?><br />
+      <?=_Please note: By ticking this box you will automatically have your name included in the certificate.?></label>
+    </td>
+  </tr>
+<!-- if codesign -->
+
+  <tr class="expert">
+    <td class="DataTD">
+      <input type="checkbox" id="SSO" name="SSO" value="1" />
+    </td>
+    <td class="DataTD" align="left">
+      <label for="SSO"><?=_Add Single Sign On ID Information?><br />
+      <?=_By adding Single Sign On (SSO) ID information to your certificates this could be used to track you, you can also issue certificates with no email addresses that are useful only for Authentication. Please see a more detailed description on our WIKI about it.?>
+      <a href="http://wiki.cacert.org/wiki/SSO"><?=_SSO WIKI Entry?></a></label>
+    </td>
+  </tr>
+
+  <tr class="expert">
+    <td class="DataTD" colspan="2">
+      <label for="optionalCSR"><?=_Optional Client CSR, no information on the certificate will be used?></label><br />
+      <textarea id="optionalCSR" name="optionalCSR" cols="80" rows="5"></textarea>
+    </td>
+  </tr>
+
+
+  <tr>
+    <td class="DataTD">
+      <input type="checkbox" id="CCA" name="CCA" />
+    </td>
+    <td class="DataTD" align="left">
+      <!--<label for="CCA"><strong>=s,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.?></label>
+    </td>
+  </tr>
+  <tr>
+    <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_Next?>" /></td>
+  </tr>
+</table>
+</form>
\ No newline at end of file
index fe09d6f322f4946fe66b93eb741b728e5d161c52..5372aa136525409dd3958abeca5710b2ccf65c59 100644 (file)
@@ -582,6 +582,7 @@ td.storyLeft {
        text-align: center;
        margin-left:auto;
        margin-right:auto;
+       width: 700px;
 }
 
 td.greytxt {
@@ -737,4 +738,10 @@ img{
 }
 formMandatory{
        color: red;
+}
+.experthidden{
+       display:none;   
+}
+.expertoff{
+       display:none;   
 }
\ No newline at end of file
index b73827eb6383bcff219200ee841e4b615a04ca97..12c3a30fe6ba5b73756fa5bcc350e7b1037f7ff1 100644 (file)
                        }
                }
        }
+       function showExpert(a)
+       {
+         b=document.getElementsByClassName("expert");
+         for(i=0;b.length>i;i++)
+         {
+           if(!a) {b[i].setAttribute("class","expert experthidden"); }
+           else {b[i].setAttribute("class","expert");}
+         }
+         b=document.getElementsByClassName("expertoff");
+         for(i=0;b.length>i;i++)
+         {
+          b[i].setAttribute("class","");
+         }
+
+       }
+       function init(){
+               initMenu();
+               showExpert(false);
+               var expert = document.getElementById("expertbox");
+               if(expert !== null) {
+                       expert.onchange = (function(expert){return function(){showExpert(expert.checked)}})(expert);
+               }
+       }
        (function(oldLoad) {
                if (oldLoad == undefined) {
-                       window.onload = initMenu;
+                       window.onload = init;
                } else {
                        window.onload = function() {
-                               initMenu();
+                               init();
                                oldLoad();
                        }
                }