diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-10-21 17:23:10 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-10-21 17:23:10 +0000 |
commit | 83f91021bea9203fa8fe0877846a299c296df97d (patch) | |
tree | 725c9e70a7b69da2ea655ebb4df511288286db98 /tinydns-model.lua | |
parent | 5484e1fff4c4a8c9c2ae557a5c322f50299aae60 (diff) | |
download | acf-tinydns-83f91021bea9203fa8fe0877846a299c296df97d.tar.bz2 acf-tinydns-83f91021bea9203fa8fe0877846a299c296df97d.tar.xz |
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
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r-- | tinydns-model.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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" |