summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-09 19:24:30 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-09 19:24:30 +0000
commitfcaab1b363fcd5ff2dccce8f98cacabc5635ba5f (patch)
treecd28bbb1bc80b0a36de234768fd6f3b75b8fcc9c
parente07736354b22bef2599d1831a6ba435808c0630d (diff)
downloadacf-core-fcaab1b363fcd5ff2dccce8f98cacabc5635ba5f.tar.bz2
acf-core-fcaab1b363fcd5ff2dccce8f98cacabc5635ba5f.tar.xz
Change use of require to work with Lua 5.2
-rw-r--r--app/acf-util/logon-model.lua6
-rw-r--r--app/acf-util/password-controller.lua2
-rw-r--r--app/acf-util/password-model.lua4
-rw-r--r--app/acf-util/password-status-html.lsp2
-rw-r--r--app/acf-util/roles-model.lua6
-rw-r--r--app/acf-util/roles-viewroles-html.lsp2
-rw-r--r--app/acf-util/skins-model.lua2
-rw-r--r--app/acf-util/skins-read-html.lsp2
-rw-r--r--app/acf-util/welcome-html.lsp2
-rw-r--r--app/acf_cli-controller.lua4
-rw-r--r--app/acf_www-controller.lua4
-rw-r--r--app/debug-html.lsp2
-rw-r--r--app/filedetails-html.lsp2
-rw-r--r--app/status-html.lsp2
-rwxr-xr-xbin/acf-cli2
-rw-r--r--lib/authenticator-plaintext.lua2
-rw-r--r--lib/authenticator.lua8
-rw-r--r--lib/htmlviewfunctions.lua2
-rw-r--r--lib/menubuilder.lua2
-rw-r--r--lib/modelfunctions.lua4
-rw-r--r--lib/roles.lua2
-rw-r--r--lib/session.lua2
-rwxr-xr-xlua/mvc.lua8
23 files changed, 37 insertions, 37 deletions
diff --git a/app/acf-util/logon-model.lua b/app/acf-util/logon-model.lua
index 833d665..fd67ec2 100644
--- a/app/acf-util/logon-model.lua
+++ b/app/acf-util/logon-model.lua
@@ -2,11 +2,11 @@
module (..., package.seeall)
-require ("session")
+session = require ("session")
html = require ("acf.html")
fs = require ("acf.fs")
-require ("roles")
-require ("authenticator")
+roles = require ("roles")
+authenticator = require ("authenticator")
-- Logoff the user by deleting session data
logoff = function (sessiondir, sessiondata)
diff --git a/app/acf-util/password-controller.lua b/app/acf-util/password-controller.lua
index 6518249..40ba61b 100644
--- a/app/acf-util/password-controller.lua
+++ b/app/acf-util/password-controller.lua
@@ -1,5 +1,5 @@
module(..., package.seeall)
-require("roles")
+roles = require("roles")
default_action = "editme"
diff --git a/app/acf-util/password-model.lua b/app/acf-util/password-model.lua
index b9cafb9..a329c19 100644
--- a/app/acf-util/password-model.lua
+++ b/app/acf-util/password-model.lua
@@ -1,7 +1,7 @@
module(..., package.seeall)
-require("authenticator")
-require("roles")
+authenticator = require("authenticator")
+roles = require("roles")
avail_roles, avail_skins, avail_homes = nil
diff --git a/app/acf-util/password-status-html.lsp b/app/acf-util/password-status-html.lsp
index 762136b..f322b55 100644
--- a/app/acf-util/password-status-html.lsp
+++ b/app/acf-util/password-status-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info, session = ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<% htmlviewfunctions.displaycommandresults({"newuser", "edituser", "deleteuser"}, session) %>
diff --git a/app/acf-util/roles-model.lua b/app/acf-util/roles-model.lua
index 2181a70..4d5d1d3 100644
--- a/app/acf-util/roles-model.lua
+++ b/app/acf-util/roles-model.lua
@@ -1,9 +1,9 @@
-- Roles/Group functions
module (..., package.seeall)
-require("modelfunctions")
-require("authenticator")
-require("roles")
+modelfunctions = require("modelfunctions")
+authenticator = require("authenticator")
+roles = require("roles")
-- Return roles/permissions for specified user
get_user_roles = function(self, userid)
diff --git a/app/acf-util/roles-viewroles-html.lsp b/app/acf-util/roles-viewroles-html.lsp
index 9a3be5d..779d8fc 100644
--- a/app/acf-util/roles-viewroles-html.lsp
+++ b/app/acf-util/roles-viewroles-html.lsp
@@ -1,5 +1,5 @@
<% local view, viewlibrary, page_info, session= ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<% htmlviewfunctions.displaycommandresults({"newrole", "editrole", "deleterole"}, session) %>
diff --git a/app/acf-util/skins-model.lua b/app/acf-util/skins-model.lua
index b717de6..e646af9 100644
--- a/app/acf-util/skins-model.lua
+++ b/app/acf-util/skins-model.lua
@@ -1,6 +1,6 @@
module (..., package.seeall)
-require("modelfunctions")
+modelfunctions = require("modelfunctions")
fs = require("acf.fs")
format = require("acf.format")
diff --git a/app/acf-util/skins-read-html.lsp b/app/acf-util/skins-read-html.lsp
index 50581af..dff5ae2 100644
--- a/app/acf-util/skins-read-html.lsp
+++ b/app/acf-util/skins-read-html.lsp
@@ -1,5 +1,5 @@
<% local view, viewlibrary, page_info, session = ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<% htmlviewfunctions.displaycommandresults({"update"}, session) %>
diff --git a/app/acf-util/welcome-html.lsp b/app/acf-util/welcome-html.lsp
index 6a1fc17..7540b94 100644
--- a/app/acf-util/welcome-html.lsp
+++ b/app/acf-util/welcome-html.lsp
@@ -1,5 +1,5 @@
<% view = ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<h1>Alpine Configuration Framework</h1>
<DL><p>Welcome.</p></DL>
diff --git a/app/acf_cli-controller.lua b/app/acf_cli-controller.lua
index 130d60a..1828d10 100644
--- a/app/acf_cli-controller.lua
+++ b/app/acf_cli-controller.lua
@@ -1,6 +1,7 @@
module(..., package.seeall)
-require("posix")
+posix = require("posix")
+session = require("session")
local parent_exception_handler
@@ -19,7 +20,6 @@ mvc.on_load = function (self, parent)
end
self.session = {}
- local x=require("session")
end
exception_handler = function (self, message )
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua
index 4aa5b44..0391347 100644
--- a/app/acf_www-controller.lua
+++ b/app/acf_www-controller.lua
@@ -9,7 +9,7 @@ module(..., package.seeall)
-- This is not in the global namespace, but future
-- require statements shouldn't need to go to the disk lib
-require "posix"
+posix = require("posix")
-- We use the parent exception handler in a last-case situation
local parent_exception_handler
@@ -268,7 +268,7 @@ mvc.on_load = function (self, parent)
end
self.sessiondata = {}
self.sessiondata.id = sessionlib.random_hash(512)
- require("authenticator")
+ authenticator = require("authenticator")
self.sessiondata.userinfo = authenticator.get_userinfo(self, ENV.REMOTE_USER)
logevent("Automatic logon as ENV.REMOTE_USER: "..tostring(ENV.REMOTE_USER))
end
diff --git a/app/debug-html.lsp b/app/debug-html.lsp
index ee49434..f857b4f 100644
--- a/app/debug-html.lsp
+++ b/app/debug-html.lsp
@@ -1,5 +1,5 @@
<% local data, viewlibrary, page_info, session = ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<H1>Debugging</H1>
<H2>View Data:</H2>
<%= htmlviewfunctions.cfe_unpack(data) %>
diff --git a/app/filedetails-html.lsp b/app/filedetails-html.lsp
index 12f88c3..1d5f446 100644
--- a/app/filedetails-html.lsp
+++ b/app/filedetails-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info = ... %>
-<% require("htmlviewfunctions") %>
+<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>
<% if form.type == "form" then %>
diff --git a/app/status-html.lsp b/app/status-html.lsp
index 370b62d..d8f7b37 100644
--- a/app/status-html.lsp
+++ b/app/status-html.lsp
@@ -1,5 +1,5 @@
<% local data, viewlibrary, page_info, session = ...
-require("htmlviewfunctions")
+htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
diff --git a/bin/acf-cli b/bin/acf-cli
index aaa32dc..dab8c0f 100755
--- a/bin/acf-cli
+++ b/bin/acf-cli
@@ -20,7 +20,7 @@ Output will be a serialized Lua table unless specified otherwise with "viewtype"
return
end
-require("posix")
+posix = require("posix")
mvc = require("acf.mvc")
FRAMEWORK=mvc:new()
diff --git a/lib/authenticator-plaintext.lua b/lib/authenticator-plaintext.lua
index c652fec..caa6748 100644
--- a/lib/authenticator-plaintext.lua
+++ b/lib/authenticator-plaintext.lua
@@ -10,7 +10,7 @@ create a different file for each field.
module (..., package.seeall)
fs = require("acf.fs")
-require("posix")
+posix = require("posix")
list_fields = function(self, tabl)
if not self or not tabl or tabl == "" then
diff --git a/lib/authenticator.lua b/lib/authenticator.lua
index 311e764..789ecde 100644
--- a/lib/authenticator.lua
+++ b/lib/authenticator.lua
@@ -3,11 +3,11 @@
-- password:username:ROLE1[,ROLE2...]
module (..., package.seeall)
-require("modelfunctions")
+modelfunctions = require("modelfunctions")
format = require("acf.format")
-require("md5")
-require("posix")
-require("session")
+md5 = require("md5")
+posix = require("posix")
+session = require("session")
-- This is the sub-authenticator
local auth = {}
diff --git a/lib/htmlviewfunctions.lua b/lib/htmlviewfunctions.lua
index 3d6efde..6f7512a 100644
--- a/lib/htmlviewfunctions.lua
+++ b/lib/htmlviewfunctions.lua
@@ -1,7 +1,7 @@
module(..., package.seeall)
html = require("acf.html")
-require("session")
+session = require("session")
local function getlabel(myitem, value)
if myitem and (myitem.type == "select" or myitem.type == "multi") then
diff --git a/lib/menubuilder.lua b/lib/menubuilder.lua
index 831ceb3..b40348a 100644
--- a/lib/menubuilder.lua
+++ b/lib/menubuilder.lua
@@ -5,7 +5,7 @@
]]--
module(..., package.seeall)
-require("posix")
+posix = require("posix")
format = require("acf.format")
fs = require("acf.fs")
diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua
index 54e9fb4..fb85102 100644
--- a/lib/modelfunctions.lua
+++ b/lib/modelfunctions.lua
@@ -4,8 +4,8 @@ module(..., package.seeall)
fs = require("acf.fs")
format = require("acf.format")
processinfo = require("acf.processinfo")
-require("posix")
-require("subprocess")
+posix = require("posix")
+subprocess = require("subprocess")
function getenabled(servicename)
local result = cfe({ label = "Program status", name=servicename })
diff --git a/lib/roles.lua b/lib/roles.lua
index 0100602..5cc293d 100644
--- a/lib/roles.lua
+++ b/lib/roles.lua
@@ -1,6 +1,6 @@
--this module is for authorization help and group/role management
-require ("authenticator")
+authenticator = require ("authenticator")
fs = require ("acf.fs")
format = require ("acf.format")
diff --git a/lib/session.lua b/lib/session.lua
index d41a3f6..12f0c28 100644
--- a/lib/session.lua
+++ b/lib/session.lua
@@ -12,7 +12,7 @@
module (..., package.seeall)
-require "posix"
+posix = require("posix")
minutes_expired_events=30
minutes_count_events=30
diff --git a/lua/mvc.lua b/lua/mvc.lua
index 51e6eaa..a9619ae 100755
--- a/lua/mvc.lua
+++ b/lua/mvc.lua
@@ -6,8 +6,8 @@
]]--
module(..., package.seeall)
-require("posix")
-require("subprocess")
+posix = require("posix")
+subprocess = require("subprocess")
format = require("acf.format")
-- For security, set the path
@@ -340,10 +340,10 @@ end
-- The view of last resort
auto_view = function(viewtable, viewlibrary, pageinfo, session)
if pageinfo.viewtype == "html" then
- require("htmlviewfunctions")
+ local htmlviewfunctions = require("htmlviewfunctions")
htmlviewfunctions.displayitem(viewtable, 1, pageinfo)
elseif pageinfo.viewtype == "json" then
- require("json")
+ local json = require("json")
print(json.encode(viewtable))
elseif pageinfo.viewtype == "stream" then
io.write(viewtable.value)