summaryrefslogtreecommitdiffstats
path: root/squid-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-04-28 12:17:43 +0000
committerTed Trask <ttrask01@yahoo.com>2012-04-28 12:17:43 +0000
commitea1a646373778614d994ec58fee4a7ef9bed9e8c (patch)
treef56832cc2fb025cad222eb997db4528375ef45d0 /squid-model.lua
parenta041164aca00a7a365674361390a26ffa00d8242 (diff)
downloadacf-squid-ea1a646373778614d994ec58fee4a7ef9bed9e8c.tar.bz2
acf-squid-ea1a646373778614d994ec58fee4a7ef9bed9e8c.tar.xz
Updated for handle_form now passing self to get and set functions
Diffstat (limited to 'squid-model.lua')
-rw-r--r--squid-model.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/squid-model.lua b/squid-model.lua
index 0ad6d2f..83389b1 100644
--- a/squid-model.lua
+++ b/squid-model.lua
@@ -38,11 +38,11 @@ getstatus = function()
return modelfunctions.getstatus(processname, packagename, "Squid status")
end
-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
@@ -50,8 +50,8 @@ get_configfile = function()
return modelfunctions.getfiledetails(squidconf)
end
-update_configfile = function( filedetails )
- return modelfunctions.setfiledetails(filedetails, {squidconf})
+update_configfile = function(self, filedetails)
+ return modelfunctions.setfiledetails(self, filedetails, {squidconf})
end
read_digest_userlist = function()
@@ -77,9 +77,9 @@ read_digest_userlist = function()
return retval
end
-update_digest_userlist = function( userlistdetails )
+update_digest_userlist = function(self, userlistdetails)
-- FIXME - validate
- modelfunctions.setfiledetails(userlistdetails, {squiddigestusers})
+ modelfunctions.setfiledetails(self, userlistdetails, {squiddigestusers})
return read_digest_userlist()
end
@@ -197,7 +197,7 @@ read_config = function()
return cfe({ type="group", value=retval, label="Squid Config" })
end
-update_config = function(newconfig)
+update_config = function(self, newconfig)
local success, newconfig = validate_config(newconfig)
local lastport, lastlog, lastcache, lastauth
@@ -418,7 +418,7 @@ function getnewfile()
return cfe({ type="group", value={filename=filename}, label="Squid File" })
end
-function createfile(filedetails)
+function createfile(self, filedetails)
local success = true
local path = string.match(filedetails.value.filename.value, "^%s*(.*%S)%s*$") or ""
if not string.find(path, "/") then
@@ -449,8 +449,8 @@ function readfile(filename)
return modelfunctions.getfiledetails(filename, listfiles().value)
end
-function updatefile(filedetails)
- return modelfunctions.setfiledetails(filedetails, listfiles().value)
+function updatefile(self, filedetails)
+ return modelfunctions.setfiledetails(self, filedetails, listfiles().value)
end
function deletefile(filename)