summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-12-30 14:03:14 +0000
committerTed Trask <ttrask01@yahoo.com>2015-12-30 14:03:14 +0000
commit51bea6689631af38032a384d6eaa8488a068cfee (patch)
treee32597fb5a583118f2b5cb0692d4b34e569e8329
parentead073ce065f691630cb7a3595dbeb8377b70da3 (diff)
downloadacf-freeradius3-51bea6689631af38032a384d6eaa8488a068cfee.tar.bz2
acf-freeradius3-51bea6689631af38032a384d6eaa8488a068cfee.tar.xz
Change file actions filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
-rw-r--r--freeradius3-editmacauthfile-html.lsp4
-rw-r--r--freeradius3-listfiles-html.lsp10
-rw-r--r--freeradius3-listmacauthfiles-html.lsp10
-rw-r--r--freeradius3-listpasswdfiles-html.lsp10
-rw-r--r--freeradius3-model.lua6
5 files changed, 20 insertions, 20 deletions
diff --git a/freeradius3-editmacauthfile-html.lsp b/freeradius3-editmacauthfile-html.lsp
index 076c8f5..37ff038 100644
--- a/freeradius3-editmacauthfile-html.lsp
+++ b/freeradius3-editmacauthfile-html.lsp
@@ -76,7 +76,7 @@
<%
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.size)
htmlviewfunctions.displayitem(form.value.mtime)
if not form.value.filename.errtxt then
local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"}), page_info, htmlviewfunctions.incrementheader(header_level))
@@ -94,7 +94,7 @@ local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"
<%
htmlviewfunctions.displayinfo(form.value.filecontent)
htmlviewfunctions.displayformend(form)
-htmlviewfunctions.displaysectionend(header_level2)
+ htmlviewfunctions.displaysectionend(header_level2)
end
htmlviewfunctions.displaysectionend(header_level)
%>
diff --git a/freeradius3-listfiles-html.lsp b/freeradius3-listfiles-html.lsp
index 84effe0..1586893 100644
--- a/freeradius3-listfiles-html.lsp
+++ b/freeradius3-listfiles-html.lsp
@@ -41,10 +41,10 @@ end %>
</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 %>
+<% for i,file in ipairs( view.value ) do %>
<tr>
<td>
- <% filename.value = v.filename %>
+ <% filename.value = file.filename %>
<% if viewlibrary.check_permission("editfile") then %>
<% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %>
<% end %>
@@ -52,9 +52,9 @@ end %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletefile", class="deletefile"}), page_info, -1) %>
<% end %>
</td>
- <td><%= html.html_escape(v.filename) %></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>
+ <td><%= html.html_escape(file.filename) %></td>
+ <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td>
+ <td><%= format.formattime(file.mtime) %></td>
</tr>
<% end %>
</tbody></table>
diff --git a/freeradius3-listmacauthfiles-html.lsp b/freeradius3-listmacauthfiles-html.lsp
index b2e446d..39096b8 100644
--- a/freeradius3-listmacauthfiles-html.lsp
+++ b/freeradius3-listmacauthfiles-html.lsp
@@ -36,17 +36,17 @@ html = require("acf.html")
</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 %>
+<% for i,file in ipairs( view.value ) do %>
<tr>
<td>
- <% filename.value = v.filename %>
+ <% filename.value = file.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 %>
</td>
- <td><%= html.html_escape(v.filename) %></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>
+ <td><%= html.html_escape(file.filename) %></td>
+ <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td>
+ <td><%= format.formattime(file.mtime) %></td>
</tr>
<% end %>
</tbody></table>
diff --git a/freeradius3-listpasswdfiles-html.lsp b/freeradius3-listpasswdfiles-html.lsp
index de3e162..ecf36a0 100644
--- a/freeradius3-listpasswdfiles-html.lsp
+++ b/freeradius3-listpasswdfiles-html.lsp
@@ -34,17 +34,17 @@ html = require("acf.html")
</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 %>
+<% for i,file in ipairs( view.value ) do %>
<tr>
<td>
- <% filename.value = v.filename %>
+ <% filename.value = file.filename %>
<% if viewlibrary.check_permission("viewpasswdfile") then %>
<% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="View", action="viewpasswdfile"}), page_info, -1) %>
<% end %>
</td>
- <td><%= html.html_escape(v.filename) %></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>
+ <td><%= html.html_escape(file.filename) %></td>
+ <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td>
+ <td><%= format.formattime(file.mtime) %></td>
</tr>
<% end %>
</tbody></table>
diff --git a/freeradius3-model.lua b/freeradius3-model.lua
index 84bd7e5..aad8eae 100644
--- a/freeradius3-model.lua
+++ b/freeradius3-model.lua
@@ -422,7 +422,7 @@ end
function mymodule.list_files()
local retval = {}
for file in fs.find(null, baseurl) do
- local details = fs.stat(file)
+ local details = posix.stat(file)
if details.type == "regular" then
details.filename = file
table.insert(retval, details)
@@ -488,7 +488,7 @@ function mymodule.list_passwd_files()
local files,errtxt = get_passwd_files()
if files then
for i,file in ipairs(files) do
- local details = fs.stat(file)
+ local details = posix.stat(file)
details.filename = file
table.insert(retval, details)
end
@@ -661,7 +661,7 @@ function mymodule.list_macauth_files()
local files,errtxt = get_macauth_files()
if files then
for i,file in ipairs(files) do
- local details = fs.stat(file)
+ local details = posix.stat(file)
details.filename = file
table.insert(retval, details)
end