From 8a6ab3edb51d8972f4b1350b00046766d1914a96 Mon Sep 17 00:00:00 2001 From: DNx5 Date: Tue, 1 Dec 2015 02:14:28 +0700 Subject: [PATCH] Setup unrestricted names into lowercase. --- src/main/java/fr/xephi/authme/settings/Settings.java | 9 +++++++-- src/main/java/fr/xephi/authme/util/Utils.java | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 7a2096808..f9ed10be2 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -184,7 +184,12 @@ public final class Settings extends YamlConfiguration { getMySQLColumnRealName = configFile.getString("DataSource.mySQLRealName", "realname"); getNonActivatedGroup = configFile.getInt("ExternalBoardOptions.nonActivedUserGroup", -1); unRegisteredGroup = configFile.getString("GroupOptions.UnregisteredPlayerGroup", ""); - getUnrestrictedName = configFile.getStringList("settings.unrestrictions.UnrestrictedName"); + + getUnrestrictedName = new ArrayList<>(); + for (String name : configFile.getStringList("settings.unrestrictions.UnrestrictedName")) { + getUnrestrictedName.add(name.toLowerCase()); + } + getRegisteredGroup = configFile.getString("GroupOptions.RegisteredPlayerGroup", ""); getEnablePasswordVerifier = configFile.getBoolean("settings.restrictions.enablePasswordVerifier", true); @@ -689,7 +694,7 @@ public final class Settings extends YamlConfiguration { /** * Saves current configuration (plus defaults) to disk. - *

+ *

* If defaults and configuration are empty, saves blank file. * * @return True if saved successfully diff --git a/src/main/java/fr/xephi/authme/util/Utils.java b/src/main/java/fr/xephi/authme/util/Utils.java index e3e298b94..e94dd94ee 100644 --- a/src/main/java/fr/xephi/authme/util/Utils.java +++ b/src/main/java/fr/xephi/authme/util/Utils.java @@ -156,8 +156,9 @@ public final class Utils { } public static boolean isUnrestricted(Player player) { - return Settings.isAllowRestrictedIp && !Settings.getUnrestrictedName.isEmpty() - && (Settings.getUnrestrictedName.contains(player.getName())); + return Settings.isAllowRestrictedIp + && !Settings.getUnrestrictedName.isEmpty() + && (Settings.getUnrestrictedName.contains(player.getName().toLowerCase())); } /**