summaryrefslogtreecommitdiffstats
path: root/dovecot-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-18 22:30:25 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-18 22:30:25 +0000
commit1eeac166a1a025ed1406fe21ceeb19618c328982 (patch)
tree862b98848041b729486aa1ded9ea2378416a4fd4 /dovecot-model.lua
parent8e8a385f5fdc04b0552c9fb657b12d043775062c (diff)
downloadacf-dovecot-1eeac166a1a025ed1406fe21ceeb19618c328982.tar.bz2
acf-dovecot-1eeac166a1a025ed1406fe21ceeb19618c328982.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 'dovecot-model.lua')
-rw-r--r--dovecot-model.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/dovecot-model.lua b/dovecot-model.lua
index f028f83..25393e0 100644
--- a/dovecot-model.lua
+++ b/dovecot-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -18,26 +18,28 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
-- ################################################################################
-- PUBLIC FUNCTIONS
-function get_startstop(self, clientdata)
+function mymodule.get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-function startstop_service(self, startstop, action)
+function mymodule.startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
-function getstatus()
+function mymodule.getstatus()
return modelfunctions.getstatus(processname, packagename, "Dovecot Status")
end
-function getstatusdetails()
+function mymodule.getstatusdetails()
return cfe({ type="longtext", value="", label="Dovecot Status Details" })
end
-function get_filedetails()
+function mymodule.get_filedetails()
return modelfunctions.getfiledetails(configfile)
end
-function update_filedetails(self, filedetails)
+function mymodule.update_filedetails(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
+
+return mymodule