From 83f91021bea9203fa8fe0877846a299c296df97d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 21 Oct 2008 17:23:10 +0000 Subject: Modified TinyDNS to include more intelligence. Changed listfiles and newfile to not display / require directory. Made edit function in controller to allow control independent from expert. Modified edit to limit entries to the domain indicated by the file name. git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@1557 ab2d0c66-481e-0410-8bed-d214d4d58bed --- tinydns-controller.lua | 4 ++++ tinydns-edit-html.lsp | 24 +++++++++++++++++++----- tinydns-listfiles-html.lsp | 12 +++++++----- tinydns-model.lua | 5 ++++- tinydns-view-html.lsp | 2 +- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/tinydns-controller.lua b/tinydns-controller.lua index aa85efc..bcaffa4 100644 --- a/tinydns-controller.lua +++ b/tinydns-controller.lua @@ -37,6 +37,10 @@ function listfiles(self) return cfe({ type="list", value=config, label="Config files" }) end +function edit(self) + return editfile(self) +end + function editfile(self) config = controllerfunctions.handle_form(self, function() return self.model.get_filedetails(self, self.clientdata.filename, sessiondata.userinfo.userid) diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index ddb4ae4..a4754e1 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -1,7 +1,7 @@ <% local form, viewlibrary, page_info = ... %> <% require("viewfunctions") %> -<% form = viewlibrary.dispatch_component(page_info.prefix .. page_info.controller .. "/editfile", form, true) %> +<% local domain = string.gsub(form.value.filename.value, "^.*/", "") %>