summaryrefslogtreecommitdiffstats
path: root/weblog-viewweblog-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-09-12 17:30:52 +0000
committerTed Trask <ttrask01@yahoo.com>2011-09-12 17:30:52 +0000
commit999bb888a63f22a6c7eaf242cc771b4f312ee6d7 (patch)
tree397c35c50528b1308aec74707ed1b1d420e9d5b8 /weblog-viewweblog-html.lsp
parent6e29d620e1321179f33d4caab2932d4f362b1a42 (diff)
downloadacf-weblog-999bb888a63f22a6c7eaf242cc771b4f312ee6d7.tar.bz2
acf-weblog-999bb888a63f22a6c7eaf242cc771b4f312ee6d7.tar.xz
Changed viewweblog to a form, reworked handling of config and weblog parameters, and added deniedyesno and bypassyesno config options.
Diffstat (limited to 'weblog-viewweblog-html.lsp')
-rw-r--r--weblog-viewweblog-html.lsp122
1 files changed, 25 insertions, 97 deletions
diff --git a/weblog-viewweblog-html.lsp b/weblog-viewweblog-html.lsp
index 4df704e..07f6356 100644
--- a/weblog-viewweblog-html.lsp
+++ b/weblog-viewweblog-html.lsp
@@ -94,85 +94,18 @@ end
<H1>Search Parameters</H1>
<DL>
-<% if data.errtxt then %><p class="error"><%= html.html_escape(data.errtxt) %></p><% end %>
-<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action) %>" method="POST">
-<DT>Active Weblog</DT>
-<DD><select name="activelog">
-<option value="pubweblog">Current</option>
-<option value="pubweblog_history"<% if data.value.activelog.value == "pubweblog_history" then %> selected="selected" <% end %> >History</option>
-</select>
-</DD>
-<DT>Start Time</DT>
-<DD><input class="text" type="text" name="starttime" value="<%= html.html_escape(data.value.starttime.value) %>" >
-<p><%= html.html_escape(data.value.starttime.value) %></p>
-<% if data.value.starttime.errtxt then %><p class="error"><%= html.html_escape(data.value.starttime.errtxt) %></p><% end %>
-</DD>
-<DT>User ID</DT>
-<DD><input class="text" type="text" name="clientuserid" value="<%= html.html_escape(data.value.clientuserid.value) %>" >
-<p><%= html.html_escape(data.value.clientuserid.value) %></p>
-<% if data.value.clientuserid.errtxt then %><p class="error"><%= html.html_escape(data.value.clientuserid.errtxt) %></p><% end %>
-</DD>
-<DT>Client IP</DT>
-<DD><input class="text" type="text" name="clientip" value="<%= html.html_escape(data.value.clientip.value) %>" >
-<p><%= html.html_escape(data.value.clientip.value) %></p>
-<% if data.value.clientip.errtxt then %><p class="error"><%= html.html_escape(data.value.clientip.errtxt) %></p><% end %>
-</DD>
-<DT>End Time</DT>
-<DD><input class="text" type="text" name="endtime" value="<%= html.html_escape(data.value.endtime.value) %>" >
-<p><%= html.html_escape(data.value.endtime.value) %></p>
-<% if data.value.endtime.errtxt then %><p class="error"><%= html.html_escape(data.value.endtime.errtxt) %></p><% end %>
-</DD>
-<DT>URI Contains</DT>
-<DD><input class="text" type="text" name="urisearch" value="<%= html.html_escape(data.value.urisearch.value) %>" >
-<P CLASS="descr">Retrieve records where the URI contains this word</P>
-<p><%= html.html_escape(data.value.urisearch.value) %></p>
-<% if data.value.urisearch.errtxt then %><p class="error"><%= html.html_escape(data.value.urisearch.errtxt) %></p><% end %>
-</DD>
-<DT>Minimum Score</DT>
-<DD><input class="text" type="text" name="score" value="<%= html.html_escape(data.value.score.value) %>" >
-<P CLASS="descr">Minimum score to search on</P>
-<% if data.value.score.errtxt then %><p class="error"><%= html.html_escape(data.value.score.errtxt) %></p><% end %>
-</DD>
-<DT>Sort By</DT>
-<DD><select name="sortby">
-<option value="logdatetime"<% if data.value.log.value == "sortby" then %> selected="selected" <% end %> >Timestamp</option>
-<option value="logdatetime DESC"<% if data.value.sortby.value == "logdatetime DESC" then %> selected="selected" <% end %> >Timestamp DESC</option>
-<option value="clientuserid"<% if data.value.sortby.value == "clientuserid" then %> selected="selected" <% end %> >User ID</option>
-<option value="clientuserid DESC"<% if data.value.sortby.value == "clientuserid DESC" then %> selected="selected" <% end %> >User ID DESC</option>
-<option value="bytes"<% if data.value.sortby.value == "bytes" then %> selected="selected" <% end %> >Size</option>
-<option value="bytes DESC"<% if data.value.sortby.value == "bytes DESC" then %> selected="selected" <% end %> >Size DESC</option>
-<option value="score"<% if data.value.sortby.value == "score" then %> selected="selected" <% end %> >Score</option>
-<option value="score DESC"<% if data.value.sortby.value == "score DESC" then %> selected="selected" <% end %> >Score DESC</option>
-<option value="reason"<% if data.value.sortby.value == "reason" then %> selected="selected" <% end %> >Reason</option>
-<option value="reason DESC"<% if data.value.sortby.value == "reason DESC" then %> selected="selected" <% end %> >Reason DESC</option>
-</select>
-</DD>
-<DT>Show Suspect Records</DT>
-<DD>
-<input class="checkbox" type="checkbox" name="badyesno" value="1" <% if data.value.badyesno.value == "1" then %> checked <% end %>>
-<P CLASS="descr">Show only URIs containing flagged words</P>
-<% if data.value.badyesno.errtxt then %><p class="error"><%= html.html_escape(data.value.badyesno.errtxt) %></p><% end %>
-</DD>
-<DT>Show Denied URIs</DT>
-<DD>
-<input class="checkbox" type="checkbox" name="deniedyesno" value="1" <% if data.value.deniedyesno.value == "1" then %>checked<% end %>>
-<% if data.value.deniedyesno.errtxt then %><p class="error"><%= html.html_escape(data.value.deniedyesno.errtxt) %></p><% end %>
-<P CLASS="descr">Show only Denied URIs</P>
-</DD>
-<DT>Show Bypass Attempts</DT>
-<DD>
-<input class="checkbox" type="checkbox" name="bypassyesno" value="1" <% if data.value.bypassyesno.value == "1" then %>checked <% end %>>
-<% if data.value.bypassyesno.errtxt then %><p class="error"><%= html.html_escape(data.value.bypassyesno.errtxt) %></p><% end %>
-<P CLASS="descr">Show only Bypass attempts</P>
-</DD>
-<DT>Show Selected Records</DT>
-<DD>
-<input class="checkbox" type="checkbox" name="selected" value="true" <% if data.value.selected.value == "true" then %>checked <% end %>>
-<% if data.value.selected.errtxt then %><p class="error"><%= html.html_escape(data.value.selected.errtxt) %></p><% end %>
-<P CLASS="descr">Show only records that have been selected</P>
-</DD>
-<DT></DT><DD><input class="submit" type="submit" name="Update" value="Update"></DD>
-</FORM>
+<% -- 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
+%>
</DL>
<%
@@ -232,7 +165,7 @@ end %>
<TD <% if data.value.clientip.value == watch.clientip then %> style="font-weight:bold;" <% end %> ><%= html.html_escape(watch.clientip) %></TD>
<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 WIDTH="2%"><% if watch.badyesno == "1" then %><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/dodgy.png' width='13' height='13'><% end %></TD>
+ <TD WIDTH="2%"><% if watch.badyesno ~= "0" then %><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/dodgy.png' width='13' height='13'><% end %></TD>
<TD WIDTH="2%"><% if watch.deniedyesno ~= "0" then %> <IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/denied.png' width='13' height='13'><% end %></TD>
<TD WIDTH="2%"><% if watch.bypassyesno ~= "0" then %> <IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/bypass.png' width='13' height='13'><% end %></TD>
<TD><%= html.html_escape(watch.score) %></TD>
@@ -269,21 +202,16 @@ end %>
<p>No results, try adjusting search parameters</p>
<% end %>
-<% if viewlibrary.check_permission("downloadweblog") then %>
-<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/downloadweblog") %>" method="POST">
-<input type="hidden" name="activelog" value="<%= html.html_escape(data.value.activelog.value) %>" >
-<input type="hidden" name="starttime" value="<%= html.html_escape(data.value.starttime.value) %>" >
-<input type="hidden" name="clientuserid" value="<%= html.html_escape(data.value.clientuserid.value) %>" >
-<input type="hidden" name="clientip" value="<%= html.html_escape(data.value.clientip.value) %>" >
-<input type="hidden" name="endtime" value="<%= html.html_escape(data.value.endtime.value) %>" >
-<input type="hidden" name="badyesno" value="<%= html.html_escape(data.value.badyesno.value) %>" >
-<input type="hidden" name="deniedyesno" value="<%= html.html_escape(data.value.deniedyesno.value) %>" >
-<input type="hidden" name="bypassyesno" value="<%= html.html_escape(data.value.bypassyesno.value) %>" >
-<input type="hidden" name="score" value="<%= html.html_escape(data.value.score.value) %>" >
-<input type="hidden" name="sortby" value="<%= html.html_escape(data.value.sortby.value) %>" >
-<input type="hidden" name="urisearch" value="<%= html.html_escape(data.value.urisearch.value) %>" >
-<input type="hidden" name="selected" value="<%= html.html_escape(data.value.selected.value) %>" >
-<DT>Download log</DT><DD><input class="submit" type="submit" name="Download" value="Download"></DD>
-</form>
-<% 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 %>
</DL>