diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 01:02:28 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-04-18 01:02:28 +0000 |
commit | b0f5d4a3e85032894ec394e929ffc475d685ab0c (patch) | |
tree | be6ba065708dd9affd7bc2177e058feb0134dfe7 | |
parent | b621e263aee67bf6fbffddf4cbd79455f9c98a01 (diff) | |
download | acf-dansguardian-b0f5d4a3e85032894ec394e929ffc475d685ab0c.tar.bz2 acf-dansguardian-b0f5d4a3e85032894ec394e929ffc475d685ab0c.tar.xz |
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
-rw-r--r-- | dansguardian-controller.lua | 8 | ||||
-rw-r--r-- | dansguardian-general-html.lsp | 18 | ||||
-rw-r--r-- | dansguardian-html.lsp | 4 | ||||
-rw-r--r-- | dansguardian-model.lua | 14 | ||||
l--------- | dansguardian-startstop-html.lsp | 1 |
5 files changed, 23 insertions, 22 deletions
diff --git a/dansguardian-controller.lua b/dansguardian-controller.lua index 8de38b0..80dbec2 100644 --- a/dansguardian-controller.lua +++ b/dansguardian-controller.lua @@ -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 diff --git a/dansguardian-general-html.lsp b/dansguardian-general-html.lsp index 3adff09..e83ff4c 100644 --- a/dansguardian-general-html.lsp +++ b/dansguardian-general-html.lsp @@ -1,5 +1,5 @@ <% -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> diff --git a/dansguardian-html.lsp b/dansguardian-html.lsp index ccb3274..a3d543f 100644 --- a/dansguardian-html.lsp +++ b/dansguardian-html.lsp @@ -1,8 +1,8 @@ <% 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") diff --git a/dansguardian-model.lua b/dansguardian-model.lua index e048a0b..4180226 100644 --- a/dansguardian-model.lua +++ b/dansguardian-model.lua @@ -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() diff --git a/dansguardian-startstop-html.lsp b/dansguardian-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/dansguardian-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp
\ No newline at end of file |