From 800ecb16a0613059de9c10649195351dcdf69acc Mon Sep 17 00:00:00 2001 From: Xephi Date: Mon, 16 Jun 2014 01:11:22 +0200 Subject: [PATCH] Fix for XenForo --- .../java/fr/xephi/authme/datasource/MySQLDataSource.java | 6 ++++++ src/main/java/fr/xephi/authme/threads/MySQLThread.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/fr/xephi/authme/datasource/MySQLDataSource.java b/src/main/java/fr/xephi/authme/datasource/MySQLDataSource.java index d0f84b8d..6b64618c 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQLDataSource.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQLDataSource.java @@ -209,6 +209,7 @@ public class MySQLDataSource implements DataSource { rs.close(); pst = con.prepareStatement("SELECT * FROM xf_user_authenticate WHERE " + columnID + "=?;"); pst.setInt(1, id); + rs = pst.executeQuery(); if (rs.next()) { Blob blob = rs.getBlob("data"); byte[] bytes = blob.getBytes(1, (int) blob.length()); @@ -435,6 +436,11 @@ public class MySQLDataSource implements DataSource { blob.setBytes(1, bytes); pst.setBlob(1, blob); pst.setInt(2, id); + pst.executeUpdate(); + pst = con.prepareStatement("UPDATE xf_user_authenticate SET scheme_class=? WHERE " + columnID + "=?;"); + pst.setString(1, "XenForo_Authentication_Core12"); + pst.setInt(2, id); + pst.executeUpdate(); } } } catch (SQLException ex) { diff --git a/src/main/java/fr/xephi/authme/threads/MySQLThread.java b/src/main/java/fr/xephi/authme/threads/MySQLThread.java index 94b7e646..6d23f472 100644 --- a/src/main/java/fr/xephi/authme/threads/MySQLThread.java +++ b/src/main/java/fr/xephi/authme/threads/MySQLThread.java @@ -238,6 +238,7 @@ public class MySQLThread extends Thread implements DataSource { rs.close(); pst = con.prepareStatement("SELECT * FROM xf_user_authenticate WHERE " + columnID + "=?;"); pst.setInt(1, id); + rs = pst.executeQuery(); if (rs.next()) { Blob blob = rs.getBlob("data"); byte[] bytes = blob.getBytes(1, (int) blob.length()); @@ -464,6 +465,11 @@ public class MySQLThread extends Thread implements DataSource { blob.setBytes(1, bytes); pst.setBlob(1, blob); pst.setInt(2, id); + pst.executeUpdate(); + pst = con.prepareStatement("UPDATE xf_user_authenticate SET scheme_class=? WHERE " + columnID + "=?;"); + pst.setString(1, "XenForo_Authentication_Core12"); + pst.setInt(2, id); + pst.executeUpdate(); } } } catch (SQLException ex) {