diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-28 12:01:51 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-04-28 12:01:51 +0000 |
commit | f536eae80f37f55d61d31b960042c368ca09d41e (patch) | |
tree | 7773e30c163c6518ee7bfeffa28513ecea472e5a | |
parent | 89d6fe43417668b06c24852c217a9487b1caa139 (diff) | |
download | acf-chrony-f536eae80f37f55d61d31b960042c368ca09d41e.tar.bz2 acf-chrony-f536eae80f37f55d61d31b960042c368ca09d41e.tar.xz |
Updated for handle_form now passing self to get and set functions
-rw-r--r-- | chrony-model.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chrony-model.lua b/chrony-model.lua index 0a4ab7c..350dd8b 100644 --- a/chrony-model.lua +++ b/chrony-model.lua @@ -67,14 +67,14 @@ end -- ################################################################################ -- PUBLIC FUNCTIONS -function get_startstop(clientdata) +function get_startstop(self, clientdata) local retval = modelfunctions.get_startstop(processname) retval.option[#retval.option+1] = "Online" retval.option[#retval.option+1] = "Offline" return retval end -function startstop_service(startstop, action) +function startstop_service(self, startstop, action) local lower = action:lower() if lower == "online" or lower == "offline" then -- try to find the password @@ -159,7 +159,7 @@ function get_config() return cfe({ type="group", value=output, label="Chrony Config" }) end -function update_config(config) +function update_config(self, config) local success, config = validate_config(config) if success then @@ -213,8 +213,8 @@ function get_keyfiledetails() return get_keyfilestatus(modelfunctions.getfiledetails(keyfile)) end -function update_keyfiledetails(filedetails) - return get_keyfilestatus(modelfunctions.setfiledetails(filedetails, {keyfile})) +function update_keyfiledetails(self, filedetails) + return get_keyfilestatus(modelfunctions.setfiledetails(self, filedetails, {keyfile})) end function get_enable_keyfile() @@ -222,10 +222,10 @@ function get_enable_keyfile() return cfe({ type="group", value=result, label="Enable Key File" }) end -function enable_keyfile(enablerequest) +function enable_keyfile(self, enablerequest) local config = get_config() config.value.keyfile.value = keyfile - config = update_config(config) + config = update_config(self, config) if config.errtxt then enablerequest.errtxt = {config.errtxt} for name,val in pairs(config.value) do @@ -243,8 +243,8 @@ function get_filedetails() return modelfunctions.getfiledetails(configfile) end -function update_filedetails(filedetails) +function update_filedetails(self, filedetails) -- FIXME validate - return modelfunctions.setfiledetails(filedetails, {configfile}) + return modelfunctions.setfiledetails(self, filedetails, {configfile}) end |