summaryrefslogtreecommitdiffstats
path: root/openssl-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'openssl-html.lsp')
-rw-r--r--openssl-html.lsp64
1 files changed, 52 insertions, 12 deletions
diff --git a/openssl-html.lsp b/openssl-html.lsp
index 54b4f57..192f7ce 100644
--- a/openssl-html.lsp
+++ b/openssl-html.lsp
@@ -4,23 +4,36 @@
io.write(html.cfe_unpack(view))
--]] ?>
+<? if view.value.cmdresult then ?>
+<H1>Command Result</H1>
+<DL>
+<?= view.value.cmdresult.value ?>
+</DL>
+<? end ?>
+
<H1>Pending certificate requests<? if view.value.user then?> for <?= view.value.user.value ?><? end ?></H1>
<? if not view.value.pending or #view.value.pending.value == 0 then ?>
No certificates pending
<? else ?>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <? if session.permissions.openssl.approve then ?>
- <TD style="padding-right:20px;white-space:nowrap;" class="header">Approve</TD>
- <? end ?>
+ <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
<TD style="padding-right:20px;white-space:nowrap;" class="header">User</TD>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Cert Type</TD>
<TD style="white-space:nowrap;" class="header">Common Name</TD>
<? for i,request in ipairs(view.value.pending.value) do ?>
<TR>
- <? if session.permissions.openssl.approve then ?>
- <TD><?= html.link{value="approve?request="..request.name, label="Approve"} ?></TD>
- <? end ?>
+ <TD>
+ <? if session.permissions.openssl.viewrequest then
+ io.write(html.link{value="viewrequest?request="..request.name, label="View "})
+ end ?>
+ <? if session.permissions.openssl.approve then
+ io.write(html.link{value="approve?request="..request.name, label="Approve "})
+ end ?>
+ <? if session.permissions.openssl.deleterequest then
+ io.write(html.link{value="deleterequest?request="..request.name, label="Delete "})
+ end ?>
+ </TD>
<TD><?= request.user ?></TD>
<TD><?= request.certtype ?></TD>
<TD><?= request.commonName ?></TD>
@@ -28,15 +41,42 @@ io.write(html.cfe_unpack(view))
<? end ?>
</TABLE>
<? end ?>
-
+
<H1>Approved certificate requests<? if view.value.user then?> for <?= view.value.user.value ?><? end ?></H1>
<? if not view.value.approved or #view.value.approved.value == 0 then ?>
No certificates approved
-<? else
- for i,name in ipairs(view.value.approved.value) do
- io.write(name..'<br>')
- end
-end ?>
+<? else ?>
+<TABLE>
+ <TR style="background:#eee;font-weight:bold;">
+ <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
+ <TD style="padding-right:20px;white-space:nowrap;" class="header">User</TD>
+ <TD style="padding-right:20px;white-space:nowrap;" class="header">Cert Type</TD>
+ <TD style="padding-right:20px;white-space:nowrap;" class="header">Common Name</TD>
+ <TD style="white-space:nowrap;" class="header">Serial Num</TD>
+ <? for i,cert in ipairs(view.value.approved.value) do ?>
+ <TR>
+ <TD>
+ <? if session.permissions.openssl.viewcert then ?>
+ <?= html.link{value="viewcert?cert="..cert.name, label="View "} ?>
+ <? end ?>
+ <? if session.permissions.openssl.getcert then ?>
+ <?= html.link{value="getcert?cert="..cert.name, label="Download "} ?>
+ <? end ?>
+ <? if session.permissions.openssl.revoke then ?>
+ <?= html.link{value="revoke?cert="..cert.name, label="Revoke "} ?>
+ <? end ?>
+ <? if session.permissions.openssl.deletecert then ?>
+ <?= html.link{value="deletecert?cert="..cert.name, label="Delete "} ?>
+ <? end ?>
+ </TD>
+ <TD><?= cert.user ?></TD>
+ <TD><?= cert.certtype ?></TD>
+ <TD><?= cert.commonName ?></TD>
+ <TD><?= cert.serial ?></TD>
+ </TR>
+ <? end ?>
+</TABLE>
+<? end ?>
<H1>Revoked certificates<? if view.value.user then?> for <?= view.value.user.value ?><? end ?></H1>
<? if not view.value.revoked or #view.value.revoked.value == 0 then ?>