summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-02-02 11:26:24 -0500
committerTed Trask <ttrask01@yahoo.com>2015-02-02 11:26:24 -0500
commit2238876a4b10036a82ce3cd3e8c9c759651047e8 (patch)
treecbf21c569bc75e425b01d18411ba069e182fbb12
parenta7f4aa9054875f4fdce090afcecdf858c9cc2746 (diff)
downloadacf-openssl-2238876a4b10036a82ce3cd3e8c9c759651047e8.tar.bz2
acf-openssl-2238876a4b10036a82ce3cd3e8c9c759651047e8.tar.xz
Add basedir support to views
-rw-r--r--openssl-checkenvironment-html.lsp5
-rw-r--r--openssl-read-html.lsp32
-rw-r--r--openssl-status-html.lsp12
3 files changed, 29 insertions, 20 deletions
diff --git a/openssl-checkenvironment-html.lsp b/openssl-checkenvironment-html.lsp
index ae54a17..34dede9 100644
--- a/openssl-checkenvironment-html.lsp
+++ b/openssl-checkenvironment-html.lsp
@@ -6,6 +6,11 @@
local header_level = htmlviewfunctions.displaysectionstart(form, page_info)
if form.value.status.errtxt then
htmlviewfunctions.displayformstart(form, page_info)
+ for name,value in pairs(form.value) do
+ if value.type == "hidden" then
+ htmlviewfunctions.displayformitem(value, name)
+ end
+ end
end
htmlviewfunctions.displayitem(form.value.status)
if form.value.status.errtxt then
diff --git a/openssl-read-html.lsp b/openssl-read-html.lsp
index f8b96e9..c188db5 100644
--- a/openssl-read-html.lsp
+++ b/openssl-read-html.lsp
@@ -24,6 +24,7 @@
<% htmlviewfunctions.displaycommandresults({"approve", "deleterequest", "deletemyrequest", "renewcert", "requestrenewcert", "revoke", "deletecert"}, session) %>
+<% local basedir = cfe({ type="hidden", value=view.value.basedir.value }) %>
<%
local label = ""
if view.value.user then
@@ -51,15 +52,15 @@ local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Pending c
<%
req.value = request.request
if viewlibrary.check_permission("viewrequest") then
- htmlviewfunctions.displayitem(cfe({type="link", value={request=req}, label="", option="View", action="viewrequest"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={request=req, basedir=basedir}, label="", option="View", action="viewrequest"}), page_info, -1)
end
if viewlibrary.check_permission("approve") then
- htmlviewfunctions.displayitem(cfe({type="form", value={request=req}, label="", option="Approve", action="approve"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={request=req, basedir=basedir}, label="", option="Approve", action="approve"}), page_info, -1)
end
if viewlibrary.check_permission("deleterequest") then
- htmlviewfunctions.displayitem(cfe({type="form", value={request=req}, label="", option="Delete", action="deleterequest"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={request=req, basedir=basedir}, label="", option="Delete", action="deleterequest"}), page_info, -1)
elseif viewlibrary.check_permission("deletemyrequest") then
- htmlviewfunctions.displayitem(cfe({type="form", value={request=req}, label="", option="Delete", action="deletemyrequest"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={request=req, basedir=basedir}, label="", option="Delete", action="deletemyrequest"}), page_info, -1)
end
%>
</td>
@@ -116,21 +117,21 @@ end %>
<%
crt.value = cert.cert
if viewlibrary.check_permission("viewcert") then
- htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt}, label="", option="View", action="viewcert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt, basedir=basedir}, label="", option="View", action="viewcert"}), page_info, -1)
end
if viewlibrary.check_permission("getcert") then
- htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt, viewtype=viewtype}, label="", option="Download", action="getcert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt, viewtype=viewtype, basedir=basedir}, label="", option="Download", action="getcert"}), page_info, -1)
end
if viewlibrary.check_permission("renewcert") then
- htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt}, label="", option="Renew", action="renewcert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt, basedir=basedir}, label="", option="Renew", action="renewcert"}), page_info, -1)
elseif viewlibrary.check_permission("requestrenewcert") then
- htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt}, label="", option="Renew", action="requestrenewcert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt, basedir=basedir}, label="", option="Renew", action="requestrenewcert"}), page_info, -1)
end
if viewlibrary.check_permission("revoke") then
- htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt}, label="", option="Revoke", action="revoke"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt, basedir=basedir}, label="", option="Revoke", action="revoke"}), page_info, -1)
end
if viewlibrary.check_permission("deletecert") then
- htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt}, label="", option="Delete", action="deletecert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt, basedir=basedir}, label="", option="Delete", action="deletecert"}), page_info, -1)
end
%>
</td>
@@ -168,13 +169,13 @@ end %>
<%
crt.value = cert.cert
if viewlibrary.check_permission("viewcert") then
- htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt}, label="", option="View", action="viewcert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt, basedir=basedir}, label="", option="View", action="viewcert"}), page_info, -1)
end
--[[ if viewlibrary.check_permission("getcert") then
- htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt, viewtype=viewtype}, label="", option="Download", action="getcert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={cert=crt, viewtype=viewtype, basedir=basedir}, label="", option="Download", action="getcert"}), page_info, -1)
end --]]
if viewlibrary.check_permission("deletecert") then
- htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt}, label="", option="Delete", action="deletecert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="form", value={cert=crt, basedir=basedir}, label="", option="Delete", action="deletecert"}), page_info, -1)
end
%>
</td>
@@ -191,9 +192,10 @@ end %>
<%
if viewlibrary.check_permission("getrevoked") then
+ local basedir = cfe({type="hidden", value=view.value.basedir.value})
htmlviewfunctions.displaysectionstart(cfe({label="Get revoked list (crl)"}), page_info, header_level)
- htmlviewfunctions.displayitem(cfe({type="link", value={crltype=cfe({type="hidden", value="PEM"}), viewtype=viewtype}, label="", option="Download PEM", action="getrevoked"}), page_info, -1)
- htmlviewfunctions.displayitem(cfe({type="link", value={crltype=cfe({type="hidden", value="DER"}), viewtype=viewtype}, label="", option="Download DER", action="getrevoked"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={crltype=cfe({type="hidden", value="PEM"}), viewtype=viewtype, basedir=basedir}, label="", option="Download PEM", action="getrevoked"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={crltype=cfe({type="hidden", value="DER"}), viewtype=viewtype, basedir=basedir}, label="", option="Download DER", action="getrevoked"}), page_info, -1)
htmlviewfunctions.displaysectionend(header_level)
end
%>
diff --git a/openssl-status-html.lsp b/openssl-status-html.lsp
index e980114..1cd35c6 100644
--- a/openssl-status-html.lsp
+++ b/openssl-status-html.lsp
@@ -25,7 +25,7 @@ htmlviewfunctions.displayitem(view.value.cakey)
if not view.value.version.errtxt and not view.value.conffile.errtxt then
if view.value.environment.errtxt then
if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("checkenvironment") then
- viewlibrary.dispatch_component("checkenvironment")
+ viewlibrary.dispatch_component("checkenvironment", {basedir=view.value.basedir.value})
end
elseif not view.value.cacert.errtxt and not view.value.cakey.errtxt then
htmlviewfunctions.displaysectionstart(view.value.cacertcontents, page_info, header_level)
@@ -33,10 +33,10 @@ if not view.value.version.errtxt and not view.value.conffile.errtxt then
htmlviewfunctions.displaysectionend(header_level)
elseif viewlibrary and viewlibrary.dispatch_component then
if viewlibrary.check_permission("putcacert") then
- viewlibrary.dispatch_component("putcacert")
+ viewlibrary.dispatch_component("putcacert", {basedir=view.value.basedir.value})
end
if viewlibrary.check_permission("generatecacert") then
- viewlibrary.dispatch_component("generatecacert")
+ viewlibrary.dispatch_component("generatecacert", {basedir=view.value.basedir.value})
end
end
end
@@ -44,9 +44,11 @@ end
<%
if not view.value.cacert.errtxt and viewlibrary.check_permission("downloadcacert") then
+ local viewtype = cfe({type="hidden", value="stream"})
+ local basedir = cfe({type="hidden", value=view.value.basedir.value})
htmlviewfunctions.displaysectionstart(cfe({label="Download CA Cert"}), page_info, header_level)
- htmlviewfunctions.displayitem(cfe({type="link", value={certtype=cfe({type="hidden", value="PEM"}), viewtype=cfe({type="hidden", value="stream"})}, label="", option="Download PEM", action="downloadcacert"}), page_info, -1)
- htmlviewfunctions.displayitem(cfe({type="link", value={certtype=cfe({type="hidden", value="DER"}), viewtype=cfe({type="hidden", value="stream"})}, label="", option="Download DER", action="downloadcacert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={certtype=cfe({type="hidden", value="PEM"}), viewtype=viewtype, basedir=basedir}, label="", option="Download PEM", action="downloadcacert"}), page_info, -1)
+ htmlviewfunctions.displayitem(cfe({type="link", value={certtype=cfe({type="hidden", value="DER"}), viewtype=viewtype, basedir=basedir}, label="", option="Download DER", action="downloadcacert"}), page_info, -1)
htmlviewfunctions.displaysectionend(header_level)
end
%>