mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-07 04:38:03 +02: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;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
String[] args = line.split(":");
|
String[] args = line.split(":");
|
||||||
if (args.length > 1 && args[0].equals(user)) {
|
if (args.length > 1 && args[0].equalsIgnoreCase(user)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -426,7 +426,7 @@ public class FlatFileThread extends Thread implements DataSource {
|
|||||||
String line;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
String[] args = line.split(":");
|
String[] args = line.split(":");
|
||||||
if (args[0].equals(user)) {
|
if (args[0].equalsIgnoreCase(user)) {
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 2:
|
case 2:
|
||||||
return new PlayerAuth(args[0], args[1], "198.18.0.1", 0, "your@email.com");
|
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;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = makeSureConnectionIsReady();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||||
|
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
return rs.next();
|
return rs.next();
|
||||||
@ -198,7 +197,7 @@ public class MySQLThread extends Thread implements DataSource {
|
|||||||
int id = -1;
|
int id = -1;
|
||||||
try {
|
try {
|
||||||
con = makeSureConnectionIsReady();
|
con = makeSureConnectionIsReady();
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
|
@ -131,7 +131,7 @@ public class SQLiteThread extends Thread implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
return rs.next();
|
return rs.next();
|
||||||
@ -149,7 +149,7 @@ public class SQLiteThread extends Thread implements DataSource {
|
|||||||
PreparedStatement pst = null;
|
PreparedStatement pst = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE " + columnName + "=?;");
|
pst = con.prepareStatement("SELECT * FROM " + tableName + " WHERE LOWEST(" + columnName + ")=LOWEST(?);");
|
||||||
pst.setString(1, user);
|
pst.setString(1, user);
|
||||||
rs = pst.executeQuery();
|
rs = pst.executeQuery();
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user