Commit a33698c8 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1321] Auto-truncate too long summary, and use a more appropriate string...

[JM-1321] Auto-truncate too long summary, and use a more appropriate string for time zone setting log.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches@10193 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3ed7f068
...@@ -13,6 +13,7 @@ import org.jivesoftware.database.SequenceManager; ...@@ -13,6 +13,7 @@ import org.jivesoftware.database.SequenceManager;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.util.JiveConstants; import org.jivesoftware.util.JiveConstants;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.util.StringUtils;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
import java.util.List; import java.util.List;
...@@ -28,7 +29,7 @@ import java.sql.*; ...@@ -28,7 +29,7 @@ import java.sql.*;
public class DefaultSecurityAuditProvider implements SecurityAuditProvider { public class DefaultSecurityAuditProvider implements SecurityAuditProvider {
private static final String LOG_ENTRY = private static final String LOG_ENTRY =
"INSERT INTO jiveSecurityAuditLog VALUES(?,?,?,?,?,?)"; "INSERT INTO jiveSecurityAuditLog(msgID,username,entryStamp,summary,node,details) VALUES(?,?,?,?,?,?)";
private static final String GET_EVENTS = private static final String GET_EVENTS =
"SELECT msgID,username,entryStamp,summary,node,details FROM jiveSecurityAuditLog"; "SELECT msgID,username,entryStamp,summary,node,details FROM jiveSecurityAuditLog";
private static final String GET_EVENT = private static final String GET_EVENT =
...@@ -57,7 +58,7 @@ public class DefaultSecurityAuditProvider implements SecurityAuditProvider { ...@@ -57,7 +58,7 @@ public class DefaultSecurityAuditProvider implements SecurityAuditProvider {
pstmt.setLong(1, msgID); pstmt.setLong(1, msgID);
pstmt.setString(2, username); pstmt.setString(2, username);
pstmt.setLong(3, new Date().getTime()); pstmt.setLong(3, new Date().getTime());
pstmt.setString(4, summary); pstmt.setString(4, StringUtils.abbreviate(summary, 250));
pstmt.setString(5, XMPPServer.getInstance().getServerInfo().getHostname()); pstmt.setString(5, XMPPServer.getInstance().getServerInfo().getHostname());
pstmt.setString(6, details); pstmt.setString(6, details);
pstmt.executeUpdate(); pstmt.executeUpdate();
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
TimeZone tz = TimeZone.getTimeZone(timeZoneID); TimeZone tz = TimeZone.getTimeZone(timeZoneID);
JiveGlobals.setTimeZone(tz); JiveGlobals.setTimeZone(tz);
// Log the event // Log the event
webManager.logEvent("updated time zone to "+tz, null); webManager.logEvent("updated time zone to "+tz.getID(), tz.toString());
} }
catch (Exception e) { catch (Exception e) {
Log.error(e); Log.error(e);
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
else { else {
JiveGlobals.setLocale(newLocale); JiveGlobals.setLocale(newLocale);
// Log the event // Log the event
webManager.logEvent("updated locale to "+newLocale, null); webManager.logEvent("updated locale to "+newLocale.getDisplayName(), null);
response.sendRedirect("server-locale.jsp?success=true"); response.sendRedirect("server-locale.jsp?success=true");
return; return;
} }
......
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