]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.java
chg: Avoid dirtying the environment with Thread Interruption exceptions if nobody...
[gigi.git] / src / org / cacert / gigi / pages / account / certs / CertificateIssueForm.java
index 5712190bcd8f84e66329637fd9644e1e78806abe..eecb31fe786a5e7373ee7445462af5e5446661c2 100644 (file)
@@ -75,13 +75,11 @@ public class CertificateIssueForm extends Form {
 
                     try {
                         cr.update(req.getParameter("CN"), req.getParameter("hash_alg"), req.getParameter("profile"), //
-                                req.getParameter("org"), req.getParameter("OU"), req.getParameter("SANs"), out, req);
+                                req.getParameter("org"), req.getParameter("OU"), req.getParameter("SANs"));
                     } catch (GigiApiException e) {
                         error.mergeInto(e);
                     }
-                    if (req.getParameter("CCA") == null) {
-                        error.mergeInto(new GigiApiException("You need to accept the CCA."));
-                    }
+
                     Certificate result = null;
                     try {
                         result = cr.draft();
@@ -106,8 +104,6 @@ public class CertificateIssueForm extends Form {
             } catch (GeneralSecurityException e) {
                 e.printStackTrace();
                 throw new GigiApiException("Certificate Request format is invalid.");
-            } catch (InterruptedException e) {
-                e.printStackTrace();
             }
         } catch (GigiApiException e) {
             e.format(out, Page.getLanguage(req));
@@ -132,7 +128,6 @@ public class CertificateIssueForm extends Form {
     @Override
     protected void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
         HashMap<String, Object> vars2 = new HashMap<String, Object>(vars);
-        vars2.put("CCA", "<a href='/policy/CAcertCommunityAgreement.html'>CCA</a>");
 
         StringBuffer content = new StringBuffer();
         for (SubjectAlternateName SAN : cr.getSANs()) {
@@ -152,16 +147,19 @@ public class CertificateIssueForm extends Form {
         vars2.put("hashs", new HashAlgorithms(cr.getSelectedDigest()));
         vars2.put("profiles", new IterableDataset() {
 
-            int i = 1;
+            CertificateProfile[] cps = CertificateProfile.getAll();
+
+            int i = 0;
 
             @Override
             public boolean next(Language l, Map<String, Object> vars) {
                 CertificateProfile cp;
                 do {
-                    cp = CertificateProfile.getById(i++);
-                    if (cp == null) {
+                    if (i >= cps.length) {
                         return false;
                     }
+                    cp = cps[i];
+                    i++;
                 } while ( !cp.canBeIssuedBy(c.getTarget(), c.getActor()));
 
                 if (cp.getId() == cr.getProfile().getId()) {