From 94d2fdb5e7dc424efa0409d2617d3241e4daaa35 Mon Sep 17 00:00:00 2001 From: Zach LeBar Date: Fri, 30 Mar 2012 20:54:16 +0000 Subject: Fixing acf-chrony to work with changes made to acf-core. Removing the use of controllerfunctions.lua and using the new 'handle_form()' found in acf_www-controller.lua. Also using 'handle_form()' in place of 'redirect_to_referrer()'. --- chrony-controller.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'chrony-controller.lua') diff --git a/chrony-controller.lua b/chrony-controller.lua index 5f135da..16962bb 100644 --- a/chrony-controller.lua +++ b/chrony-controller.lua @@ -1,7 +1,5 @@ module(..., package.seeall) -require("controllerfunctions") - default_action = "status" function status(self) @@ -13,21 +11,21 @@ function details(self) end function startstop(self) - return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata) + return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata) end function config(self) - return controllerfunctions.handle_form(self, self.model.get_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Set") + return self.handle_form(self, self.model.get_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Set") end function keyfile(self) - return controllerfunctions.handle_form(self, self.model.get_keyfiledetails, self.model.update_keyfiledetails, self.clientdata, "Save", "Edit Key File", "Key File Saved") + return self.handle_form(self, self.model.get_keyfiledetails, self.model.update_keyfiledetails, self.clientdata, "Save", "Edit Key File", "Key File Saved") end function enablekeyfile(self) - return self:redirect_to_referrer(self.model.enable_keyfile()) + return self.handle_form(self, self.model.get_enable_keyfile, self.model.enable_keyfile, self.clientdata, "Enable", "Enabled Key File", "Enabled key file") end function expert(self) - return controllerfunctions.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit Config File", "Configuration Set") + return self.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit Config File", "Configuration Set") end -- cgit v1.2.3