mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-24 01:27:35 +01:00
Apply Case insentitive while getting a player through database only to
disable multi-accounts
This commit is contained in:
parent
53437ed33c
commit
38b3197356
@ -58,7 +58,7 @@ public class FlatFileThread extends Thread implements DataSource {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
String[] args = line.split(":");
|
||||
if (args.length > 1 && args[0].equals(user)) {
|
||||
if (args.length > 1 && args[0].equalsIgnoreCase(user)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -426,7 +426,7 @@ public class FlatFileThread extends Thread implements DataSource {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
String[] args = line.split(":");
|
||||
if (args[0].equals(user)) {
|
||||
if (args[0].equalsIgnoreCase(user)) {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
return new PlayerAuth(args[0], args[1], "198.18.0.1", 0, "your@email.com");
|
||||
|
@ -171,8 +171,7 @@ public class MySQLThread extends Thread implements DataSource {
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
con = makeSureConnectionIsReady();
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?;");
|
||||
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||
pst.setString(1, user);
|
||||
rs = pst.executeQuery();
|
||||
return rs.next();
|
||||
@ -198,7 +197,7 @@ public class MySQLThread extends Thread implements DataSource {
|
||||
int id = -1;
|
||||
try {
|
||||
con = makeSureConnectionIsReady();
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?;");
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||
pst.setString(1, user);
|
||||
rs = pst.executeQuery();
|
||||
if (rs.next()) {
|
||||
|
@ -131,7 +131,7 @@ public class SQLiteThread extends Thread implements DataSource {
|
||||
PreparedStatement pst = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?");
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||
pst.setString(1, user);
|
||||
rs = pst.executeQuery();
|
||||
return rs.next();
|
||||
@ -149,7 +149,7 @@ public class SQLiteThread extends Thread implements DataSource {
|
||||
PreparedStatement pst = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?;");
|
||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||
pst.setString(1, user);
|
||||
rs = pst.executeQuery();
|
||||
if (rs.next()) {
|
||||
|
Loading…
Reference in New Issue
Block a user