diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-18 20:13:46 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-18 20:13:46 +0000 |
commit | 5f9f108ea479a5bfea59e96802206851c6430ebe (patch) | |
tree | 6976f7d07f49f45ba1dd3a73e16d5a35c57f7c67 /dansguardian-controller.lua | |
parent | bdabdb5ecb5744d011000ec058947ea331b9732e (diff) | |
download | acf-dansguardian-5f9f108ea479a5bfea59e96802206851c6430ebe.tar.bz2 acf-dansguardian-5f9f108ea479a5bfea59e96802206851c6430ebe.tar.xz |
Remove all calls to 'module' in preparation for move to Lua 5.2
Use mymodule parameter for module definition.
This was also helpful in revealing places where the code relied on the global environment.
Diffstat (limited to 'dansguardian-controller.lua')
-rw-r--r-- | dansguardian-controller.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua index 80dbec2..5c7a34d 100644 --- a/dansguardian-controller.lua +++ b/dansguardian-controller.lua @@ -1,29 +1,30 @@ -- the squid controller +local mymodule = {} -module (..., package.seeall) +mymodule.default_action = "status" -default_action = "status" - -status = function( self ) +mymodule.status = function( self ) return self.model.get_status() end -startstop = function( self ) +mymodule.startstop = function( self ) return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata) end -general = function( self ) +mymodule.general = function( self ) return self.handle_form(self, self.model.read_general_config, self.model.update_general_config, self.clientdata, "Save", "Edit General Configuration", "General Configuration Set") end -listfiles = function( self ) +mymodule.listfiles = function( self ) return self.model.list_files() end -listconfigfiles = function( self ) +mymodule.listconfigfiles = function( self ) return self.model.list_config_files() end -edit = function( self ) +mymodule.edit = function( self ) return self.handle_form(self, function() return self.model.get_file(self.clientdata.filename) end, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved") end + +return mymodule |