summaryrefslogtreecommitdiffstats
path: root/password-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-17 19:07:53 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-17 19:07:53 +0000
commit2ece009273252437281c8cc0b84ba2ec49e5d07c (patch)
tree1c082ee4891a4717f2fea09f0df4a8946d9fdb41 /password-model.lua
parent0537a242f9709271454252e7897a7709144a3b02 (diff)
downloadacf-alpine-baselayout-2ece009273252437281c8cc0b84ba2ec49e5d07c.tar.bz2
acf-alpine-baselayout-2ece009273252437281c8cc0b84ba2ec49e5d07c.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 'password-model.lua')
-rw-r--r--password-model.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/password-model.lua b/password-model.lua
index 5c5f801..a91f3db 100644
--- a/password-model.lua
+++ b/password-model.lua
@@ -1,11 +1,11 @@
-- password model methods
-module (..., package.seeall)
+local mymodule = {}
fs = require("acf.fs")
format = require("acf.format")
posix = require("posix")
-read_password = function()
+mymodule.read_password = function()
pw = {}
pw.user = cfe({ label="User Name", seq=1 })
pw.password = cfe({ type="password", label="Password", seq=2 })
@@ -14,7 +14,7 @@ read_password = function()
end
--setup so that it will compare password input
-update_password = function (self, pw)
+mymodule.update_password = function (self, pw)
local success = true
if pw.value.password.value == "" or pw.value.password.value ~= pw.value.password_confirm.value then
pw.value.password.errtxt = "Invalid or non matching password"
@@ -44,3 +44,5 @@ update_password = function (self, pw)
return pw
end
+
+return mymodule