summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2010-01-01 14:57:07 +0000
committerTed Trask <ttrask01@yahoo.com>2010-01-01 14:57:07 +0000
commitd9bc6f48a604e6f97fa51bee79a259c03eab8404 (patch)
treef3fb194a37fd81e70853938a424bc2f0214fe55d
parent605dab2abcf6e762f11d71e5b57f3a10429e9645 (diff)
downloadacf-weblog-d9bc6f48a604e6f97fa51bee79a259c03eab8404.tar.bz2
acf-weblog-d9bc6f48a604e6f97fa51bee79a259c03eab8404.tar.xz
Made shorturi a boolean.
-rw-r--r--weblog-config-html.lsp2
-rw-r--r--weblog-model.lua11
-rw-r--r--weblog-viewblocklog-html.lsp2
3 files changed, 8 insertions, 7 deletions
diff --git a/weblog-config-html.lsp b/weblog-config-html.lsp
index b2dca38..1a52743 100644
--- a/weblog-config-html.lsp
+++ b/weblog-config-html.lsp
@@ -4,6 +4,6 @@ require("viewfunctions")
<H1><%= html.html_escape(form.label) %></H1>
<%
- local order = {"auditstart", "auditend", "historydays", "watchdays", "purgedays", "window"}
+ local order = {"auditstart", "auditend", "historydays", "watchdays", "purgedays", "window", "shorturi", "groupby"}
displayform(form, order, nil, page_info)
%>
diff --git a/weblog-model.lua b/weblog-model.lua
index 2d00ef9..d29c096 100644
--- a/weblog-model.lua
+++ b/weblog-model.lua
@@ -436,10 +436,10 @@ local listlogentries = function(logname, clientuserid, starttime, endtime, clien
row = cur:fetch ({}, "a")
while row do
local uridescr = row.uri
- if (config.shorturls == "true") then
- uridescr=string.gsub(row.uri, "[;?].*", "...")
+ if config.shorturi == "true" then
+ shorturi=string.gsub(row.uri, "[;?].*", "...")
end
- entries[#entries+1] = {sourcename=row.sourcename, clientip=row.clientip, clientuserid=row.clientuserid, logdatetime=row.logdatetime, uri=row.uri, uridescr=uridescr, bytes=row.bytes, reason=row.reason, score=row.score, shortreason=row.shortreason,debug=config.shorturls}
+ entries[#entries+1] = {sourcename=row.sourcename, clientip=row.clientip, clientuserid=row.clientuserid, logdatetime=row.logdatetime, uri=row.uri, shorturi=shorturi, bytes=row.bytes, reason=row.reason, score=row.score, shortreason=row.shortreason}
row = cur:fetch (row, "a")
end
-- close everything
@@ -1174,7 +1174,8 @@ function getconfig()
result.purgedays = cfe({ value=config.purgedays or "30", label="Days before Purge", descr="Days to keep history, regardless of audit" })
result.historydays = cfe({ value=config.historydays or "14", label="Days to keep History", descr="Days beyond Audit Start Time to keep complete log history" })
result.groupby = cfe({ type="select", value=config.groupby or "clientuserid", label="Group results by", option={"clientuserid", "clientip"} })
- result.shorturls = cfe({ type="select", value=config.shorturls or "false", label="Truncate URL's in audit log", option={"true","false"}, descr="You can limit the lenght of urls in your audit log by selecting 'true'"})
+ result.shorturi = cfe({ type="boolean", value=false, label="Truncate URLs", descr="You can limit the length of displayed URLs by enabling this option"})
+ if config.shorturi == "true" then result.shorturi.value = true end
return cfe({ type="group", value=result, label="Weblog Config" })
end
@@ -1230,7 +1231,7 @@ function updateconfig(newconfig)
configcontent = format.update_ini_file(configcontent, "", "purgedays", newconfig.value.purgedays.value)
configcontent = format.update_ini_file(configcontent, "", "historydays", newconfig.value.historydays.value)
configcontent = format.update_ini_file(configcontent, "", "groupby", newconfig.value.groupby.value)
- configcontent = format.update_ini_file(configcontent, "", "shorturls", newconfig.value.shorturls.value)
+ configcontent = format.update_ini_file(configcontent, "", "shorturi", tostring(newconfig.value.shorturi.value))
fs.write_file(configfile, configcontent)
config = format.parse_ini_file(configcontent, "") or {}
diff --git a/weblog-viewblocklog-html.lsp b/weblog-viewblocklog-html.lsp
index 738737f..8c5663e 100644
--- a/weblog-viewblocklog-html.lsp
+++ b/weblog-viewblocklog-html.lsp
@@ -91,7 +91,7 @@ end
<TD <% if data.value.clientuserid.value == watch.clientuserid then %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientuserid) %></TD>
<TD><%= html.html_escape(watch.bytes) %></TD>
<TD title="<%= html.html_escape(watch.uri) %>" >
- <%= html.link{value = watch.uri, label=watch.uridescr or watch.uri} %></TD>
+ <%= html.link{value = watch.uri, label=watch.shorturi or watch.uri} %></TD>
</TR>
<TR <%= mark %>>
<TD class='reason' <% if (watch.shortreason and watch.shortreason ~= "") or (watch.reason and watch.reason ~= "") then %>