Merge pull request #10 from Joriom/patch-2

Fix for phpBB3 support + bonus
This commit is contained in:
Alexandre Vanhecke 2015-01-27 03:04:37 +01:00
commit 6deb174f9e

View File

@ -286,6 +286,11 @@ public class MySQLThread extends Thread implements DataSource {
pst.setInt(3, 0);
pst.setInt(4, 0);
pst.executeUpdate();
// Update username_clean in phpbb_users
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".username_clean=? WHERE " + columnName + "=?;");
pst.setString(1, auth.getNickname().toLowerCase());
pst.setString(2, auth.getNickname());
pst.executeUpdate();
// Update player group in phpbb_users
pst = con.prepareStatement("UPDATE " + tableName + " SET " + tableName + ".group_id=? WHERE " + columnName + "=?;");
pst.setInt(1, Settings.getPhpbbGroup);
@ -303,6 +308,9 @@ public class MySQLThread extends Thread implements DataSource {
pst.setLong(1, time);
pst.setString(2, auth.getNickname());
pst.executeUpdate();
// Increment num_users
pst = con.prepareStatement("UPDATE " + Settings.getPhpbbPrefix + "config SET config_value = config_value + 1 WHERE config_name = 'num_users';");
pst.executeUpdate();
}
}
if (Settings.getPasswordHash == HashAlgorithm.WORDPRESS) {