Commit 893f78c2 authored by Luke Stuart's avatar Luke Stuart Committed by Ted Trask

Fixed DG score, record selection, url escape sequences in squark clientuserid

parent 6da18ec6
<% 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 %>
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment