summaryrefslogtreecommitdiffstats
path: root/tinydns-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r--tinydns-model.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua
index 0fa92f1..6b77acc 100644
--- a/tinydns-model.lua
+++ b/tinydns-model.lua
@@ -181,13 +181,13 @@ function getconfig()
return cfe({ type="group", value=config, label="TinyDNS Configuration" })
end
-function setconfig(conf)
+function setconfig(self, conf)
local test, errtxt = validator.is_ipv4(conf.value.listen.value)
if not test then
conf.value.listen.errtxt = errtxt
conf.errtxt = "Failed to set configuration"
else
- write_file_with_audit(configfile, format.update_ini_file(fs.read_file(configfile) or "","","IP",conf.value.listen.value))
+ modelfunctions.write_file_with_audit(self, configfile, format.update_ini_file(fs.read_file(configfile) or "","","IP",conf.value.listen.value))
end
return conf
@@ -284,8 +284,7 @@ function createconfigfile(self, configfile, userid)
if (posix.stat(path)) then
configfile.value.filename.errtxt = "File already exists"
else
- local file = io.open(path, "w")
- file:close()
+ fs.create_file(path)
configfile.errtxt = nil
-- We have to add this file to the allowed list, if there is one