% local view, viewlibrary, page_info, session = ... htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> <% htmlviewfunctions.displaycommandresults({"editpasswdentry", "deletepasswdentry", "editpasswd", "editfile"}, session) %> <% htmlviewfunctions.displaycommandresults({"createpasswdentry"}, session, true) %> <% -- This is a hack to redirect back to viewing the same file local redir = page_info.orig_action.."?filename="..html.url_encode(view.value.filename.value) %> <% local editable = false if view.value.mode and string.match(view.value.mode.value, "^.w") then editable = true end %>
Action | <% for i,f in ipairs(view.value.fields.value) do %> <% if f == "Crypt-Password" then containspasswd = i end %><%= html.html_escape(f) %> | <% end %>
---|---|
<% if editable then %> <% if viewlibrary.check_permission("editpasswdentry") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editpasswdentry?filename="..html.url_encode(view.value.filename.value).."&entry="..i.."&redir="..html.url_encode(redir), label="Edit "} %> <% end %> <% if viewlibrary.check_permission("deletepasswdentry") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletepasswdentry?submit=true&filename="..html.url_encode(view.value.filename.value).."&entry="..i, label="Delete "} %> <% end %> <% if 0 < containspasswd and r[containspasswd] ~= "" and viewlibrary.check_permission("editpasswd") then %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editpasswd?filename="..html.url_encode(view.value.filename.value).."&entry="..i.."&redir="..html.url_encode(redir), label="ChangePass "} %> <% end %> <% end %> | <% for j,f in ipairs(r) do %><% if (j == containspasswd) and (f ~= "") then io.write("********") else io.write(html.html_escape(f)) end %> | <% end %>