From 0ec29efff673e7219b6c85f9f086c62db39de1f5 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 30 Sep 2014 12:30:36 +0000 Subject: Add links from editmacauthfile and viewpasswdfile HTML views to editfile (cherry picked from commit d5363dd01400989078c25d355390ce1d34f5a8b1) Conflicts: freeradius3-editmacauthfile-html.lsp freeradius3-viewpasswdfile-html.lsp Also added displaycommandresults to avoid errors on second attempt --- freeradius3-editmacauthfile-html.lsp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'freeradius3-editmacauthfile-html.lsp') diff --git a/freeradius3-editmacauthfile-html.lsp b/freeradius3-editmacauthfile-html.lsp index 940abf2..5781544 100644 --- a/freeradius3-editmacauthfile-html.lsp +++ b/freeradius3-editmacauthfile-html.lsp @@ -1,4 +1,4 @@ -<% local form, viewlibrary, page_info = ... %> +<% local form, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> @@ -71,6 +71,8 @@ }); +<% htmlviewfunctions.displaycommandresults({"editfile"}, session) %> +

Edit MAC Authentication File

<% @@ -88,6 +90,7 @@ htmlviewfunctions.displayitem(form.value.mtime) form.value.filecontent.type = "hidden" htmlviewfunctions.displayformitem(form.value.filecontent, "filecontent") %> +<% if not form.value.filename.errtxt then %> <% for line in string.gmatch(html.html_escape(form.value.filecontent.value), "([^\n]*)\n?") do %> @@ -99,3 +102,15 @@ htmlviewfunctions.displayitem(form.value.mtime) htmlviewfunctions.displayformend(form) %> +<% end %> + +<% if not form.value.filename.errtxt and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("editfile") then %> +

Expert

+
+
+
+ + +
+
+<% end %> -- cgit v1.2.3
<%= line %>