summaryrefslogtreecommitdiffstats
path: root/tinydns-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r--tinydns-model.lua5
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"