<% local data, viewlibrary, page_info, session = ... %> <% require("viewfunctions") %> <% -- Insert a string into another string function string_insert(value, insert, place) if place == nil then place = string.len(value)+1 end return string.sub(value, 1,place-1) .. tostring(insert) .. string.sub(value, place, string.len(value)) end --Highlight occurences of a word in a string function string_highlight(txtvalue, searchval, fcolour, bcolour) if txtvalue ~=nil and searchval ~= nil then sStart = string.find(string.lower(txtvalue),string.lower(searchval)) if sStart ~= nil then sEnd = sStart + string.len(searchval) txtvalue = string_insert(txtvalue,"", sEnd) txtvalue = string_insert(txtvalue,"", sStart) end end return txtvalue end %> <% local subdata, pagedata = paginate(data.value.log.value, page_info.clientdata, 200) %>

Search Parameters

<% -- Display the form, but skip log, window, and focus fields local log = data.value.log data.value.log = nil local window = data.value.window data.value.window = nil local focus = data.value.focus data.value.focus = nil displayform(data, nil, nil, page_info, 2) data.value.log = log data.value.window = window data.value.focus = focus %>
<% local clientinfo = "" if data.value.clientuserid.value ~= "" then clientinfo = clientinfo .. "clientuserid="..data.value.clientuserid.value.."&" end if data.value.clientip.value ~= "" then clientinfo = clientinfo .. "clientip="..data.value.clientip.value.."&" end %> <% displaypagination(pagedata, page_info) %>

<%= html.html_escape(data.label) %>

<% local checkhead = true for i,watch in ipairs(subdata) do if watch.selected ~= "t" then checkhead = false break end end %> <% for i,watch in ipairs(subdata) do local a,b = math.modf((i/2)) local mark = '' if (b == 0) and watch.selected ~= "t" then mark=' class="mark"' end if watch.selected == "t" then mark=' class="selected"' end local time = {} time.year, time.month, time.day, time.hour, time.min, time.sec = string.match(watch.logdatetime, "(%d+)%-(%d+)-(%d+)%s+(%d+):(%d+):(%d+)") time = os.time(time) %> > title="<%= html.html_escape(watch.reason) %>"<% end %>> <% if (watch.shortreason and watch.shortreason ~= "") then %> <%= html.html_escape(watch.shortreason) %> <% elseif (watch.reason and watch.reason ~= "") then %> <%= html.html_escape(watch.reason) %> <% end %> <% end %>
checked<% end %>> Timestamp Client IP User ID Size Sus Den Byp Score Reason URL Bad Words
checked <% end %>> style="font-weight:bold;" id="focus" <% end %> ><%= html.link{value = "viewweblog?"..clientinfo.. "starttime="..os.date("%Y-%m-%d %H:%M:%S", time - 60*(tonumber(data.value.window.value))).. "&endtime="..os.date("%Y-%m-%d %H:%M:%S", time + 60*(tonumber(data.value.window.value))).. "&focus="..watch.logdatetime, label=watch.logdatetime} %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientip) %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientuserid) %> <%= html.html_escape(watch.bytes) %> <% if watch.badyesno ~= "0" then %><% end %> <% if watch.deniedyesno ~= "0" then %> <% end %> <% if watch.bypassyesno ~= "0" then %> <% end %> <%= html.html_escape(watch.score) %> <% highlight_uri=html.html_escape(watch.shorturi or watch.uri) if watch.wordloc ~= nil then if string.find(watch.wordloc, "|") then badwords = format.string_to_table(watch.wordloc, "|") for key,wrd in ipairs(badwords) do highlight_uri = string_highlight(highlight_uri, wrd, "yellow", "red") end else highlight_uri = string_highlight(highlight_uri, watch.wordloc, "yellow", "red") end end %> <%= highlight_uri %> <%= watch.wordloc %>
<% displaypagination(pagedata, page_info) %> <% if data.errtxt then %>

<%= html.html_escape(data.errtxt) %>

<% end %> <% if #data.value.log.value == 0 then %>

No results, try adjusting search parameters

<% end %> <% if viewlibrary.check_permission("downloadweblog") then data.action = "downloadweblog" data.option = "Download" data.value.log = nil data.value.window = nil data.value.focus = nil for n,v in pairs(data.value) do v.type = "hidden" v.checked = nil end displayform(data, nil, nil, page_info, 2) end %>