From 3e3b57d95cffc81ef56f5458c68998d2ccbf1b59 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 28 Apr 2012 12:17:43 +0000 Subject: Updated for handle_form now passing self to get and set functions --- tcpproxy-model.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tcpproxy-model.lua b/tcpproxy-model.lua index 001905d..75d5c7b 100644 --- a/tcpproxy-model.lua +++ b/tcpproxy-model.lua @@ -188,11 +188,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 @@ -204,8 +204,8 @@ function getconfigfile() return modelfunctions.getfiledetails(configfile) end -function setconfigfile(filedetails) - return modelfunctions.setfiledetails(filedetails, {configfile}) +function setconfigfile(self, filedetails) + return modelfunctions.setfiledetails(self, filedetails, {configfile}) end function getsmtpstatus() @@ -283,7 +283,7 @@ function readsmtpentry(ipaddr) return cfe({ type="group", value={ipaddr=ipaddrcfe, server=server, addressonly=addressonly, domain=domain, optionalserver=optionalserver, optionalrewritelist=optionalrewritelist, senderlistfile=senderlistfile, rcptlistfile=rcptlistfile}, label="SMTP Proxy Entry" }) end -function updatesmtpentry(entry) +function updatesmtpentry(self, entry) local success, entry = validatesmtpentry(entry) if success then @@ -353,7 +353,7 @@ function getnewsmtpfile() return cfe({ type="group", value={filename=filename}, label="SMTP Proxy File" }) end -function createsmtpfile(filedetails) +function createsmtpfile(self, filedetails) local success = true if not validator.is_valid_filename(filedetails.value.filename.value, smtpdirectory) then @@ -380,8 +380,8 @@ function readsmtpfile(filename) return modelfunctions.getfiledetails(filename, function(filename) return validator.is_valid_filename(filename, smtpdirectory) end) end -function updatesmtpfile(filedetails) - return modelfunctions.setfiledetails(filedetails, function(filename) return validator.is_valid_filename(filename, smtpdirectory) end) +function updatesmtpfile(self, filedetails) + return modelfunctions.setfiledetails(self, filedetails, function(filename) return validator.is_valid_filename(filename, smtpdirectory) end) end function delsmtpfile(filename) -- cgit v1.2.3