Commit 97c78c56 authored by Ted Trask's avatar Ted Trask

Updated for handle_form now passing self to get and set functions

parent 68a8022f
......@@ -739,7 +739,7 @@ local validatesource = function(sourcedata)
return success
end
function updatesource(sourcedata)
function updatesource(self, sourcedata)
local success = validatesource(sourcedata)
sourcedata.errtxt = "Failed to update source"
if success then
......@@ -774,7 +774,7 @@ function getnewsource()
return cfe({ type="group", value=source, label="Source" })
end
function createsource(sourcedata)
function createsource(self, sourcedata)
local success = validatesource(sourcedata)
sourcedata.errtxt = "Failed to create source"
if success then
......@@ -999,7 +999,7 @@ function geteditselected()
return cfe({ type="group", value=result, label="Select / Deselect log entries" })
end
function editselected(data)
function editselected(self, data)
local res, err = pcall(function()
databaseconnect(DatabaseOwner)
con:execute("START TRANSACTION")
......@@ -1089,7 +1089,7 @@ function getweblogparameters()
return cfe({ type="group", value=result, label="Weblog Access Log" })
end
function getweblog(result)
function getweblog(self, result)
local success = validateweblogparameters(result)
result.value.log = cfe({ type="list", value={}, label="Weblog Access Log" })
result.value.window = cfe({ value=config.window or "5", label="Time Window" })
......@@ -1144,7 +1144,7 @@ function completeaudit(timestamp)
conf.value.auditstart.value = conf.value.auditend.value
local now = os.time()
conf.value.auditend.value = timestamp or os.date("%Y-%m-%d %H:%M:%S", now - now%86400 - 86400)
conf = updateconfig(conf)
conf = updateconfig(self, conf)
local retval = cfe({ value="Audit completed", label="Complete Audit Result" })
if conf.errtxt then
retval.value = ""
......@@ -1210,7 +1210,7 @@ local function validateconfig(newconfig)
return success, newconfig
end
function updateconfig(newconfig)
function updateconfig(self, newconfig)
local success = validateconfig(newconfig)
if success then
configcontent = format.update_ini_file(configcontent, "", "auditstart", newconfig.value.auditstart.value)
......@@ -1242,7 +1242,7 @@ function getnewadhocquery()
return cfe({ type="group", value=query, label="Ad-hoc Query" })
end
function adhocquery(query)
function adhocquery(self, query)
local success = true
query.value.query.value = query.value.query.value:lower()
if query.value.query.value == "" then
......@@ -1309,7 +1309,7 @@ function getnewdatabase()
return cfe({ type="group", value=database, label="Create Database", errtxt=errtxt })
end
function create_database(database)
function create_database(self, database)
local success = true
local errtxt
......@@ -1378,6 +1378,6 @@ function readfile(filename)
return modelfunctions.getfiledetails(filename, files)
end
function updatefile(filedetails)
return modelfunctions.setfiledetails(filedetails, files)
function updatefile(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, files)
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment