summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-04-18 01:58:05 +0000
committerTed Trask <ttrask01@yahoo.com>2012-04-18 01:58:05 +0000
commita041164aca00a7a365674361390a26ffa00d8242 (patch)
tree481f2ee446ca6671c60012d865d1ece6d7941e59
parentcbd7207fdf7f206aa9574e2169fe79891805777d (diff)
downloadacf-squid-a041164aca00a7a365674361390a26ffa00d8242.tar.bz2
acf-squid-a041164aca00a7a365674361390a26ffa00d8242.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--squid-config-html.lsp4
-rw-r--r--squid-controller.lua16
-rw-r--r--squid-digest-html.lsp6
-rw-r--r--squid-listfiles-html.lsp8
-rw-r--r--squid-model.lua14
l---------squid-startstop-html.lsp1
6 files changed, 25 insertions, 24 deletions
diff --git a/squid-config-html.lsp b/squid-config-html.lsp
index 750718b..30203e8 100644
--- a/squid-config-html.lsp
+++ b/squid-config-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
<% if viewlibrary and viewlibrary.dispatch_component then
@@ -10,5 +10,5 @@ end %>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
local order = {"httpports", "accesslog", "diskcache", "authmethod"}
- displayform(form, order)
+ htmlviewfunctions.displayform(form, order)
%>
diff --git a/squid-controller.lua b/squid-controller.lua
index e99345f..3174f61 100644
--- a/squid-controller.lua
+++ b/squid-controller.lua
@@ -2,8 +2,6 @@
module (..., package.seeall)
-require("controllerfunctions")
-
default_action = "status"
status = function( self )
@@ -11,15 +9,15 @@ 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
config = function( self )
- return controllerfunctions.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Set")
+ return self.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Set")
end
digest = function( self )
- return controllerfunctions.handle_form(self, self.model.read_digest_userlist, self.model.update_digest_userlist, self.clientdata, "Save", "Edit User List", "User List Set")
+ return self.handle_form(self, self.model.read_digest_userlist, self.model.update_digest_userlist, self.clientdata, "Save", "Edit User List", "User List Set")
end
enabledigestlist = function( self )
@@ -27,7 +25,7 @@ enabledigestlist = function( self )
end
expert = function( self )
- return controllerfunctions.handle_form(self, self.model.get_configfile, self.model.update_configfile, self.clientdata, "Save", "Edit Config", "Configuration Set")
+ return self.handle_form(self, self.model.get_configfile, self.model.update_configfile, self.clientdata, "Save", "Edit Config", "Configuration Set")
end
--[[
saccess = function( self )
@@ -54,7 +52,7 @@ listacls = function( self )
end
editacl = function( self )
- return controllerfunctions.handle_form(self, function() return self.model.read_acl(self.clientdata.linenum) end, self.model.update_acl, self.clientdata, "Save", "Edit ACL", "ACL Saved")
+ return self.handle_form(self, function() return self.model.read_acl(self.clientdata.linenum) end, self.model.update_acl, self.clientdata, "Save", "Edit ACL", "ACL Saved")
end
deleteacl = function( self )
@@ -67,11 +65,11 @@ function listfiles(self)
end
function createfile(self)
- return controllerfunctions.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create New Squid File", "Squid File Created")
+ return self.handle_form(self, self.model.getnewfile, self.model.createfile, self.clientdata, "Create", "Create New Squid File", "Squid File Created")
end
function editfile(self)
- return controllerfunctions.handle_form(self, function() return self.model.readfile(self.clientdata.filename) end, self.model.updatefile, self.clientdata, "Save", "Edit Squid File", "Squid File Saved" )
+ return self.handle_form(self, function() return self.model.readfile(self.clientdata.filename) end, self.model.updatefile, self.clientdata, "Save", "Edit Squid File", "Squid File Saved" )
end
function deletefile(self)
diff --git a/squid-digest-html.lsp b/squid-digest-html.lsp
index e02c6aa..104a9f2 100644
--- a/squid-digest-html.lsp
+++ b/squid-digest-html.lsp
@@ -1,12 +1,12 @@
<% local form, viewlibrary, page_info, session = ... %>
-<% require("viewfunctions") %>
+<% require("htmlviewfunctions") %>
-<% displaycommandresults({"enabledigestlist"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"enabledigestlist"}, session) %>
<H1>Digest User List Status</H1>
<DL>
<%
- displayitem(form.value.status)
+ htmlviewfunctions.displayitem(form.value.status)
if form.value.status.errtxt then %>
<dt></dt><dd><form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/enabledigestlist") %>">
<input class="submit" type="submit" value="Enable"></form></dd>
diff --git a/squid-listfiles-html.lsp b/squid-listfiles-html.lsp
index aff271b..7287e99 100644
--- a/squid-listfiles-html.lsp
+++ b/squid-listfiles-html.lsp
@@ -1,9 +1,9 @@
<% local view, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
-<% displaycommandresults({"editfile", "deletefile"}, session) %>
-<% displaycommandresults({"createfile"}, session, true) %>
+<% htmlviewfunctions.displaycommandresults({"editfile", "deletefile"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"createfile"}, session, true) %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
@@ -37,5 +37,5 @@ end %>
<H2><%= html.html_escape(createform.label) %></H2>
<%
createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile"
- displayform(createform)
+ htmlviewfunctions.displayform(createform)
end %>
diff --git a/squid-model.lua b/squid-model.lua
index 2523462..0ad6d2f 100644
--- a/squid-model.lua
+++ b/squid-model.lua
@@ -3,9 +3,9 @@ module (..., package.seeall)
-- Load libraries
require("modelfunctions")
-require("validator")
-require("format")
-require("fs")
+validator = require("acf.validator")
+format = require("acf.format")
+fs = require("acf.fs")
-- Set variables
local squidconf = "/etc/squid/squid.conf"
@@ -38,8 +38,12 @@ getstatus = function()
return modelfunctions.getstatus(processname, packagename, "Squid status")
end
-startstop_service = function(action)
- return modelfunctions.startstop_service(processname, action, {"Start", "Stop", "Restart", "Reload", "Rotate"})
+function get_startstop(clientdata)
+ return modelfunctions.get_startstop(processname)
+end
+
+function startstop_service(startstop, action)
+ return modelfunctions.startstop_service(startstop, action)
end
get_configfile = function()
diff --git a/squid-startstop-html.lsp b/squid-startstop-html.lsp
deleted file mode 120000
index 0ea2627..0000000
--- a/squid-startstop-html.lsp
+++ /dev/null
@@ -1 +0,0 @@
-../startstop-html.lsp \ No newline at end of file