Commit b0f5d4a3 authored by Ted Trask's avatar Ted Trask

Started work on updating for acf-core-0.15

Removed controllerfunctions library (still needs more work and corresponding work in model)
Updated startstop functionality and deleted view
Updated for viewfunctions to htmlviewfunctions and modified require statements for acf libraries
parent b621e263
......@@ -2,8 +2,6 @@
module (..., package.seeall)
require("controllerfunctions")
default_action = "status"
status = function( self )
......@@ -11,11 +9,11 @@ status = function( self )
end
startstop = function( self )
return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
general = function( self )
return controllerfunctions.handle_form(self, self.model.read_general_config, self.model.update_general_config, self.clientdata, "Save", "Edit General Configuration", "General Configuration Set")
return self.handle_form(self, self.model.read_general_config, self.model.update_general_config, self.clientdata, "Save", "Edit General Configuration", "General Configuration Set")
end
listfiles = function( self )
......@@ -27,5 +25,5 @@ listconfigfiles = function( self )
end
edit = function( self )
return controllerfunctions.handle_form(self, function() return self.model.get_file(self.clientdata.filename) end, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved")
return self.handle_form(self, function() return self.model.get_file(self.clientdata.filename) end, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved")
end
<%
require("viewfunctions")
require("htmlviewfunctions")
local form, viewlibrary, page_info, session = ...
%>
......@@ -10,7 +10,7 @@ end %>
<h1>Configuration</h1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
displayformstart(form)
htmlviewfunctions.displayformstart(form)
for field,val in pairs(form.value) do
val.name = field
end
......@@ -24,8 +24,8 @@ These parameters define the interface and port that Dansguardian uses to accept
</p>
<%
displayformitem(form.value.filterip)
displayformitem(form.value.filterport)
htmlviewfunctions.displayformitem(form.value.filterip)
htmlviewfunctions.displayformitem(form.value.filterport)
%>
</dl>
......@@ -36,8 +36,8 @@ These parameters define the ip address and port that Dansguardian should forward
</p>
<%
displayformitem(form.value.proxyip)
displayformitem(form.value.proxyport)
htmlviewfunctions.displayformitem(form.value.proxyip)
htmlviewfunctions.displayformitem(form.value.proxyport)
%>
</dl>
......@@ -50,12 +50,12 @@ The author recommends 50 for "young children", 100 for "older children" and 160
</p>
<%
displayformitem(form.value.accessdeniedaddress)
displayformitem(form.value.naughtynesslimit)
htmlviewfunctions.displayformitem(form.value.accessdeniedaddress)
htmlviewfunctions.displayformitem(form.value.naughtynesslimit)
%>
</dl>
<h2>Save Changes</h2>
<DL>
<% displayformend(form) %>
<% htmlviewfunctions.displayformend(form) %>
</DL>
<% local view, viewlibrary, page_info, session = ...
require("viewfunctions")
require("htmlviewfunctions")
%>
<% displaycommandresults({"edit"}, session) %>
<% htmlviewfunctions.displaycommandresults({"edit"}, session) %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
......
......@@ -4,9 +4,9 @@ module (..., package.seeall)
-- Load libraries
require("modelfunctions")
require("posix")
require("fs")
require("format")
require("validator")
fs = require("acf.fs")
format = require("acf.format")
validator = require("acf.validator")
-- Set variables
dansguardiancfg = "/etc/dansguardian/dansguardian.conf"
......@@ -82,8 +82,12 @@ get_status = function()
return modelfunctions.getstatus(processname, packagename, "Dans Guardian Status")
end
startstop_service = function( action )
return modelfunctions.startstop_service(processname, action)
function get_startstop(clientdata)
return modelfunctions.get_startstop(processname)
end
function startstop_service(startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
read_general_config = function()
......
../startstop-html.lsp
\ No newline at end of file
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