summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--freeradius3-editmacauthfile-html.lsp15
-rw-r--r--freeradius3-listmacauthfiles-html.lsp28
2 files changed, 15 insertions, 28 deletions
diff --git a/freeradius3-editmacauthfile-html.lsp b/freeradius3-editmacauthfile-html.lsp
index fc59628..c604d82 100644
--- a/freeradius3-editmacauthfile-html.lsp
+++ b/freeradius3-editmacauthfile-html.lsp
@@ -71,12 +71,17 @@
});
</script>
+<h1>Edit MAC Authentication File</h1>
+<dl>
<%
-local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Edit MAC Authentication File"}), page_info)
htmlviewfunctions.displayitem(form.value.filename)
htmlviewfunctions.displayitem(form.value.filesize)
htmlviewfunctions.displayitem(form.value.mtime)
-local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"}), page_info, htmlviewfunctions.incrementheader(header_level))
+%>
+</dl>
+<h2>Entries</h2>
+<dl>
+<%
htmlviewfunctions.displayformstart(form, page_info)
form.value.filename.type = "hidden"
htmlviewfunctions.displayformitem(form.value.filename, "filename")
@@ -89,8 +94,8 @@ local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"
<% end %>
</table>
<%
- htmlviewfunctions.displayinfo(form.value.filecontent)
+ if form.descr then io.write('<p class="descr">' .. string.gsub(html.html_escape(form.descr), "\n", "<br/>") .. '</p>') end
+ if form.errtxt then io.write('<p class="error">' .. string.gsub(html.html_escape(form.errtxt), "\n", "<br/>") .. '</p>') end
htmlviewfunctions.displayformend(form)
-htmlviewfunctions.displaysectionend(header_level2)
-htmlviewfunctions.displaysectionend(header_level)
%>
+</dl>
diff --git a/freeradius3-listmacauthfiles-html.lsp b/freeradius3-listmacauthfiles-html.lsp
index fcb1363..516d0c9 100644
--- a/freeradius3-listmacauthfiles-html.lsp
+++ b/freeradius3-listmacauthfiles-html.lsp
@@ -3,20 +3,6 @@ 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
-%>
-
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
@@ -37,8 +23,8 @@ end
<% htmlviewfunctions.displaycommandresults({"editmacauthfile"}, session) %>
-<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="MAC Authentication Configuration"}), page_info) %>
-<table id="list" class="tablesorter"><thead>
+<h1>MAC Authentication Configuration</h1>
+<dl><table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>File</th>
@@ -46,20 +32,16 @@ end
<th>Last Modified</th>
</tr>
</thead><tbody>
-<% local filename = cfe({ type="hidden", value="" }) %>
-<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for k,v in ipairs( view.value ) do %>
<tr>
<td>
- <% 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) %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editmacauthfile?filename="..v.filename.."&redir="..html.url_encode(page_info.orig_action), label="Edit "} %>
<% end %>
</td>
<td><%= html.html_escape(v.filename) %></td>
- <td><span class="hide"><%= convertsize(v.size) %>b</span><%= html.html_escape(v.size) %></td>
+ <td><span class="hide"><%= html.html_escape(v.orig_size) %>b</span><%= html.html_escape(v.size) %></td>
<td><%= html.html_escape(v.mtime) %></td>
</tr>
<% end %>
-</tbody></table>
-<% htmlviewfunctions.displaysectionend(header_level) %>
+</tbody></table></dl>