summaryrefslogtreecommitdiffstats
path: root/dnscache-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dnscache-model.lua')
-rw-r--r--dnscache-model.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/dnscache-model.lua b/dnscache-model.lua
index 5e02a1e..89685e3 100644
--- a/dnscache-model.lua
+++ b/dnscache-model.lua
@@ -59,11 +59,11 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function get_startstop(clientdata)
+function get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-function startstop_service(startstop, action)
+function startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
@@ -83,7 +83,7 @@ function getconfig()
return cfe({ type="group", value=output, label="DNS Cache Config" })
end
-function setconfig(config)
+function setconfig(self, config)
local success, config = validateconfig(config)
if success then
@@ -109,9 +109,9 @@ function getconfigfile()
return modelfunctions.getfiledetails(configfile)
end
-function setconfigfile(filedetails)
+function setconfigfile(self, filedetails)
-- FIXME Validate
- return modelfunctions.setfiledetails(filedetails, {configfile})
+ return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
function getIPs()
@@ -129,7 +129,7 @@ function getIPs()
return cfe({ type="group", value={iplist=iplist} })
end
-function setIPs(iplist)
+function setIPs(self, iplist)
local reverseIPs = {}
for i,name in ipairs(iplist.value.iplist.value) do
-- check if a valid (or partial) ip
@@ -178,7 +178,7 @@ function getNewDomain()
return cfe({ type="group", value={domain=domain} })
end
-function setNewDomain(domain)
+function setNewDomain(self, domain)
if "" ~= string.gsub(domain.value.domain.value..".", "%w+%.", "") then
domain.value.domain.errtxt = "Invalid domain"
domain.errtxt = "Failed to create domain"
@@ -211,7 +211,7 @@ function getDomain(getdomainname)
return cfe({ type="group", value={domain=domain, iplist=iplist} })
end
-function setDomain(domain)
+function setDomain(self, domain)
local success, domain = validatedomain(domain)
if success then
fs.write_file(baseurl.."servers/"..domain.value.domain.value,