diff options
-rw-r--r-- | tcpproxy-listsmtpentries-html.lsp | 4 | ||||
-rw-r--r-- | tcpproxy-listsmtpfiles-html.lsp | 6 | ||||
-rw-r--r-- | tcpproxy-model.lua | 2 | ||||
-rw-r--r-- | tcpproxy.roles | 8 |
4 files changed, 14 insertions, 6 deletions
diff --git a/tcpproxy-listsmtpentries-html.lsp b/tcpproxy-listsmtpentries-html.lsp index fb8e761..87809a9 100644 --- a/tcpproxy-listsmtpentries-html.lsp +++ b/tcpproxy-listsmtpentries-html.lsp @@ -16,8 +16,12 @@ require("viewfunctions") <% for i,interface in ipairs(view.value) do %> <TR> <TD style="padding-right:20px;white-space:nowrap;"> + <% if session.permissions.tcpproxy.editsmtpentry then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editsmtpentry?ipaddr="..(interface.ipaddr or interface.interface).."&redir="..page_info.orig_action, label="Edit "} %> + <% end %> + <% if session.permissions.tcpproxy.delsmtpentry then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delsmtpentry?ipaddr="..(interface.ipaddr or interface.interface), label="Delete "} %> + <% end %> </TD> <TD style="padding-right:20px;white-space:nowrap;"><%= interface.interface or "" %></TD> <TD style="padding-right:20px;white-space:nowrap;"><%= interface.ipaddr or "" %></TD> diff --git a/tcpproxy-listsmtpfiles-html.lsp b/tcpproxy-listsmtpfiles-html.lsp index 6b067e8..5de93ba 100644 --- a/tcpproxy-listsmtpfiles-html.lsp +++ b/tcpproxy-listsmtpfiles-html.lsp @@ -15,8 +15,12 @@ require("viewfunctions") <% for i,file in ipairs(view.value) do %> <TR> <TD style="padding-right:20px;white-space:nowrap;"> + <% if session.permissions.tcpproxy.editsmtpfile then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editsmtpfile?filename="..file.."&redir="..page_info.orig_action, label="Edit "} %> + <% end %> + <% if session.permissions.tcpproxy.delsmtpfile then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delsmtpfile?filename="..file, label="Delete "} %> + <% end %> </TD> <TD style="white-space:nowrap;"><%= file %></TD> </TR> @@ -24,7 +28,7 @@ require("viewfunctions") </TABLE> </DL> -<% if viewlibrary and viewlibrary.dispatch_component then +<% if viewlibrary and viewlibrary.dispatch_component and session.permissions.tcpproxy.createsmtpfile then local createform = viewlibrary.dispatch_component("createsmtpfile", nil, true) %> <H2><%= createform.label %></H2> <% diff --git a/tcpproxy-model.lua b/tcpproxy-model.lua index 508301f..d5e8a12 100644 --- a/tcpproxy-model.lua +++ b/tcpproxy-model.lua @@ -206,7 +206,7 @@ end function getsmtpstatus() local value, errtxt = processinfo.package_version(smtppackagename) - local version = cfe({ value=value, label="Program version" }) + local version = cfe({ value=value, label="Program version", errtxt=errtxt }) return cfe({ type="group", value={version=version, entries=entries}, label="SMTP Proxy Status" }) end diff --git a/tcpproxy.roles b/tcpproxy.roles index 803e033..76e4ad9 100644 --- a/tcpproxy.roles +++ b/tcpproxy.roles @@ -1,4 +1,4 @@ -READ=tcpproxy:status,tcpproxy:smtpstatus,tcpproxy:listsmtpentries,tcpproxy:listsmtpfiles -UPDATE=tcpproxy:startstop,tcpproxy:expert,tcpproxy:editsmtpentry,tcpproxy:editsmtpfile -DELETE=tcpproxy:delsmtpentry,tcpproxy:delsmtpfile -CREATE=tcpproxy:createsmtpfile +USER=tcpproxy:status,tcpproxy:smtpstatus,tcpproxy:listsmtpentries,tcpproxy:listsmtpfiles,tcpproxy:startstop +EDITOR=tcpproxy:editsmtpentry,tcpproxy:editsmtpfile,tcpproxy:delsmtpentry,tcpproxy:delsmtpfile,tcpproxy:createsmtpfile +EXPERT=tcpproxy:expert +ADMIN=tcpproxy:status,tcpproxy:smtpstatus,tcpproxy:listsmtpentries,tcpproxy:listsmtpfiles,tcpproxy:startstop,tcpproxy:editsmtpentry,tcpproxy:editsmtpfile,tcpproxy:delsmtpentry,tcpproxy:delsmtpfile,tcpproxy:createsmtpfile,tcpproxy:expert |