diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-09-09 17:52:23 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-09-09 17:52:23 +0000 |
commit | d8793e28e39fa68f2763d7b9cff998bf4d5730e7 (patch) | |
tree | 4b3cb7ed73a3f18e563145f0dba6105f323512e8 | |
parent | 570fb191bcb47342f1fc0158c317b1d49c84de3b (diff) | |
download | acf-weblog-d8793e28e39fa68f2763d7b9cff998bf4d5730e7.tar.bz2 acf-weblog-d8793e28e39fa68f2763d7b9cff998bf4d5730e7.tar.xz |
Made groupby work again
-rw-r--r-- | weblog-model.lua | 11 | ||||
-rw-r--r-- | weblog-viewauditstats-html.lsp | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/weblog-model.lua b/weblog-model.lua index ae2fa60..e28f585 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -884,7 +884,7 @@ local function importlogfile(source, cookiesfile, file, parselog_func) end pcall(function() logme("Exception on line:"..line) end) if err2 then - pcall(function() logme("err2 "..err2) end) + pcall(function() logme(err2) end) end if (config.stoponerror == "true") then assert(res2, "Import halted on exception") @@ -943,8 +943,7 @@ function importlogs() if string.match(file, "dansguardian/access%.log[%.%-]") then count = count + 1 success = importlogfile(source, cookiesfile, file, parsedglog) and success - end - if string.match(file, "squid/access%.log[%.%-]") then + elseif string.match(file, "squid/access%.log[%.%-]") then count = count + 1 success = importlogfile(source, cookiesfile, file, parsesquidlog) and success end @@ -1180,6 +1179,7 @@ function getconfig() result.minimumscore = cfe({ value=config.minimumscore or "0", label="Minimum Score", descr="Minimum Score to search for", seq=5 }) result.window = cfe({ value=config.window or "5", label="Time Window", descr="Minutes of activity to display before and after selected block", seq=6 }) result.purgedays = cfe({ value=config.purgedays or "30", label="Days before Purge", descr="Days to keep history, regardless of audit", seq=10 }) + result.groupby = cfe({ type="select", value=config.groupby or "clientuserid", label="Group results by", option={"clientuserid", "clientip"}, seq=7 }) result.shorturi = cfe({ type="boolean", value=(config.shorturi == "true"), label="Truncate URLs", descr="You can limit the length of displayed URLs by enabling this option", seq=7 }) result.shortreason = cfe({ type="boolean", value=(config.shortreason == "true"), label="Short Reason", descr="Display a short reason (dansguardian only)", seq=8 }) result.stoponerror = cfe({ type="boolean", value=(config.stoponerror == "true"), label="Stop on Error", descr="Stop import of logs if an error is encountered", seq=11}) @@ -1187,7 +1187,8 @@ function getconfig() end local function validateconfig(newconfig) - local success = modelfunctions.validateselect(newconfig.value.sortby) + local success = modelfunctions.validateselect(newconfig.value.groupby) + success = modelfunctions.validateselect(newconfig.value.sortby) and success if newconfig.value.window.value == "" then newconfig.value.window.errtxt = "Cannot be blank" success = false @@ -1227,7 +1228,7 @@ function updateconfig(newconfig) configcontent = format.update_ini_file(configcontent, "", "auditend", newconfig.value.auditend.value) configcontent = format.update_ini_file(configcontent, "", "window", newconfig.value.window.value) configcontent = format.update_ini_file(configcontent, "", "purgedays", newconfig.value.purgedays.value) - --configcontent = format.update_ini_file(configcontent, "", "groupby", newconfig.value.groupby.value) + configcontent = format.update_ini_file(configcontent, "", "groupby", newconfig.value.groupby.value) configcontent = format.update_ini_file(configcontent, "", "shorturi", tostring(newconfig.value.shorturi.value)) configcontent = format.update_ini_file(configcontent, "", "shortreason", tostring(newconfig.value.shortreason.value)) configcontent = format.update_ini_file(configcontent, "", "stoponerror", tostring(newconfig.value.stoponerror.value)) diff --git a/weblog-viewauditstats-html.lsp b/weblog-viewauditstats-html.lsp index 77ffb43..8eddb05 100644 --- a/weblog-viewauditstats-html.lsp +++ b/weblog-viewauditstats-html.lsp @@ -5,7 +5,11 @@ <script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script> <script type="text/javascript"> $(document).ready(function() { - $("#audit").tablesorter({headers: {1:{sorter:'digit'}, 2:{sorter:'digit'}}}); + <% if data.value.groupby.value == "clientip" then %> + $("#audit").tablesorter({headers: {0:{sorter:'ipAddress'}}}); + <% else %> + $("#audit").tablesorter(); + <% end %> }); </script> |