diff options
-rw-r--r-- | weblog-adhocquery-html.lsp | 8 | ||||
-rw-r--r-- | weblog-config-html.lsp | 4 | ||||
-rw-r--r-- | weblog-controller.lua | 23 | ||||
-rw-r--r-- | weblog-createdatabase-html.lsp | 4 | ||||
-rw-r--r-- | weblog-createwatchlistentry-html.lsp | 4 | ||||
-rw-r--r-- | weblog-editsource-html.lsp | 4 | ||||
-rw-r--r-- | weblog-listfiles-html.lsp | 4 | ||||
-rw-r--r-- | weblog-listsources-html.lsp | 4 | ||||
-rw-r--r-- | weblog-model.lua | 6 | ||||
-rw-r--r-- | weblog-status-html.lsp | 4 | ||||
-rw-r--r-- | weblog-viewactivitylog-html.lsp | 6 | ||||
-rw-r--r-- | weblog-viewauditstats-html.lsp | 8 | ||||
-rw-r--r-- | weblog-viewusagestats-html.lsp | 6 | ||||
-rw-r--r-- | weblog-viewweblog-html.lsp | 10 |
14 files changed, 46 insertions, 49 deletions
diff --git a/weblog-adhocquery-html.lsp b/weblog-adhocquery-html.lsp index 2923005..fde57d5 100644 --- a/weblog-adhocquery-html.lsp +++ b/weblog-adhocquery-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <style type="text/css"> @@ -45,7 +45,7 @@ require("viewfunctions") <% end %> <H1><%= html.html_escape(form.label) %></H1> -<% displayformstart(form, page_info) %> +<% htmlviewfunctions.displayformstart(form, page_info) %> This form accepts a Postgresql SELECT statement and displays the results. Examples: <ul> <li>This statement will return the total bytes transferred by each user for the pre-purge weblog history<pre>SELECT clientuserid, sum(bytes) AS total FROM pubweblog GROUP BY clientuserid ORDER BY total DESC</pre> @@ -53,8 +53,8 @@ This form accepts a Postgresql SELECT statement and displays the results. Exampl <li>This statement will return the number of requests and blocks by hour over the course of the entire usage history<pre>SELECT extract(hour from date) AS hour, sum(numrequest) AS numrequest, sum(numblock) AS numblock FROM usagestat GROUP BY extract(hour from date) ORDER BY hour</pre> </ul> The available database tables and descriptions are listed below. -<% displayformitem(form.value.query, "query") %> -<% displayformend(form) %> +<% htmlviewfunctions.displayformitem(form.value.query, "query") %> +<% htmlviewfunctions.displayformend(form) %> <H2>Available Database Tables</H2> <H3>pubweblog and pubweblog_history</H3> diff --git a/weblog-config-html.lsp b/weblog-config-html.lsp index c427580..26389b9 100644 --- a/weblog-config-html.lsp +++ b/weblog-config-html.lsp @@ -1,8 +1,8 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <H1><%= html.html_escape(form.label) %></H1> <% - displayform(form, nil, nil, page_info, 2) + htmlviewfunctions.displayform(form, nil, nil, page_info, 2) %> diff --git a/weblog-controller.lua b/weblog-controller.lua index 76f4db9..b865f80 100644 --- a/weblog-controller.lua +++ b/weblog-controller.lua @@ -1,12 +1,9 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "viewauditstats" function config(self) - return controllerfunctions.handle_form(self, self.model.getconfig, self.model.updateconfig, self.clientdata, "Save", "Edit Configuration", "Configuration Saved") + return self.handle_form(self, self.model.getconfig, self.model.updateconfig, self.clientdata, "Save", "Edit Configuration", "Configuration Saved") end function listsources(self) @@ -14,7 +11,7 @@ function listsources(self) end function createsource(self) - return controllerfunctions.handle_form(self, self.model.getnewsource, self.model.createsource, self.clientdata, "Create", "Create new source", "New source created") + return self.handle_form(self, self.model.getnewsource, self.model.createsource, self.clientdata, "Create", "Create new source", "New source created") end function deletesource(self) @@ -22,7 +19,7 @@ function deletesource(self) end function editsource(self) - return controllerfunctions.handle_form(self, function() return self.model.getsource(self.clientdata.sourcename) end, self.model.updatesource, self.clientdata, "Save", "Edit Source", "Source Saved") + return self.handle_form(self, function() return self.model.getsource(self.clientdata.sourcename) end, self.model.updatesource, self.clientdata, "Save", "Edit Source", "Source Saved") end function testsource(self) @@ -38,10 +35,10 @@ function viewactivitylog(self) end function viewweblog(self) - local retval = controllerfunctions.handle_form(self, self.model.getweblogparameters, self.model.getweblog, self.clientdata, "Update", "Display Weblog") + local retval = self.handle_form(self, self.model.getweblogparameters, self.model.getweblog, self.clientdata, "Update", "Display Weblog") -- We want to get the weblog even if form wasn't submitted if not self.clientdata.Update then - controllerfunctions.handle_clientdata(retval, self.clientdata) + self.handle_clientdata(retval, self.clientdata) retval = self.model.getweblog(retval) end return retval @@ -61,7 +58,7 @@ function downloadweblog(self) end function updateselected(self) - return controllerfunctions.handle_form(self, self.model.geteditselected, self.model.editselected, self.clientdata, "Submit", "Submit select update", "Select fields updated") + return self.handle_form(self, self.model.geteditselected, self.model.editselected, self.clientdata, "Submit", "Submit select update", "Select fields updated") end function clearselected(self) @@ -81,13 +78,13 @@ function completeaudit(self) end function adhocquery(self) - return controllerfunctions.handle_form(self, self.model.getnewadhocquery, self.model.adhocquery, self.clientdata, "Submit", "Submit ad-hoc query") + return self.handle_form(self, self.model.getnewadhocquery, self.model.adhocquery, self.clientdata, "Submit", "Submit ad-hoc query") end function downloadadhocquery(self) self.conf.viewtype = "stream" local retval = self.model.getnewadhocquery() - controllerfunctions.handle_clientdata(retval, self.clientdata) + self.handle_clientdata(retval, self.clientdata) retval = self.model.adhocquery(retval) local file = cfe({ type="longtext", value="", label="weblogadhocquery.tab" }) @@ -115,7 +112,7 @@ function status(self) end function createdatabase(self) - return controllerfunctions.handle_form(self, self.model.getnewdatabase, self.model.create_database, self.clientdata, "Create", "Create New Database", "Database Created") + return self.handle_form(self, self.model.getnewdatabase, self.model.create_database, self.clientdata, "Create", "Create New Database", "Database Created") end function listfiles(self) @@ -123,5 +120,5 @@ function listfiles(self) 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 Weblog File", "Weblog File Saved" ) + return self.handle_form(self, function() return self.model.readfile(self.clientdata.filename) end, self.model.updatefile, self.clientdata, "Save", "Edit Weblog File", "Weblog File Saved" ) end diff --git a/weblog-createdatabase-html.lsp b/weblog-createdatabase-html.lsp index 5110adc..372a98d 100644 --- a/weblog-createdatabase-html.lsp +++ b/weblog-createdatabase-html.lsp @@ -1,10 +1,10 @@ <% local form, viewlibrary, page_info = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> <H1><%= html.html_escape(form.label) %></H1> <% form.value.password.type = "password" form.value.password_confirm.type = "password" local order = { "password", "password_confirm" } - displayform(form, order, nil, page_info) + htmlviewfunctions.displayform(form, order, nil, page_info) %> diff --git a/weblog-createwatchlistentry-html.lsp b/weblog-createwatchlistentry-html.lsp index 91b2f21..ae092bc 100644 --- a/weblog-createwatchlistentry-html.lsp +++ b/weblog-createwatchlistentry-html.lsp @@ -1,9 +1,9 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <H1><%= html.html_escape(form.label) %></H1> <% local order = {"clientuserid", "expiredatetime"} - displayform(form, order, nil, page_info) + htmlviewfunctions.displayform(form, order, nil, page_info) %> diff --git a/weblog-editsource-html.lsp b/weblog-editsource-html.lsp index c15e30e..06f6d9a 100644 --- a/weblog-editsource-html.lsp +++ b/weblog-editsource-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <H1><%= html.html_escape(form.label) %></H1> @@ -10,5 +10,5 @@ require("viewfunctions") form.value.sourcename.readonly = true end local order = {"sourcename", "enabled", "source", "method", "userid", "passwd"} - displayform(form, order) + htmlviewfunctions.displayform(form, order) %> diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp index ba03446..6d0cc4c 100644 --- a/weblog-listfiles-html.lsp +++ b/weblog-listfiles-html.lsp @@ -1,8 +1,8 @@ <% local view, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"editfile"}, session) %> +<% htmlviewfunctions.displaycommandresults({"editfile"}, session) %> <H1>File List</H1> <DL> diff --git a/weblog-listsources-html.lsp b/weblog-listsources-html.lsp index 270e24c..f1a91b4 100644 --- a/weblog-listsources-html.lsp +++ b/weblog-listsources-html.lsp @@ -1,8 +1,8 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %> +<% htmlviewfunctions.displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %> <h1><%= html.html_escape(data.label) %></h1> <DL> diff --git a/weblog-model.lua b/weblog-model.lua index 7f09c7d..cf516b3 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -2,9 +2,9 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") -require("fs") -require("format") -require("validator") +fs = require("acf.fs") +format = require("acf.format") +validator = require("acf.validator") require("luasql.postgres") local DatabaseName = "webproxylog" diff --git a/weblog-status-html.lsp b/weblog-status-html.lsp index 1c0d2a8..616a075 100644 --- a/weblog-status-html.lsp +++ b/weblog-status-html.lsp @@ -1,8 +1,8 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"createdatabase"}, session, true) %> +<% htmlviewfunctions.displaycommandresults({"createdatabase"}, session, true) %> <H1>Weblog Database Status</H1> <DL> diff --git a/weblog-viewactivitylog-html.lsp b/weblog-viewactivitylog-html.lsp index a272544..95a6361 100644 --- a/weblog-viewactivitylog-html.lsp +++ b/weblog-viewactivitylog-html.lsp @@ -1,11 +1,11 @@ <% local data, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> -<% local subdata, pagedata = paginate(data.value, page_info.clientdata, 100) %> +<% local subdata, pagedata = htmlviewfunctions.paginate(data.value, page_info.clientdata, 100) %> <H1><%= html.html_escape(data.label) %></H1> <DL> -<% displaypagination(pagedata, page_info) %> +<% htmlviewfunctions.displaypagination(pagedata, page_info) %> <TABLE> <TR class="header"> <TD style="padding-right:20px;white-space:nowrap;" class="header">Date</TD> diff --git a/weblog-viewauditstats-html.lsp b/weblog-viewauditstats-html.lsp index 8eddb05..b31cd46 100644 --- a/weblog-viewauditstats-html.lsp +++ b/weblog-viewauditstats-html.lsp @@ -1,5 +1,5 @@ <% local data, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> <script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script> <script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script> @@ -13,12 +13,12 @@ }); </script> -<% displaycommandresults({"completeaudit"}, session) %> +<% htmlviewfunctions.displaycommandresults({"completeaudit"}, session) %> <H1>Audit Parameters</H1> <DL> -<% displayitem(data.value.auditstart) %> -<% displayitem(data.value.auditend) %> +<% htmlviewfunctions.displayitem(data.value.auditstart) %> +<% htmlviewfunctions.displayitem(data.value.auditend) %> </DL> <H1><%= html.html_escape(data.label) %></H1> diff --git a/weblog-viewusagestats-html.lsp b/weblog-viewusagestats-html.lsp index 0d534e1..721cccf 100644 --- a/weblog-viewusagestats-html.lsp +++ b/weblog-viewusagestats-html.lsp @@ -1,11 +1,11 @@ <% local data, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> -<% local subdata, pagedata = paginate(data.value, page_info.clientdata, 100) %> +<% local subdata, pagedata = htmlviewfunctions.paginate(data.value, page_info.clientdata, 100) %> <H1><%= html.html_escape(data.label) %></H1> <DL> -<% displaypagination(pagedata, page_info) %> +<% htmlviewfunctions.displaypagination(pagedata, page_info) %> <TABLE> <TR style="background:#eee;font-weight:bold;"> <TD style="padding-right:20px;white-space:nowrap;" class="header">Date</TD> diff --git a/weblog-viewweblog-html.lsp b/weblog-viewweblog-html.lsp index 07f6356..e631ebf 100644 --- a/weblog-viewweblog-html.lsp +++ b/weblog-viewweblog-html.lsp @@ -1,5 +1,5 @@ <% local data, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> <% -- Insert a string into another string @@ -82,7 +82,7 @@ end }); </script> -<% local subdata, pagedata = paginate(data.value.log.value, page_info.clientdata, 200) %> +<% local subdata, pagedata = htmlviewfunctions.paginate(data.value.log.value, page_info.clientdata, 200) %> <style type="text/css"> #content table { border-collapse: collapse; width: 100%; } @@ -118,7 +118,7 @@ if data.value.clientip.value ~= "" then end %> -<% displaypagination(pagedata, page_info) %> +<% htmlviewfunctions.displaypagination(pagedata, page_info) %> <H1><%= html.html_escape(data.label) %></H1> <DL> <TABLE id="loglist" class="tablesorter"> @@ -193,7 +193,7 @@ end %> <% end %> </TBODY> </TABLE> -<% displaypagination(pagedata, page_info) %> +<% htmlviewfunctions.displaypagination(pagedata, page_info) %> <% if data.errtxt then %> <p class="error"><%= html.html_escape(data.errtxt) %></p> @@ -212,6 +212,6 @@ for n,v in pairs(data.value) do v.type = "hidden" v.checked = nil end -displayform(data, nil, nil, page_info, 2) +htmlviewfunctions.displayform(data, nil, nil, page_info, 2) end %> </DL> |