From 2e34d7b6a7eeea84694a987606758bce3d3994ed Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 15 Sep 2014 18:08:14 +0000 Subject: Implemented listmacauthfiles action Points to to-be-implemented editmacauthfile action --- freeradius3-listmacauthfiles-html.lsp | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 freeradius3-listmacauthfiles-html.lsp (limited to 'freeradius3-listmacauthfiles-html.lsp') diff --git a/freeradius3-listmacauthfiles-html.lsp b/freeradius3-listmacauthfiles-html.lsp new file mode 100644 index 0000000..a70a207 --- /dev/null +++ b/freeradius3-listmacauthfiles-html.lsp @@ -0,0 +1,63 @@ +<% local view, viewlibrary, page_info, session = ... +htmlviewfunctions = require("htmlviewfunctions") +html = require("acf.html") +%> + +<% +function convertsize(size) + if string.find(size, "k$") then + return tonumber(string.match(size, "[%d.]*")) * 1024.0 + elseif string.find(size, "M$") then + return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0 + elseif string.find(size, "G$") then + return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0 + else + return tonumber(string.match(size, "[%d.]*")) + end +end +%> + + + + + + + +<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="MAC Authentication Configuration"}), page_info) %> + + + + + + + + +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> +<% for k,v in ipairs( view.value ) do %> + + + + + + +<% end %> +
ActionFileSizeLast Modified
+ <% filename.value = v.filename %> + <% if viewlibrary.check_permission("editmacauthfile") then %> + <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editmacauthfile"}), page_info, -1) %> + <% end %> + <%= html.html_escape(v.filename) %><%= convertsize(v.size) %>b<%= html.html_escape(v.size) %><%= html.html_escape(v.mtime) %>
+<% htmlviewfunctions.displaysectionend(header_level) %> -- cgit v1.2.3