add: fix own host name on certificate issue page
authorFelix Dörre <felix@dogcraft.de>
Tue, 10 Jan 2017 21:44:36 +0000 (22:44 +0100)
committerFelix Dörre <felix@dogcraft.de>
Thu, 12 Jan 2017 08:30:43 +0000 (09:30 +0100)
Change-Id: I7fa0e2df8afbe78017067ef8e80c9ecf3a07ca68

src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.java
src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.templ

index 8b9272c..3e2d805 100644 (file)
@@ -21,10 +21,13 @@ import org.cacert.gigi.output.CertificateValiditySelector;
 import org.cacert.gigi.output.HashAlgorithms;
 import org.cacert.gigi.output.template.Form;
 import org.cacert.gigi.output.template.IterableDataset;
+import org.cacert.gigi.output.template.Outputable;
 import org.cacert.gigi.output.template.Template;
 import org.cacert.gigi.pages.LoginPage;
 import org.cacert.gigi.util.AuthorizationContext;
+import org.cacert.gigi.util.HTMLEncoder;
 import org.cacert.gigi.util.RandomToken;
+import org.cacert.gigi.util.ServerConstants;
 
 /**
  * This class represents a form that is used for issuing certificates. This
@@ -161,6 +164,15 @@ public class CertificateIssueForm extends Form {
             vars2.put("orga", "true");
             vars2.put("department", cr.getOu());
         }
+        vars2.put("secureHostname", new Outputable() {
+
+            @Override
+            public void output(PrintWriter out, Language l, Map<String, Object> vars) {
+                out.print("<code>");
+                out.print(HTMLEncoder.encodeHTML("https://" + ServerConstants.getSecureHostNamePortSecure()));
+                out.print("</code>");
+            }
+        });
         vars2.put("validity", issueDate);
         vars2.put("emails", content.toString());
         vars2.put("hashs", new HashAlgorithms(cr.getSelectedDigest()));
index 703bd98..5fe3de0 100644 (file)
@@ -91,7 +91,7 @@
     </td>
     <td align="left">
       <label for="login"><?=_Enable certificate login with this certificate?></label><br />
-      <span><?=_By allowing certificate login, this certificate can be used to log into this account at !'<code>https://secure.cacert.org/</code>'.?><br />
+      <span><?=_By allowing certificate login, this certificate can be used to log into this account at ${secureHostname}.?><br />
       <?=_Recommendation: Have at least one client certificate for login enabled.?></span>
     </td>
   </tr>