From 2ece009273252437281c8cc0b84ba2ec49e5d07c Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Oct 2013 19:07:53 +0000 Subject: 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. --- password-model.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'password-model.lua') 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 -- cgit v1.2.3