Commit a1225776 authored by Ted Trask's avatar Ted Trask

Started cleanup, not complete

parent 28804449
......@@ -96,7 +96,7 @@ function downloadselected(self)
end
function checkselected(self)
self.conf.viewtype = "silent"
-- TT self.conf.viewtype = "silent"
return self.model.editselected(self.clientdata.chkdata)
--return file
end
......@@ -109,6 +109,18 @@ function viewselected(self)
return self.model.getweblog(self.clientdata.activelog, self.clientdata.clientuserid, self.clientdata.starttime, self.clientdata.endtime, self.clientdata.clientip, self.clientdata.badyesno, self.clientdata.deniedyesno, self.clientdata.bypassyesno, self.clientdata.score, self.clientdata.urisearch, self.clientdata.sortby, self.clientdata.getselected, clientdata.focus)
end
function viewusagestats(self)
return self.model.getusagestats()
end
function viewauditstats(self)
return self.model.getauditstats()
end
function completeaudit(self)
return self:redirect_to_referrer(self.model.completeaudit(self.clientdata.auditend))
end
function adhocquery(self)
return controllerfunctions.handle_form(self, self.model.getnewadhocquery, self.model.adhocquery, self.clientdata, "Submit", "Submit ad-hoc query")
end
......
weblog-editsource-html.lsp
\ No newline at end of file
<% local form, viewlibrary, page_info = ...
require("viewfunctions")
%>
<H1><%= html.html_escape(form.label) %></H1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
form.value.passwd.type = "password"
if page_info.action == "editsource" then
form.value.sourcename.readonly = true
end
local order = {"sourcename", "enabled", "source", "method", "userid", "passwd"}
displayform(form, order)
%>
../filedetails-html.lsp
\ No newline at end of file
<% local form, viewlibrary, page_info = ... %>
<% require("viewfunctions") %>
<% if form.type == "form" then %>
<H1>Configuration</H1>
<H2>Expert Configuration</H2>
<% else %>
<H1>View File</H1>
<% end %>
<H3>File Details</H3>
<DL>
<%
displayitem(form.value.filename)
displayitem(form.value.filesize)
displayitem(form.value.mtime)
%>
</DL>
<H3>File Content</H3>
<% if form.type == "form" then %>
<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
<% displayformstart(form) %>
<input type="hidden" name="filename" value="<%= html.html_escape(form.value.filename.value) %>">
<% else %>
<DL>
<% end %>
<textarea name="filecontent">
<%= html.html_escape(form.value.filecontent.value) %>
</textarea>
<% if form.value.filecontent.errtxt then %><P CLASS='error'><%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "<BR>") %></P><% end %>
<% if form.value.filecontent.descr then %><P CLASS='descr'><%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "<BR>") %></P><% end %>
<% if form.type == "form" then %>
<% displayformend(form) %>
<% else %>
</DL>
<% end %>
This diff is collapsed.
<% local data, viewlibrary, page_info, session = ... %>
<% require("viewfunctions")%>
<% require("weblogviewfunctions")%>
<%
-- 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,"</font>", sEnd)
txtvalue = string.insert(txtvalue,"<font style='color:"..fcolour.."; background-color:"..bcolour..";'>", sStart)
end
end
return txtvalue
end
%>
<% if data.value.focus.value ~= "" then %>
<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script>
<script type="text/javascript">
......@@ -33,6 +58,7 @@
#content table tr.mark { background: #E9E9E9; }
#content table tr.selected { background: #FC9A01; }
</style>
<H1>Search Parameters</H1>
<DL>
<% if data.errtxt then %><p class="error"><%= html.html_escape(data.errtxt) %></p><% end %>
......@@ -170,23 +196,23 @@ 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.gif' 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.gif' 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.gif' width='13' height='13'><% end %></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.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>
<TD><%= html.html_escape(watch.reason) %></TD>
<TD style="word-wrap: break-word" width="500"><% highlight_uri=html.html_escape(watch.uri)
if watch.wordloc ~= nil then
if string.find(watch.wordloc,"|") then
badwords = split(watch.wordloc,"|")
for key,wrd in pairs(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 %></TD>
<TD style="word-wrap: break-word" width="500"><% highlight_uri=html.html_escape(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 %></TD>
<TD><%= watch.wordloc %></TD>
</TR>
<% end %>
......
......@@ -6,5 +6,6 @@ Applications 41Weblog Config config
Applications 41Weblog File_List listfiles
Applications 41Weblog Watch_List viewwatchlist
Applications 41Weblog Sources listsources
Applications 41Weblog Usage viewusagestats
Applications 41Weblog History viewactivitylog
Applications 41Weblog Ad-Hoc_Query adhocquery
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