summaryrefslogtreecommitdiffstats
path: root/dansguardian-controller.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-18 20:13:46 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-18 20:13:46 +0000
commit5f9f108ea479a5bfea59e96802206851c6430ebe (patch)
tree6976f7d07f49f45ba1dd3a73e16d5a35c57f7c67 /dansguardian-controller.lua
parentbdabdb5ecb5744d011000ec058947ea331b9732e (diff)
downloadacf-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.lua19
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