From 4d34a67733a5072011de018481eae78cd248c631 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Sat, 28 Apr 2012 12:17:44 +0000 Subject: Updated for handle_form now passing self to get and set functions --- freeswitch-model.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'freeswitch-model.lua') diff --git a/freeswitch-model.lua b/freeswitch-model.lua index e42fd1f..610d4df 100644 --- a/freeswitch-model.lua +++ b/freeswitch-model.lua @@ -29,11 +29,11 @@ get_status = function() return modelfunctions.getstatus(processname, packagename, "Freeswitch 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 @@ -48,8 +48,8 @@ get_file = function(filename) return modelfunctions.getfiledetails(filename, is_valid_filename) end -update_file = function(filedetails) - local ret = modelfunctions.setfiledetails(filedetails, is_valid_filename) +update_file = function(self, filedetails) + local ret = modelfunctions.setfiledetails(self, filedetails, is_valid_filename) if not ret.errtxt then posix.chmod(filedetails.value.filename.value, "rw-------") posix.chown(filedetails.value.filename.value, posix.getpasswd("freeswitch", "uid") or 0, posix.getpasswd("freeswitch", "gid") or 0) @@ -75,7 +75,7 @@ function getnewfile() return cfe({ type="group", value={filename=filename}, label="Freeswitch 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 -- cgit v1.2.3