summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-09-30 12:30:36 +0000
committerTed Trask <ttrask01@yahoo.com>2014-09-30 12:30:36 +0000
commitd5363dd01400989078c25d355390ce1d34f5a8b1 (patch)
tree566089a681d1e84c5eb9d7d36cbdb319939006ef
parentf652cfd01fd25af2bb9e3d404379b63961bd5af2 (diff)
downloadacf-freeradius3-d5363dd01400989078c25d355390ce1d34f5a8b1.tar.bz2
acf-freeradius3-d5363dd01400989078c25d355390ce1d34f5a8b1.tar.xz
Add links from editmacauthfile and viewpasswdfile HTML views to editfile
-rw-r--r--freeradius3-editmacauthfile-html.lsp8
-rw-r--r--freeradius3-viewpasswdfile-html.lsp7
2 files changed, 14 insertions, 1 deletions
diff --git a/freeradius3-editmacauthfile-html.lsp b/freeradius3-editmacauthfile-html.lsp
index 15a8200..c9015c0 100644
--- a/freeradius3-editmacauthfile-html.lsp
+++ b/freeradius3-editmacauthfile-html.lsp
@@ -76,6 +76,7 @@ local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Edit MAC
htmlviewfunctions.displayitem(form.value.filename)
htmlviewfunctions.displayitem(form.value.filesize)
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))
htmlviewfunctions.displayformstart(form, page_info)
form.value.filename.type = "hidden"
@@ -92,5 +93,12 @@ local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"
htmlviewfunctions.displayinfo(form.value.filecontent)
htmlviewfunctions.displayformend(form)
htmlviewfunctions.displaysectionend(header_level2)
+end
htmlviewfunctions.displaysectionend(header_level)
%>
+
+<% if not form.value.filename.errtxt and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("editfile" then
+ local filename = cfe({ type="hidden", value=form.value.filename.value })
+ local redir = cfe({ type="hidden", value=page_info.orig_action.."?filename="..html.url_encode(form.value.filename.value) })
+ htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="Expert", option="Edit", action="editfile"}), page_info, htmlviewfunctions.incrementheader(header_level)) %>
+end %>
diff --git a/freeradius3-viewpasswdfile-html.lsp b/freeradius3-viewpasswdfile-html.lsp
index fe28b28..c18e13c 100644
--- a/freeradius3-viewpasswdfile-html.lsp
+++ b/freeradius3-viewpasswdfile-html.lsp
@@ -25,6 +25,7 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"editpasswdentry", "deletepasswdentry", "editpasswd"}, 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 }) %>
<% -- This is a hack to redirect back to viewing the same file
redir.value = redir.value.."?filename="..html.url_encode(view.value.filename.value)
@@ -51,7 +52,6 @@ end
<% end %>
</tr>
</thead><tbody>
-<% local filename = cfe({ type="hidden", value=view.value.filename.value }) %>
<% local entry = cfe({ type="hidden", value="" }) %>
<% for i,r in ipairs( view.value.data.value ) do %>
<tr>
@@ -77,6 +77,11 @@ end
</tbody></table>
<% end %>
+
+<% if editable and view.value.data and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("editfile" then
+ htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="Expert", option="Edit", action="editfile"}), page_info, htmlviewfunctions.incrementheader(header_level)) %>
+end %>
+
<% if editable and view.value.data and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createpasswdentry") then
local createform = viewlibrary.dispatch_component("createpasswdentry", {filename=view.value.filename.value, redir=redir.value}, true)
createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createpasswdentry"