fixed several bugs related to SIG creation/deletion and a nasty brown paper

bag bug in Nuke Post!
This commit is contained in:
Eric J. Bowersox
2001-04-12 05:53:26 +00:00
parent 7e226040d4
commit 89429a4b40
6 changed files with 39 additions and 20 deletions

View File

@@ -165,9 +165,9 @@ class SIGCoreData implements SIGData, SIGDataBackend
this.engine = engine;
this.datapool = datapool;
this.sigid = sigid;
this.created = (java.util.Date)(creation.clone());
this.last_access = this.created;
this.last_update = this.created;
this.created = creation;
this.last_access = creation;
this.last_update = creation;
this.read_level = DefaultLevels.newSIGRead();
this.write_level = DefaultLevels.newSIGWrite();
this.create_level = DefaultLevels.newSIGCreate();
@@ -1800,7 +1800,7 @@ class SIGCoreData implements SIGData, SIGDataBackend
Statement stmt = conn.createStatement();
// lock the tables we need to reference immediately
stmt.executeUpdate("LOCK TABLES sigs WRITE, sigmember WRITE, sigtoconf READ;");
stmt.executeUpdate("LOCK TABLES sigs WRITE, sigmember WRITE, confhotlist WRITE, sigtoconf READ;");
try
{ // first delete the SIG record itself
stmt.executeUpdate("DELETE FROM sigs WHERE sigid = " + sigid + ";");
@@ -1808,6 +1808,10 @@ class SIGCoreData implements SIGData, SIGDataBackend
// now delete the members list
stmt.executeUpdate("DELETE FROM sigmember WHERE sigid = " + sigid + ";");
// We need to make sure this SIG's conferences are removed from everyone's hotlist,
// if they're present. (Bug #415474)
stmt.executeUpdate("DELETE FROM confhotlist WHERE sigid = " + sigid + ";");
// determine the number of conferences in this SIG, and the maximum conference ID
ResultSet rs = stmt.executeQuery("SELECT COUNT(*), MAX(confid) FROM sigtoconf WHERE sigid = "
+ sigid + ";");

View File

@@ -746,9 +746,10 @@ class TopicMessageUserContextImpl implements TopicMessageContext
if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0)
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 1 of renumber - Renumber all posts IN THIS TOPIC that had a number higher than the one
// we just blew to hell. (Must have the "topicid =" clause in there - see Bug #415473)
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE topicid = " + x_topic_id + " AND 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 = "

View File

@@ -193,6 +193,8 @@ public class SIGOperations extends VeniceServlet
// present the "Create New SIG" dialog
CreateSIGDialog dlg = makeCreateSIGDialog();
dlg.setupDialog(engine);
dlg.setFieldValue("language","en-US");
dlg.setFieldValue("country","US");
changeMenuTop(request);
return dlg;

View File

@@ -108,7 +108,7 @@ public class NewSIGWelcome implements JSPRender
public String getDisplayURL(RenderData rdat)
{
return rdat.getFullServletPath(entry_url);
return rdat.getCompleteServletPath(entry_url);
} // end getEntryURL

View File

@@ -149,6 +149,17 @@ public class RenderData
} // end getFullServletPath
public String getCompleteServletPath(String name)
{
StringBuffer buf = new StringBuffer("http://");
buf.append(request.getServerName());
if (request.getServerPort()!=80)
buf.append(':').append(request.getServerPort());
buf.append(request.getContextPath()).append('/').append(name);
return buf.toString();
} // end getCompleteServletPath
public String getEncodedServletPath(String name)
{
return response.encodeURL(this.getFullServletPath(name));