From a0c9b5cb07e4b691874e858527e36cb8c83c56d0 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 4 Aug 2016 15:55:56 +0000 Subject: Remove trailing whitespace --- lib/README | 4 ++-- lib/authenticator-plaintext.lua | 6 +++--- lib/authenticator.lua | 14 +++++++------- lib/htmlviewfunctions.lua | 6 +++--- lib/menubuilder.lua | 10 +++++----- lib/modelfunctions.lua | 12 ++++++------ lib/roles.lua | 10 +++++----- lib/session.lua | 22 +++++++++++----------- 8 files changed, 42 insertions(+), 42 deletions(-) (limited to 'lib') diff --git a/lib/README b/lib/README index be6f1dc..a886dbc 100644 --- a/lib/README +++ b/lib/README @@ -5,7 +5,7 @@ Also we use Lua Posix for the rest of the functionality. *** These are currently being worked on. *** apk.lua - Helps with package version/install/remove -authenticator-plaintext.lua - sub-authenticator for plaintext files +authenticator-plaintext.lua - sub-authenticator for plaintext files authenticator.lua - Used for authentication and roles, generic and uses sub-authenticator date.lua - Date and Time functions format.lua - Library to help reformat strings and tables. @@ -16,5 +16,5 @@ modelfunctions.lua - Common model functions processinfo.lua - Start/stop, find running, find version - process helpers roles.lua - Used to determine roles and permissions session.lua - Helps with Session mangement in ACF -validator.lua - Validate web input for ACF. +validator.lua - Validate web input for ACF. htmlviewfunctions.lua - Common functions for HTML views diff --git a/lib/authenticator-plaintext.lua b/lib/authenticator-plaintext.lua index c1db54a..8cbf7a8 100644 --- a/lib/authenticator-plaintext.lua +++ b/lib/authenticator-plaintext.lua @@ -50,7 +50,7 @@ mymodule.read_field = function(self, tabl, field) end end return row - else + else return nil end end @@ -106,7 +106,7 @@ mymodule.delete_entry = function (self, tabl, field, id) return false end local result = false - + local passwd_path = self.conf.confdir .. field .. tabl local passwdfilecontent = fs.read_file_as_array(passwd_path) or {} local output = {} @@ -117,7 +117,7 @@ mymodule.delete_entry = function (self, tabl, field, id) result = true end end - + --Save the updated table if result == true then fs.write_file(passwd_path, table.concat(output,"\n")) diff --git a/lib/authenticator.lua b/lib/authenticator.lua index bce2af7..3bc9716 100644 --- a/lib/authenticator.lua +++ b/lib/authenticator.lua @@ -137,7 +137,7 @@ local load_database = function(self) complete = true end end - + local get_id = function(self, userid) if not authstruct[userid] then parse_entry(userid, auth.read_entry(self, mymodule.usertable, "", userid)) @@ -150,7 +150,7 @@ end -- true if password matches or -- false if password does not match local verify_password = function(plaintext, pwhash) - --[[ + --[[ from man crypt(3): If salt is a character string starting with the characters "$id$" fol- @@ -175,7 +175,7 @@ local verify_password = function(plaintext, pwhash) return (pwhash == posix.crypt(plaintext, algo_salt)) end -- fall back to old style md5 checksum - return (pwhash == md5.sumhexa(plaintext)) + return (pwhash == md5.sumhexa(plaintext)) end local b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./" @@ -185,7 +185,7 @@ local mksalt = function() local str = "" if file == nil then return nil end for i = 1,16 do - local offset = (string.byte(file:read(1)) % 64) + 1 + local offset = (string.byte(file:read(1)) % 64) + 1 str = str .. string.sub (b64, offset, offset) end return "$6$"..str.."$" @@ -218,7 +218,7 @@ mymodule.authenticate = function(self, userid, password) errtxt = "Invalid parameter" else local id = get_id(self, userid) - + if not id then errtxt = "Userid not found" elseif not verify_password(password, id.password) then @@ -285,7 +285,7 @@ mymodule.write_userinfo = function(self, userinfo) return success end - + mymodule.list_users = function (self) auth = mymodule.get_subauth(self) load_database(self) @@ -298,7 +298,7 @@ end mymodule.delete_user = function (self, userid) auth = mymodule.get_subauth(self) - authstruct[userid] = nil + authstruct[userid] = nil return auth.delete_entry(self, mymodule.usertable, "", userid) end diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua index 033370b..3571220 100644 --- a/lib/htmlviewfunctions.lua +++ b/lib/htmlviewfunctions.lua @@ -58,7 +58,7 @@ function mymodule.displayitemstart(myitem, page_info, header_level) header_level = header_level or page_info.header_level or 1 if 0 <= header_level then io.write('