diff options
author | Luke Stuart <lukestu@gmail.com> | 2011-09-07 14:30:04 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-09-07 10:40:02 -0400 |
commit | 893f78c2213c87ef27339f19d5db3ad91959e6d9 (patch) | |
tree | 817ee1cf535d525e0dcdf7f61024682ae0314fed | |
parent | 6da18ec695594750e7c91a930cf8980c0ec0b5a5 (diff) | |
download | acf-weblog-893f78c2213c87ef27339f19d5db3ad91959e6d9.tar.bz2 acf-weblog-893f78c2213c87ef27339f19d5db3ad91959e6d9.tar.xz |
Fixed DG score, record selection, url escape sequences in squark clientuserid
-rw-r--r-- | template-silent.lsp | 9 | ||||
-rw-r--r-- | weblog-controller.lua | 3 | ||||
-rw-r--r-- | weblog-model.lua | 20 |
3 files changed, 22 insertions, 10 deletions
diff --git a/template-silent.lsp b/template-silent.lsp new file mode 100644 index 0000000..45a8ad4 --- /dev/null +++ b/template-silent.lsp @@ -0,0 +1,9 @@ +<% local viewtable, viewlibrary, pageinfo, session = ... %> +Status: 204 No content +Content-Type: <% print(viewtable.option or "application/octet-stream") %> +<% if viewtable.length then %> +Content-Length: <%= viewtable.length %> +<% end %> +<% if viewtable.label ~= "" then %> +Content-Disposition: attachment; filename="<%= viewtable.label %>" +<% end %> diff --git a/weblog-controller.lua b/weblog-controller.lua index 11d8109..c645d11 100644 --- a/weblog-controller.lua +++ b/weblog-controller.lua @@ -96,7 +96,8 @@ function downloadselected(self) end function checkselected(self) --- TT self.conf.viewtype = "silent" + --calls template-silent.lsp which allows us to execute something without refreshing or leaving the page + self.conf.viewtype = "silent" return self.model.editselected(self.clientdata.chkdata) --return file end diff --git a/weblog-model.lua b/weblog-model.lua index d5fa4da..cbf200a 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -522,6 +522,7 @@ local function checkwords(logentry) _,instcnt = string.lower(logentry.URL):gsub(thisline, " ") if instcnt ~= 0 then logentry.ignoreme = true + --logme("ignoring...") break end end @@ -532,7 +533,7 @@ local function checkwords(logentry) if not thisline then break end - + _,instcnt = string.lower(logentry.URL):gsub(thisline, " ") if instcnt ~= 0 then -- logme("instcnt = "..instcnt) @@ -543,20 +544,22 @@ local function checkwords(logentry) end --check for DansGuardian actions - if string.find(logentry.URL,"*DENIED*") then + if (logentry.reason and logentry.reason ~= "") then + if string.find(logentry.reason,"DENIED") then -- logme("*Denied*") logentry.deniedyesno=1 - elseif string.find(logentry.URL,"GBYPASS") then + elseif string.find(logentry.URL,"GBYPASS") then -- logme("GBYPASS") logentry.bypassyesno=1 - elseif string.find(logentry.URL,"*OVERRIDE*") then + elseif string.find(logentry.reason,"OVERRIDE") then -- logme("*OVERRIDE*") logentry.bypassyesno=1 + end end --check for Squark actions if (logentry.squarkaction and logentry.squarkaction ~= "") then - logme("squarkaction="..logentry.squarkcategory) + --logme("squarkaction="..logentry.squarkaction) if string.find(logentry.squarkaction, "blocked") then logentry.deniedyesno=1 elseif string.find(logentry.squarkaction,"overridden") then @@ -608,13 +611,12 @@ local function parsesquidlog(line) bytes=words[5], method=words[6], URL=words[7], - clientuserid=words[8], + clientuserid=string.gsub(words[8],"%%(%x%x)",""), peerstatus=string.match(words[9] or "", "^[^/]*"), peerhost=string.match(words[9] or "", "[^/]*$"), squarkcategory=string.match(words[11] or "", "^[^,]*"), squarkaction=string.match(words[11] or "", "[^,]*$")} - - + checkwords(logentry) -- Don't care about local requests (from DG) (this check also removes blank lines) @@ -645,7 +647,7 @@ local function parsedglog(line) if logentry.shortreason == "" then logentry.shortreason = logentry.reason end - logentry.score = string.match(logentry.reason, "^.*: ([0-9]+) ") + --logentry.score = string.match(logentry.reason, "^.*: ([0-9]+) ") logentry.logdatetime = string.gsub(logentry.logdatetime, "%.", "-") return logentry end |