summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rrdtool-expert-html.lsp2
-rw-r--r--rrdtool-listgraphcfg-html.lsp15
-rw-r--r--rrdtool-listrrd-html.lsp17
3 files changed, 10 insertions, 24 deletions
diff --git a/rrdtool-expert-html.lsp b/rrdtool-expert-html.lsp
index 6cbb910..c983b88 100644
--- a/rrdtool-expert-html.lsp
+++ b/rrdtool-expert-html.lsp
@@ -20,6 +20,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[page_info.controller].startstop then
+<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("startstop") then
viewlibrary.dispatch_component("startstop")
end %>
diff --git a/rrdtool-listgraphcfg-html.lsp b/rrdtool-listgraphcfg-html.lsp
index d415675..83be263 100644
--- a/rrdtool-listgraphcfg-html.lsp
+++ b/rrdtool-listgraphcfg-html.lsp
@@ -1,13 +1,6 @@
<% local form, viewlibrary, page_info, session = ...
require("viewfunctions")
%>
-<%
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(form))
-io.write("</span>")
---]]
-%>
<% displaycommandresults({"delete"}, session) %>
@@ -35,11 +28,11 @@ function javascript_confirm_graph(formID,filename) {
<% for i,file in ipairs(form.value) do %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
- <% if session.permissions[page_info.controller].delete then %>
+ <% if viewlibrary.check_permission("delete") then %>
<A STYLE="cursor: pointer;" onclick="javascript_confirm_graph('confirmDisplay','<% io.write(file.value.filename.value) %>')">Delete</A>
<% end %>
<%
- if session.permissions[page_info.controller].editgraphcfg then io.write(html.link{value = "editgraphcfg?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end
+ if viewlibrary.check_permission("editgraphcfg") then io.write(html.link{value = "editgraphcfg?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end
%>
</TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:right;"><%= html.html_escape(file.value.filesize.value) %></TD>
@@ -48,7 +41,7 @@ function javascript_confirm_graph(formID,filename) {
</TR>
<% end %>
- <% if session.permissions[page_info.controller].createrrd then %>
+ <% if viewlibrary.check_permission("createrrd") then %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
<% io.write(html.link{value = "newgraphcfg", label="Create new graph " }) %>
@@ -59,7 +52,7 @@ function javascript_confirm_graph(formID,filename) {
</TABLE>
-<% if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].newfile then
+<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then
local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %>
<h2>Create new Domain</h2>
<%
diff --git a/rrdtool-listrrd-html.lsp b/rrdtool-listrrd-html.lsp
index 379e55a..dff97a8 100644
--- a/rrdtool-listrrd-html.lsp
+++ b/rrdtool-listrrd-html.lsp
@@ -1,13 +1,6 @@
<% local form, viewlibrary, page_info, session = ...
require("viewfunctions")
%>
-<%
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(form))
-io.write("</span>")
---]]
-%>
<script type="text/javascript">
function javascript_confirm_demo(formID,filename) {
@@ -33,13 +26,13 @@ function javascript_confirm_demo(formID,filename) {
<% for i,file in ipairs(form.value) do %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
- <% if session.permissions[page_info.controller].delete then %>
+ <% if viewlibrary.check_permission("delete") then %>
<A STYLE="cursor: pointer;" onclick="javascript_confirm_demo('confirmDisplay','<% io.write(file.value.filename.value) %>')">Delete</A>
<% end %>
<%
io.write(html.link{value = "rrdinfo?filename=" .. file.value.filename.value, label="Info " })
--- if session.permissions[page_info.controller].edit then io.write(html.link{value = "edit?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end
--- if session.permissions[page_info.controller].editfile then io.write(html.link{value = "editfile?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Expert " }) end
+-- if viewlibrary.check_permission("edit") then io.write(html.link{value = "edit?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end
+-- if viewlibrary.check_permission("editfile") then io.write(html.link{value = "editfile?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Expert " }) end
%>
</TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:right;"><%= html.html_escape(file.value.filesize.value) %></TD>
@@ -48,7 +41,7 @@ function javascript_confirm_demo(formID,filename) {
</TR>
<% end %>
- <% if session.permissions[page_info.controller].createrrd then %>
+ <% if viewlibrary.check_permission("createrrd") then %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
<% io.write(html.link{value = "createrrd", label="Create new DB " }) %>
@@ -59,7 +52,7 @@ function javascript_confirm_demo(formID,filename) {
</TABLE>
-<% if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].newfile then
+<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then
local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %>
<h2>Create new Domain</h2>
<%