1 <% @header [("title", ["SSL certificate permission requests"])];
3 val admin = Group.inGroupName "server";
6 if $"kind" = "cert" then
8 %><h3>You filled data in next to a textbox but didn't check the radio button next to it.</h3><%
9 elseif $"cert" = "" then
10 %><h3>Please fill in a path to a certificate.</h3><%
15 %>Are you sure you want to ask for permissions on an SSL certificate at <% cert %>?<br><br>
16 <a href="cert?cmd=request&req=Certificate+<% cert %>&msg=<% Web.urlEncode msg %>">Yes, I want to request that.</a><%
20 %><h3>You filled data in next to a textbox but didn't check the radio button next to it.</h3><%
21 elseif $"req" = "" then
22 %><h3>Please fill in a path to an OpenSSL request.</h3><%
27 %>Are you sure you want to ask for permissions on an SSL certificate to be created from an OpenSSL request at <% req %>?<br><br>
28 <a href="cert?cmd=request&req=OpenSSL+request+<% req %>&msg=<% Web.urlEncode msg %>">Yes, I want to request that.</a><%
32 elseif $"cmd" = "request" then
33 val id = Cert.add (Init.getUserId (), $"req", $"msg");
34 if not (Cert.notifyNew id) then
35 %><h3>Error sending e-mail notification</h3><%
37 %><h3>Request added</h3><%
39 elseif $"cmd" = "open" then
40 %><h3>Open requests</h3>
41 <a href="cert?cmd=list">List all requests</a><%
43 foreach (name, req) in Cert.listOpen () do %>
45 <table class="blanks">
46 <tr> <td>By:</td> <td><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
47 <tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
48 <tr> <td>Request:</td> <td><% #data req %></td> </tr>
49 <tr> <td>Reason:</td> <td><% Web.html (#msg req) %></td> </tr>
54 <a href="cert?mod=<% #id req %>">[Modify]</a>
55 <a href="cert?del=<% #id req %>">[Delete]</a><br>
56 To install, run: <i>tell adamc what text to put here</i>.
61 elseif $"cmd" = "list" then
62 %><h3>All requests</h3><%
64 foreach (name, req) in Cert.list () do %>
66 <table class="blanks">
67 <tr> <td>By:</td> <td><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
68 <tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
69 <tr> <td>Request:</td> <td><% #data req %></td> </tr>
70 <tr> <td>Reason:</td> <td><% Web.html (#msg req) %></td> </tr>
75 <a href="cert?mod=<% #id req %>">[Modify]</a>
76 <a href="cert?del=<% #id req %>">[Delete]</a>
81 elseif $"mod" <> "" then
82 Group.requireGroupName "server";
83 val id = Web.stoi ($"mod");
84 val req = Cert.lookup id;
85 val user = Init.lookupUser (#usr req) %>
86 <h3>Handle request</h3>
89 <input type="hidden" name="save" value="<% id %>">
90 <table class="blanks">
91 <tr> <td>Requestor:</td> <td><a href="user?id=<% #usr req %>"><% #name user %></a></td> </tr>
92 <tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
93 <tr> <td>Status:</td> <td><select name="status">
94 <option value="0"<% if #status req = Cert.NEW then %> selected<% end %>>New</option>
95 <option value="1"<% if #status req = Cert.INSTALLED then %> selected<% end %>>Installed</option>
96 <option value="2"<% if #status req = Cert.REJECTED then %> selected<% end %>>Rejected</option>
98 <tr> <td>Request:</td> <td><input name="req" size="60" value="<% Web.html (#data req) %>"></td> </tr>
99 <tr> <td>Message:</td> <td><textarea name="msg" rows="10" cols="80" wrap="soft"><% Web.html (#msg req) %></textarea></td> </tr>
100 <tr> <td><input type="submit" value="Save"></td> </tr>
104 <% elseif $"save" <> "" then
105 Group.requireGroupName "server";
106 val id = Web.stoi ($"save");
107 val req = Cert.lookup id;
108 val oldStatus = #status req;
109 val newStatus = Cert.statusFromInt (Web.stoi ($"status"));
110 Cert.modify {req with data = $"req", msg = $"msg", status = newStatus};
111 if oldStatus <> newStatus then
112 if not (Cert.notifyMod (oldStatus, newStatus, Init.getUserName(), id)) then
113 %><h3>Error sending e-mail notification</h3><%
116 %><h3>Request modified</h3>
117 Back to: <a href="cert?cmd=open">open requests</a>, <a href="cert?cmd=list">all requests</a>
119 <% elseif $"del" <> "" then
120 Group.requireGroupName "server";
121 val id = Web.stoi ($"del");
122 val req = Cert.lookup id;
123 val user = Init.lookupUser (#usr req)
124 %><h3>Are you sure you want to delete request by <% #name user %> for <tt><% #data req %></tt>?</h3>
125 <a href="cert?del2=<% id %>">Yes, I'm sure!</a>
127 <% elseif $"del2" <> "" then
128 Group.requireGroupName "server";
129 val id = Web.stoi ($"del2");
131 %><h3>Request deleted</b><h3>
132 Back to: <a href="cert?cmd=open">open requests</a>, <a href="cert?cmd=list">all requests</a>
136 <h3>Request permissions on an SSL certificate</h3>
138 <p>Use this form to request use Domtool permissions to use an SSL certificate. Give the location of your certificate request or certificate within <tt>/afs/hcoop.net</tt>.</p>
140 <p>If you have your own certificate signed by an outside provider like Verisign, then choose the second option and give the path to that certificate.</p>
142 <p>If you want your certificate authenticated by chaining through HCoop's root certificate, then choose the first option and give the path to an OpenSSL certificate request. In the comments field, be sure to specify the number of days that you would like the certificate to be valid. If you do not specify a value, we will use 3650 days. Make sure that the key file is in the same directory as the certificate request, and that it has a "<tt>.key</tt>" extension.</p>
144 <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>
146 <p>The <a href="http://wiki2.hcoop.net/MemberManual/ServingWebsites/SslCert">instructions on our wiki for creating SSL certificates</a> may be helpful.</p>
149 <input type="hidden" name="new" value="1">
150 <table class="blanks">
151 <tr> <td>OpenSSL request: <input type="radio" name="kind" value="req" checked></td> <td><input name="req" size="60"></td> </tr>
152 <tr> <td>OpenSSL certificate: <input type="radio" name="kind" value="cert"></td> <td><input name="cert" size="60"></td> </tr>
153 <tr> <td>Additional comments:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
154 <tr> <td><input type="submit" value="Request"></td> </tr>