fixed bugs in post nuke, base.jsp display (simplified it), and global
audit record display
This commit is contained in:
parent
63fedc9db6
commit
7e226040d4
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
acmecity
|
acmecity
|
||||||
advogato
|
advogato
|
||||||
ain't
|
ain't
|
||||||
|
@ -8,6 +7,7 @@ bajor
|
||||||
bios
|
bios
|
||||||
boitano
|
boitano
|
||||||
boromax
|
boromax
|
||||||
|
bungee
|
||||||
can't
|
can't
|
||||||
cartman
|
cartman
|
||||||
cdt
|
cdt
|
||||||
|
@ -25,7 +25,9 @@ dilithium
|
||||||
docking
|
docking
|
||||||
doesn't
|
doesn't
|
||||||
don't
|
don't
|
||||||
|
downtime
|
||||||
edt
|
edt
|
||||||
|
email
|
||||||
eminds
|
eminds
|
||||||
entil'zha
|
entil'zha
|
||||||
eps
|
eps
|
||||||
|
|
|
@ -723,7 +723,7 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||||
|
|
||||||
// lock the tables we reference
|
// lock the tables we reference
|
||||||
stmt.executeUpdate("LOCK TABLES posts WRITE, postdata WRITE, postattach WRITE, postdogear WRITE, "
|
stmt.executeUpdate("LOCK TABLES posts WRITE, postdata WRITE, postattach WRITE, postdogear WRITE, "
|
||||||
+ "postpublish WRITE;");
|
+ "postpublish WRITE, topics WRITE;");
|
||||||
|
|
||||||
try
|
try
|
||||||
{ // first, make sure we have the right status for our post
|
{ // first, make sure we have the right status for our post
|
||||||
|
@ -731,6 +731,13 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||||
if (nuked)
|
if (nuked)
|
||||||
return; // nuking a nuked post is futile
|
return; // nuking a nuked post is futile
|
||||||
|
|
||||||
|
// We need the post's topic ID and post number to renumber the topic afterwards, so grab 'em.
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT topicid, num FROM posts WHERE postid = " + postid + ";");
|
||||||
|
if (!(rs.next()))
|
||||||
|
throw new InternalStateError("lost the post to be nuked after refresh?");
|
||||||
|
int x_topic_id = rs.getInt(1);
|
||||||
|
int x_post_num = rs.getInt(2);
|
||||||
|
|
||||||
// Delete any and all references to this post!
|
// Delete any and all references to this post!
|
||||||
stmt.executeUpdate("DELETE FROM posts WHERE postid = " + postid + ";");
|
stmt.executeUpdate("DELETE FROM posts WHERE postid = " + postid + ";");
|
||||||
stmt.executeUpdate("DELETE FROM postdata WHERE postid = " + postid + ";");
|
stmt.executeUpdate("DELETE FROM postdata WHERE postid = " + postid + ";");
|
||||||
|
@ -739,6 +746,14 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||||
if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0)
|
if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0)
|
||||||
engine.unpublish(postid);
|
engine.unpublish(postid);
|
||||||
|
|
||||||
|
// Phase 1 of renumber - Renumber all posts that had a number higher than the one
|
||||||
|
// we just blew to hell.
|
||||||
|
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE num > " + x_post_num + ";");
|
||||||
|
|
||||||
|
// Phase 2 of renumber - The topic now has one less post in it. Reflect that.
|
||||||
|
stmt.executeUpdate("UPDATE topics SET top_message = (top_message - 1) WHERE topicid = "
|
||||||
|
+ x_topic_id + ";");
|
||||||
|
|
||||||
// Update our internal variables.
|
// Update our internal variables.
|
||||||
linecount = 0;
|
linecount = 0;
|
||||||
creator_uid = -1;
|
creator_uid = -1;
|
||||||
|
|
|
@ -78,7 +78,7 @@ class TopicUserContextImpl implements TopicContext
|
||||||
this.lastupdate = lastupdate;
|
this.lastupdate = lastupdate;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.hidden = hidden;
|
this.hidden = hidden;
|
||||||
this.unread = unread;
|
this.unread = (unread<0 ? 0 : unread);
|
||||||
|
|
||||||
} // end constructor
|
} // end constructor
|
||||||
|
|
||||||
|
@ -151,6 +151,8 @@ class TopicUserContextImpl implements TopicContext
|
||||||
lastupdate = SQLUtil.getFullDateTime(rs,8);
|
lastupdate = SQLUtil.getFullDateTime(rs,8);
|
||||||
hidden = rs.getBoolean(10);
|
hidden = rs.getBoolean(10);
|
||||||
unread = rs.getInt(11);
|
unread = rs.getInt(11);
|
||||||
|
if (unread<0)
|
||||||
|
unread = 0;
|
||||||
|
|
||||||
} // end if
|
} // end if
|
||||||
else // this topic must have been deleted - fsck it
|
else // this topic must have been deleted - fsck it
|
||||||
|
|
|
@ -64,6 +64,8 @@ public class AuditRecord implements AuditData
|
||||||
|
|
||||||
String getUserName(int uid) throws SQLException, DataException
|
String getUserName(int uid) throws SQLException, DataException
|
||||||
{
|
{
|
||||||
|
if (uid==0)
|
||||||
|
return ""; // UID 0 = no user
|
||||||
Integer uid_x = new Integer(uid);
|
Integer uid_x = new Integer(uid);
|
||||||
String rc = (String)(uname_cache.get(uid_x));
|
String rc = (String)(uname_cache.get(uid_x));
|
||||||
if (rc==null)
|
if (rc==null)
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
Variables.failIfNull(basedat);
|
Variables.failIfNull(basedat);
|
||||||
UserContext user = Variables.getUserContext(application,request,session);
|
UserContext user = Variables.getUserContext(application,request,session);
|
||||||
RenderData rdat = RenderConfig.createRenderData(application,request,response);
|
RenderData rdat = RenderConfig.createRenderData(application,request,response);
|
||||||
|
String header_font = rdat.getStdFontTag("white",3);
|
||||||
|
String stdfont = rdat.getStdFontTag(null,2);
|
||||||
|
String smallfont = rdat.getStdFontTag(null,1);
|
||||||
|
String partial_tgt, foo;
|
||||||
%>
|
%>
|
||||||
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
|
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
|
||||||
<HTML>
|
<HTML>
|
||||||
|
@ -34,20 +38,19 @@
|
||||||
</HEAD>
|
</HEAD>
|
||||||
|
|
||||||
<BODY BGCOLOR="#9999FF">
|
<BODY BGCOLOR="#9999FF">
|
||||||
<TABLE ALIGN=LEFT BORDER=0 WIDTH="100%" CELLPADDING=2 CELLSPACING=0>
|
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- BEGIN PAGE HEADER --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- BEGIN PAGE HEADER --><% } %>
|
||||||
<TR VALIGN=TOP BGCOLOR="#6666CC"><TD ALIGN=CENTER>
|
<TABLE BORDER=0 BGCOLOR="#6666CC" WIDTH="100%" CELLPADDING=2 CELLSPACING=0>
|
||||||
<TABLE ALIGN=CENTER WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR VALIGN=MIDDLE>
|
<TR VALIGN=MIDDLE>
|
||||||
<TD ALIGN=LEFT WIDTH=150>
|
<TD ALIGN=LEFT WIDTH=150>
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- Site logo --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- Site logo --><% } %>
|
||||||
<%= rdat.getSiteImageTag(2,2) %>
|
<%= rdat.getSiteImageTag(2,2) %>
|
||||||
</TD>
|
</TD>
|
||||||
|
|
||||||
<TD ALIGN=LEFT WIDTH=150><%= rdat.getStdFontTag("white",3) %><B>
|
<TD ALIGN=LEFT WIDTH=150><%= header_font %><B>
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- Links to Front Page, Help, Find --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- Links to Front Page, Help, Find --><% } %>
|
||||||
<A HREF="<%= rdat.getEncodedServletPath("top") %>">Front Page</A><P>
|
<A HREF="<%= rdat.getEncodedServletPath("top") %>"><FONT COLOR="yellow">Front Page</FONT></A><P>
|
||||||
<A HREF="/TODO">Help</A> |
|
<A HREF="/TODO"><FONT COLOR="yellow">Help</FONT></A> |
|
||||||
<A HREF="<%= rdat.getEncodedServletPath("find") %>">Find</A>
|
<A HREF="<%= rdat.getEncodedServletPath("find") %>"><FONT COLOR="yellow">Find</FONT></A>
|
||||||
</B></FONT></TD>
|
</B></FONT></TD>
|
||||||
|
|
||||||
<TD ALIGN=RIGHT WIDTH=150>
|
<TD ALIGN=RIGHT WIDTH=150>
|
||||||
|
@ -57,45 +60,50 @@
|
||||||
WIDTH=468 HEIGHT=60 HSPACE=2 VSPACE=2>
|
WIDTH=468 HEIGHT=60 HSPACE=2 VSPACE=2>
|
||||||
<%-- END TEMP - Banner Ad Code --%>
|
<%-- END TEMP - Banner Ad Code --%>
|
||||||
</TD>
|
</TD>
|
||||||
</TR></TABLE>
|
</TR>
|
||||||
</TD></TR>
|
|
||||||
|
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- Login reminders --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- Login reminders --><% } %>
|
||||||
<TR VALIGN=MIDDLE BGCOLOR="#6666CC"><TD ALIGN=CENTER>
|
<TR VALIGN=MIDDLE><TD ALIGN=CENTER COLSPAN=3><%= header_font %>
|
||||||
<%= rdat.getStdFontTag("white",3) %>
|
|
||||||
<% if (user.isLoggedIn()) { %>
|
<% if (user.isLoggedIn()) { %>
|
||||||
You are logged in as <B><%= StringUtil.encodeHTML(user.getUserName()) %></B>
|
You are logged in as <B><%= StringUtil.encodeHTML(user.getUserName()) %></B>
|
||||||
<% if (basedat.displayLoginLinks()) { %>
|
<% if (basedat.displayLoginLinks()) { %>
|
||||||
<% String partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd="; %>
|
<%
|
||||||
- <A HREF="<%= rdat.getEncodedServletPath(partial_tgt + "L") %>">Log Out</A>
|
partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd=";
|
||||||
| <A HREF="<%= rdat.getEncodedServletPath(partial_tgt + "P") %>">Profile</A>
|
foo = rdat.getEncodedServletPath(partial_tgt + "L");
|
||||||
|
%>
|
||||||
|
- <A HREF="<%= foo %>"><FONT COLOR="yellow">Log Out</FONT></A>
|
||||||
|
<% foo = rdat.getEncodedServletPath(partial_tgt + "P"); %>
|
||||||
|
| <A HREF="<%= foo %>"><FONT COLOR="yellow">Profile</FONT></A>
|
||||||
<% } // end if %>
|
<% } // end if %>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
You are not logged in
|
You are not logged in
|
||||||
<% if (basedat.displayLoginLinks()) { %>
|
<% if (basedat.displayLoginLinks()) { %>
|
||||||
<% String partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd="; %>
|
<%
|
||||||
- <A HREF="<%= rdat.getEncodedServletPath(partial_tgt + "L") %>">Log In</A>
|
partial_tgt = "account?tgt=" + URLEncoder.encode(basedat.getLocation()) + "&cmd=";
|
||||||
| <A HREF="<%= rdat.getEncodedServletPath(partial_tgt + "C") %>">Create Account</A>
|
foo = rdat.getEncodedServletPath(partial_tgt + "L");
|
||||||
|
%>
|
||||||
|
- <A HREF="<%= foo %>"><FONT COLOR="yellow">Log In</FONT></A>
|
||||||
|
<% foo = rdat.getEncodedServletPath(partial_tgt + "C"); %>
|
||||||
|
| <A HREF="<%= foo %>"><FONT COLOR="yellow">Create Account</FONT></A>
|
||||||
<% } // end if %>
|
<% } // end if %>
|
||||||
<% } // end if %>
|
<% } // end if %>
|
||||||
</FONT>
|
</FONT></TD></TR>
|
||||||
</TR></TD>
|
|
||||||
|
|
||||||
|
</TABLE>
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- END PAGE HEADER --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- END PAGE HEADER --><% } %>
|
||||||
|
|
||||||
<TR VALIGN=TOP><TD ALIGN=CENTER>
|
<TABLE BORDER=0 WIDTH="100%" CELLPADDING=2 CELLSPACING=0>
|
||||||
<TABLE ALIGN=CENTER WIDTH="100%" BORDER=0 CELLPADDING=2 CELLSPACING=0>
|
|
||||||
<TR VALIGN=TOP>
|
<TR VALIGN=TOP>
|
||||||
<TD ALIGN=LEFT WIDTH=120 BGCOLOR="#9999FF">
|
<TD ALIGN=LEFT WIDTH=120 BGCOLOR="#9999FF">
|
||||||
<TABLE ALIGN=LEFT WIDTH=120 CELPADDING=0 CELLSPACING=0>
|
<TABLE ALIGN=LEFT WIDTH=120 CELPADDING=0 CELLSPACING=0>
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- BEGIN LEFT SIDEBAR --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- BEGIN LEFT SIDEBAR --><% } %>
|
||||||
<TR VALIGN=TOP><TD VALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
|
<TR VALIGN=TOP><TD VALIGN=LEFT><%= stdfont %>
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- variable menu --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- variable menu --><% } %>
|
||||||
<% basedat.renderMenu(session,out,rdat); %>
|
<% basedat.renderMenu(session,out,rdat); %>
|
||||||
</FONT></TD></TR>
|
</FONT></TD></TR>
|
||||||
|
|
||||||
<TR VALIGN=TOP><TD VALIGN=LEFT> </TD></TR>
|
<TR VALIGN=TOP><TD VALIGN=LEFT> </TD></TR>
|
||||||
<TR VALIGN=TOP><TD VALIGN=LEFT><%= rdat.getStdFontTag(null,2) %>
|
<TR VALIGN=TOP><TD VALIGN=LEFT><%= stdfont %>
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- fixed menu --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- fixed menu --><% } %>
|
||||||
<% basedat.renderFixedMenu(out,rdat); %>
|
<% basedat.renderFixedMenu(out,rdat); %>
|
||||||
</FONT></TD></TR>
|
</FONT></TD></TR>
|
||||||
|
@ -111,15 +119,14 @@
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- END PAGE CONTENT --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- END PAGE CONTENT --><% } %>
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
<TR VALIGN=TOP>
|
<TR VALIGN=TOP>
|
||||||
<TD ALIGN=LEFT WIDTH=120 BGCOLOR="#9999FF"> </TD>
|
<TD ALIGN=LEFT WIDTH=120 BGCOLOR="#9999FF"> </TD>
|
||||||
<TD ALIGN=LEFT WIDTH="100%" BGCOLOR="white">
|
<TD ALIGN=LEFT WIDTH="100%" BGCOLOR="white">
|
||||||
<% if (rdat.useHTMLComments()) { %><!-- PAGE FOOTER --><% } %>
|
<% if (rdat.useHTMLComments()) { %><!-- PAGE FOOTER --><% } %>
|
||||||
<HR WIDTH="80%">
|
<HR WIDTH="80%">
|
||||||
<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=0 CELLSPACING=6><TR VALIGN=TOP>
|
<TABLE ALIGN=CENTER BORDER=0 CELLPADDING=0 CELLSPACING=6><TR VALIGN=TOP>
|
||||||
<TD ALIGN=RIGHT><%= rdat.getStdFontTag(null,1) %>
|
<TD ALIGN=RIGHT><%= smallfont %><%= rdat.getStockMessage("footer-text") %></FONT></TD>
|
||||||
<%= rdat.getStockMessage("footer-text") %>
|
|
||||||
</FONT></TD>
|
|
||||||
<TD ALIGN=LEFT>
|
<TD ALIGN=LEFT>
|
||||||
<A HREF="http://venice.sourceforge.net" TARGET="_blank"><IMG
|
<A HREF="http://venice.sourceforge.net" TARGET="_blank"><IMG
|
||||||
SRC="<%= rdat.getFullImagePath("powered-by-venice.gif") %>" ALT="Powered by Venice"
|
SRC="<%= rdat.getFullImagePath("powered-by-venice.gif") %>" ALT="Powered by Venice"
|
||||||
|
@ -128,8 +135,8 @@
|
||||||
</TR></TABLE>
|
</TR></TABLE>
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</TD></TR>
|
|
||||||
</TABLE>
|
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user