diff options
-rw-r--r-- | openssl-editconfigfile-html.lsp | 2 | ||||
-rw-r--r-- | openssl-html.lsp | 32 | ||||
-rw-r--r-- | openssl-status-html.lsp | 8 |
3 files changed, 19 insertions, 23 deletions
diff --git a/openssl-editconfigfile-html.lsp b/openssl-editconfigfile-html.lsp index 4626e8d..ab13038 100644 --- a/openssl-editconfigfile-html.lsp +++ b/openssl-editconfigfile-html.lsp @@ -9,6 +9,6 @@ local func = haserl.loadfile(page_info.viewfile:gsub(pattern..".*$", "/") .. "fi func(form, viewlibrary, page_info, session) %> -<% if viewlibrary and viewlibrary.dispatch_component and session.permissions.openssl.checkenvironment then +<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("checkenvironment") then viewlibrary.dispatch_component("checkenvironment") end %> diff --git a/openssl-html.lsp b/openssl-html.lsp index 110c867..2a13ff4 100644 --- a/openssl-html.lsp +++ b/openssl-html.lsp @@ -1,10 +1,6 @@ <% local view, viewlibrary, pageinfo, session = ... %> <% require("viewfunctions") %> -<% --[[ DEBUG INFORMATION -io.write(html.cfe_unpack(view)) ---]] %> - <link rel="stylesheet" type="text/css" href="/js/style.css"> <script type="text/javascript" src="/js/jquery-latest.js"></script> <script type="text/javascript" src="/js/jquery.tablesorter.min.js"></script> @@ -36,15 +32,15 @@ io.write(html.cfe_unpack(view)) <% for i,request in ipairs(view.value.pending.value) do %> <tr> <td> - <% if session.permissions.openssl.viewrequest then + <% if viewlibrary.check_permission("viewrequest") then io.write(html.link{value="viewrequest?request="..request.name, label="View "}) end %> - <% if session.permissions.openssl.approve then + <% if viewlibrary.check_permission("approve") then io.write(html.link{value="approve?request="..request.name, label="Approve "}) end %> - <% if session.permissions.openssl.deleterequest then + <% if viewlibrary.check_permission("deleterequest") then io.write(html.link{value="deleterequest?request="..request.name, label="Delete "}) - elseif session.permissions.openssl.deletemyrequest then + elseif viewlibrary.check_permission("deletemyrequest") then io.write(html.link{value="deletemyrequest?request="..request.name, label="Delete "}) end %> </td> @@ -96,21 +92,21 @@ end %> <% for i,cert in ipairs(approved) do %> <tr <% if cert.daysremaining < 14 then %>class='error'<% end %>> <td> - <% if session.permissions.openssl.viewcert then %> + <% if viewlibrary.check_permission("viewcert") then %> <%= html.link{value="viewcert?cert="..cert.name, label="View "} %> <% end %> - <% if session.permissions.openssl.getcert then %> + <% if viewlibrary.check_permission("getcert") then %> <%= html.link{value="getcert?cert="..cert.name, label="Download "} %> <% end %> - <% if session.permissions.openssl.renewcert then %> + <% if viewlibrary.check_permission("renewcert") then %> <%= html.link{value="renewcert?cert="..cert.name, label="Renew "} %> - <% elseif session.permissions.openssl.requestrenewcert then %> + <% elseif viewlibrary.check_permission("requestrenewcert") then %> <%= html.link{value="requestrenewcert?cert="..cert.name, label="Renew "} %> <% end %> - <% if session.permissions.openssl.revoke then %> + <% if viewlibrary.check_permission("revoke") then %> <%= html.link{value="revoke?cert="..cert.name, label="Revoke "} %> <% end %> - <% if session.permissions.openssl.deletecert then %> + <% if viewlibrary.check_permission("deletecert") then %> <%= html.link{value="deletecert?cert="..cert.name, label="Delete "} %> <% end %> </td> @@ -145,13 +141,13 @@ end %> <% for i,cert in ipairs(revoked) do %> <tr> <td> - <% if session.permissions.openssl.viewcert then %> + <% if viewlibrary.check_permission("viewcert") then %> <%= html.link{value="viewcert?cert="..cert.name, label="View "} %> <% end %> - <% --[[ if session.permissions.openssl.getcert then %> + <% --[[ if viewlibrary.check_permission("getcert") then %> <%= html.link{value="getcert?cert="..cert.name, label="Download "} %> <% end --]] %> - <% if session.permissions.openssl.deletecert then %> + <% if viewlibrary.check_permission("deletecert") then %> <%= html.link{value="deletecert?cert="..cert.name, label="Delete "} %> <% end %> </td> @@ -166,7 +162,7 @@ end %> <% end %> </DL> -<% if session.permissions.openssl.getrevoked then %> +<% if viewlibrary.check_permission("getrevoked") then %> <H1>Get revoked list (crl)</H1> <DL> <%= html.link{value="getrevoked?crltype=PEM", label="Download PEM "} %><BR> diff --git a/openssl-status-html.lsp b/openssl-status-html.lsp index decc991..1837ab0 100644 --- a/openssl-status-html.lsp +++ b/openssl-status-html.lsp @@ -6,7 +6,7 @@ <H1>System Info</H1> <DL> <% displayitem(view.value.version) %> -<% if view.value.version and view.value.version.errtxt and session.permissions.apk and session.permissions.apk.install then %> +<% if view.value.version and view.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then %> <a href="<%= html.html_escape(page_info.script .. "/apk-tools/apk/install?package="..view.value.version.name) %>">Install</a> <% end %> <% displayitem(view.value.conffile) %> @@ -17,17 +17,17 @@ <% 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 session.permissions.openssl.checkenvironment then + if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("checkenvironment") then viewlibrary.dispatch_component("checkenvironment") end elseif not view.value.cacert.errtxt and not view.value.cakey.errtxt then %> <H1>CA Certificate contents</H1> <DL><pre><%= html.html_escape(view.value.cacertcontents.value) %></pre></DL> <% elseif viewlibrary and viewlibrary.dispatch_component then - if session.permissions.openssl.putcacert then + if viewlibrary.check_permission("putcacert") then viewlibrary.dispatch_component("putcacert") end - if session.permissions.openssl.generatecacert then + if viewlibrary.check_permission("generatecacert") then viewlibrary.dispatch_component("generatecacert") end end |