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-model.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tinydns-model.lua') diff --git a/tinydns-model.lua b/tinydns-model.lua index 95e5f4f..dcbe9da 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -269,13 +269,16 @@ end function getnewconfigfile() local options = {} - options.filename = cfe({ value=configdir.."/", label="File Name" }) + options.filename = cfe({ label="File Name" }) return cfe({ type="group", value=options, label="New config file" }) end function createconfigfile(self, configfile, userid) configfile.errtxt = "Failed to create file" local path = configfile.value.filename.value + if not string.find(path, "/") then + path = configdir .. "/" .. path + end if validator.is_valid_filename(path,configdir) then if (fs.is_file(path)) then configfile.value.filename.errtxt = "File already exists" -- cgit v1.2.3