summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-04-18 01:58:45 +0000
committerTed Trask <ttrask01@yahoo.com>2012-04-18 01:58:45 +0000
commit06600e5d886ac3ed3ae5ee6ce04994b8c6f387f5 (patch)
tree64b612ddfb83fb8efc9af66e32ba370582ef0172
parent784aaf2ba00abff651721c1814b1a3ca0fcb5f89 (diff)
downloadacf-tcpproxy-06600e5d886ac3ed3ae5ee6ce04994b8c6f387f5.tar.bz2
acf-tcpproxy-06600e5d886ac3ed3ae5ee6ce04994b8c6f387f5.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--tcpproxy-controller.lua13
-rw-r--r--tcpproxy-editsmtpentry-html.lsp4
-rw-r--r--tcpproxy-listsmtpentries-html.lsp4
-rw-r--r--tcpproxy-listsmtpfiles-html.lsp8
-rw-r--r--tcpproxy-model.lua14
-rw-r--r--tcpproxy-smtpstatus-html.lsp8
l---------tcpproxy-startstop-html.lsp1
7 files changed, 26 insertions, 26 deletions
diff --git a/tcpproxy-controller.lua b/tcpproxy-controller.lua
index b1b6c01..97cbaac 100644
--- a/tcpproxy-controller.lua
+++ b/tcpproxy-controller.lua
@@ -1,8 +1,5 @@
module(..., package.seeall)
--- Load libraries
-require("controllerfunctions")
-
default_action = "status"
function status(self)
@@ -10,11 +7,11 @@ function status(self)
end
function startstop(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
function expert(self)
- return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config", "Configuration Saved")
+ return self.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config", "Configuration Saved")
end
function smtpstatus(self)
@@ -26,7 +23,7 @@ function listsmtpentries(self)
end
function editsmtpentry(self)
- return controllerfunctions.handle_form(self, function() return self.model.readsmtpentry(self.clientdata.ipaddr) end, self.model.updatesmtpentry, self.clientdata, "Save", "Edit SMTP Proxy Entry", "SMTP Proxy Entry Saved" )
+ return self.handle_form(self, function() return self.model.readsmtpentry(self.clientdata.ipaddr) end, self.model.updatesmtpentry, self.clientdata, "Save", "Edit SMTP Proxy Entry", "SMTP Proxy Entry Saved" )
end
function delsmtpentry(self)
@@ -38,11 +35,11 @@ function listsmtpfiles(self)
end
function createsmtpfile(self)
- return controllerfunctions.handle_form(self, self.model.getnewsmtpfile, self.model.createsmtpfile, self.clientdata, "Create", "Create New SMTP Proxy File", "SMTP Proxy File Created")
+ return self.handle_form(self, self.model.getnewsmtpfile, self.model.createsmtpfile, self.clientdata, "Create", "Create New SMTP Proxy File", "SMTP Proxy File Created")
end
function editsmtpfile(self)
- return controllerfunctions.handle_form(self, function() return self.model.readsmtpfile(self.clientdata.filename) end, self.model.updatesmtpfile, self.clientdata, "Save", "Edit SMTP Proxy File", "SMTP Proxy File Saved" )
+ return self.handle_form(self, function() return self.model.readsmtpfile(self.clientdata.filename) end, self.model.updatesmtpfile, self.clientdata, "Save", "Edit SMTP Proxy File", "SMTP Proxy File Saved" )
end
function delsmtpfile(self)
diff --git a/tcpproxy-editsmtpentry-html.lsp b/tcpproxy-editsmtpentry-html.lsp
index 148a24e..807b211 100644
--- a/tcpproxy-editsmtpentry-html.lsp
+++ b/tcpproxy-editsmtpentry-html.lsp
@@ -1,5 +1,5 @@
<% local form, viewlibrary, page_info = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
<H1><%= html.html_escape(form.label) %></H1>
@@ -7,5 +7,5 @@ require("viewfunctions")
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
form.value.ipaddr.readonly = true
local order = {"ipaddr", "server", "addressonly", "domain", "optionalserver", "optionalrewritelist", "senderlistfile", "rcptlistfile"}
- displayform(form, order)
+ htmlviewfunctions.displayform(form, order)
%>
diff --git a/tcpproxy-listsmtpentries-html.lsp b/tcpproxy-listsmtpentries-html.lsp
index 8fdfe96..60f3532 100644
--- a/tcpproxy-listsmtpentries-html.lsp
+++ b/tcpproxy-listsmtpentries-html.lsp
@@ -1,8 +1,8 @@
<% local view, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
-<% displaycommandresults({"editsmtpentry", "delsmtpentry"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"editsmtpentry", "delsmtpentry"}, session) %>
<H1>Interface Entries</H1>
<DL>
diff --git a/tcpproxy-listsmtpfiles-html.lsp b/tcpproxy-listsmtpfiles-html.lsp
index 37fbd9e..3760a66 100644
--- a/tcpproxy-listsmtpfiles-html.lsp
+++ b/tcpproxy-listsmtpfiles-html.lsp
@@ -1,9 +1,9 @@
<% local view, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
-<% displaycommandresults({"editsmtpfile", "delsmtpfile"}, session) %>
-<% displaycommandresults({"createsmtpfile"}, session, true) %>
+<% htmlviewfunctions.displaycommandresults({"editsmtpfile", "delsmtpfile"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"createsmtpfile"}, session, true) %>
<H1>Files</H1>
<DL>
@@ -33,5 +33,5 @@ require("viewfunctions")
<H2><%= html.html_escape(createform.label) %></H2>
<%
createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createsmtpfile"
- displayform(createform)
+ htmlviewfunctions.displayform(createform)
end %>
diff --git a/tcpproxy-model.lua b/tcpproxy-model.lua
index 682f117..001905d 100644
--- a/tcpproxy-model.lua
+++ b/tcpproxy-model.lua
@@ -2,10 +2,10 @@ module(..., package.seeall)
-- Load libraries
require("modelfunctions")
-require("validator")
-require("fs")
+validator = require("acf.validator")
+fs = require("acf.fs")
require("posix")
-require("format")
+format = require("acf.format")
-- Set variables
local configfile = "/etc/tcpproxy.conf"
@@ -188,8 +188,12 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function startstop_service(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
function getstatus()
diff --git a/tcpproxy-smtpstatus-html.lsp b/tcpproxy-smtpstatus-html.lsp
index 143c991..a13c132 100644
--- a/tcpproxy-smtpstatus-html.lsp
+++ b/tcpproxy-smtpstatus-html.lsp
@@ -1,13 +1,13 @@
<% local view, viewlibrary, page_info, session = ...
-require("viewfunctions")
+require("htmlviewfunctions")
%>
-<% displaycommandresults({"editsmtpentry", "delsmtpentry", "editsmtpfile", "delsmtpfile"}, session) %>
-<% displaycommandresults({"createsmtpfile"}, session, true) %>
+<% htmlviewfunctions.displaycommandresults({"editsmtpentry", "delsmtpentry", "editsmtpfile", "delsmtpfile"}, session) %>
+<% htmlviewfunctions.displaycommandresults({"createsmtpfile"}, session, true) %>
<H1>SMTP Proxy Status</H1>
<DL>
-<% displayitem(view.value.version)
+<% htmlviewfunctions.displayitem(view.value.version)
if view.value.version and view.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then
%>
<a href="<%= html.html_escape(page_info.script .. "/apk-tools/apk/install?package="..view.value.version.name) %>">Install</a>
diff --git a/tcpproxy-startstop-html.lsp b/tcpproxy-startstop-html.lsp
deleted file mode 120000
index 0ea2627..0000000
--- a/tcpproxy-startstop-html.lsp
+++ /dev/null
@@ -1 +0,0 @@
-../startstop-html.lsp \ No newline at end of file