payment: note that Stripe has instituted an additional 1% fee for non-US cards
[hcoop/portal.git] / cert.mlt
index a597ae4..d240aae 100644 (file)
--- a/cert.mlt
+++ b/cert.mlt
@@ -5,6 +5,7 @@ val admin = Group.inGroupName "server";
 if $"new" <> "" then
    val cert = $"cert";
    val domain = $"domain";
+   val subdomain = $"subdomain";
    val msg = $"msg";
 
    if cert = "" then
@@ -13,13 +14,16 @@ if $"new" <> "" then
       %><h3>You don't have permissions on domain <tt><% Web.html domain %></tt>.</h3><%
    else
       %>Are you sure you want to ask for permissions on an SSL certificate
+      <ul>
       <li> at <tt><% Web.html cert %></tt>,</li>
-      <li> for domain <tt><% domain %></tt>?</li>
-      <a href="?cmd=request&cert=<% Web.html cert %>&domain=<% Web.html domain %>&msg=<% Web.urlEncode msg %>">Yes, I want to request that.</a><%
+      <li> for domain <tt><% Sec.fulldomain (subdomain, domain) %></tt>?</li>
+      </ul>
+      <a href="?cmd=request&cert=<% Web.html cert %>&domain=<% Web.html domain %>&subdomain=<% Web.html subdomain %>&msg=<% Web.urlEncode msg %>">Yes, I want to request that.</a><%
    end
 elseif $"cmd" = "request" then
    val cert = $"cert";
    val domain = $"domain";
+   val subdomain = $"subdomain";
    val msg = $"msg";
 
    if cert = "" then
@@ -29,7 +33,7 @@ elseif $"cmd" = "request" then
    else
      val text = "/afs/hcoop.net/common/etc/scripts/ca-install "
        ^ Init.getUserName () ^ " "
-       ^ domain ^ " "
+       ^ (Sec.fulldomain (subdomain, domain)) ^ " "
        ^ cert
 
      val id = Cert.add (Init.getUserId (), text, msg);
@@ -136,22 +140,37 @@ elseif $"mod" <> "" then
 
 <p>Use this form to request Domtool permissions to use an SSL certificate.  Give the location of your certificate/key (<tt>.pem</tt>) file within <tt>/afs/hcoop.net</tt>.</p>
 
-<p>If you want your certificate authenticated by chaining through HCoop's root certificate, then <a href="sign">get it signed</a> before submitting this form.</p>
-
-<p>Note that you can't use SSL certificates very well over HTTPS without an IP address assigned to your web virtual host.  You can request one separately on <a href="ip">the IP address request page</a>.</p>
-
 <p>The <a href="http://wiki.hcoop.net/MemberManual/ServingWebsites/SslCert">instructions on our wiki for creating SSL certificates</a> may be helpful.</p>
 
+<p>If you need to install <strong>intermediate certificates</strong>, please include the intermediate certificate chain in the combined <tt>pem</tt> file after the private key.</p>
+
 <form method="post">
 <input type="hidden" name="new" value="1">
 <table class="blanks">
-<tr> <td>Domain:</td> <td><% @chooseDomain[] %></td> </tr>
+<tr> <td>Subdomain <span style="font-size: smaller">(optional)</span>:</td> <td><input name="subdomain" /></td></tr>
+<tr> <td>Domain:</td> <td><% @chooseDomain [] %></td> </tr>
 <tr> <td>OpenSSL certificate:</td> <td><input name="cert" size="60" required="required" value="<% Quotas.path ("user." ^ Init.getUserName ()) ^ "/certificates/" %>" ></td> </tr>
 <tr> <td>Additional comments:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Request"></td> </tr>
 </table>
 </form>
 
+<h3>Your certificates</h3>
+
+<ul>
+  <% foreach cert in Domtool.perms "cert" (Init.getUserName ()) do %>
+   <li><tt><% cert %></tt></li>
+<% end %>
+</ul>
+
+<h3>Your intermediate certificates</h3>
+
+<ul>
+  <% foreach cert in Domtool.perms "cacert" (Init.getUserName ()) do %>
+   <li><tt><% cert %></tt></li>
+<% end %>
+</ul>
+
 <% end %>
 
 <% @footer[] %>