% 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) %> <% local filename = cfe({ type="hidden", value=view.value.filename.value }) %> <% local redir = cfe({ type="hidden", value=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 %> <% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %> <% htmlviewfunctions.displayitem(view.value.filename) %> <% if view.value.mode then htmlviewfunctions.displayitem(view.value.mode) end %> <% if view.value.data then %> <% local containspasswd = 0 %>
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 %> <% entry.value = i %> <% if viewlibrary.check_permission("editpasswdentry") then %> <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, entry=entry, redir=redir}, label="", option="Edit", action="editpasswdentry"}), page_info, -1) %> <% end %> <% if viewlibrary.check_permission("deletepasswdentry") then %> <% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename, entry=entry, redir=redir}, label="", option="Delete", action="deletepasswdentry", class="deletepasswdentry"}), page_info, -1) %> <% end %> <% if 0 < containspasswd and r[containspasswd] ~= "" and viewlibrary.check_permission("editpasswd") then %> <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, entry=entry, redir=redir}, label="", option="Change Pass", action="editpasswd"}), page_info, -1) %> <% 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 %>