Commit 025b6dfb authored by guus's avatar guus

OF-102: Delete enries from ofUserProp when user is deleted (patch by Peter Johnson).

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13500 b35dd754-fafc-0310-a699-88a17e54d16e
parent 49caea64
...@@ -70,6 +70,8 @@ public class DefaultUserProvider implements UserProvider { ...@@ -70,6 +70,8 @@ public class DefaultUserProvider implements UserProvider {
private static final String INSERT_USER = private static final String INSERT_USER =
"INSERT INTO ofUser (username,plainPassword,encryptedPassword,name,email,creationDate,modificationDate) " + "INSERT INTO ofUser (username,plainPassword,encryptedPassword,name,email,creationDate,modificationDate) " +
"VALUES (?,?,?,?,?,?,?)"; "VALUES (?,?,?,?,?,?,?)";
private static final String DELETE_USER_FLAGS =
"DELETE FROM ofUserFlag WHERE username=?";
private static final String DELETE_USER_PROPS = private static final String DELETE_USER_PROPS =
"DELETE FROM ofUserProp WHERE username=?"; "DELETE FROM ofUserProp WHERE username=?";
private static final String DELETE_USER = private static final String DELETE_USER =
...@@ -200,6 +202,11 @@ public class DefaultUserProvider implements UserProvider { ...@@ -200,6 +202,11 @@ public class DefaultUserProvider implements UserProvider {
pstmt.execute(); pstmt.execute();
DbConnectionManager.fastcloseStmt(pstmt); DbConnectionManager.fastcloseStmt(pstmt);
pstmt = con.prepareStatement(DELETE_USER_FLAGS);
pstmt.setString(1, username);
pstmt.execute();
DbConnectionManager.fastcloseStmt(pstmt);
// Delete the actual user entry // Delete the actual user entry
pstmt = con.prepareStatement(DELETE_USER); pstmt = con.prepareStatement(DELETE_USER);
pstmt.setString(1, username); pstmt.setString(1, username);
......
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