Add email Whitelist (override Blacklist if no empty)
This commit is contained in:
parent
afc1ea9111
commit
55c7c4f9e1
@ -49,6 +49,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
public static List<String> welcomeMsg = null;
|
public static List<String> welcomeMsg = null;
|
||||||
public static List<String> unsafePasswords;
|
public static List<String> unsafePasswords;
|
||||||
public static List<String> emailBlacklist = null;
|
public static List<String> emailBlacklist = null;
|
||||||
|
public static List<String> emailWhitelist = null;
|
||||||
|
|
||||||
public static Boolean isPermissionCheckEnabled, isRegistrationEnabled,
|
public static Boolean isPermissionCheckEnabled, isRegistrationEnabled,
|
||||||
isForcedRegistrationEnabled, isTeleportToSpawnEnabled,
|
isForcedRegistrationEnabled, isTeleportToSpawnEnabled,
|
||||||
@ -378,6 +379,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
applyBlindEffect = configFile.getBoolean("settings.applyBlindEffect",
|
applyBlindEffect = configFile.getBoolean("settings.applyBlindEffect",
|
||||||
false);
|
false);
|
||||||
emailBlacklist = configFile.getStringList("Email.emailBlacklisted");
|
emailBlacklist = configFile.getStringList("Email.emailBlacklisted");
|
||||||
|
emailWhitelist = configFile.getStringList("Email.emailWhitelisted");
|
||||||
|
|
||||||
// Load the welcome message
|
// Load the welcome message
|
||||||
getWelcomeMessage(plugin);
|
getWelcomeMessage(plugin);
|
||||||
@ -653,6 +655,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
applyBlindEffect = configFile.getBoolean("settings.applyBlindEffect",
|
applyBlindEffect = configFile.getBoolean("settings.applyBlindEffect",
|
||||||
false);
|
false);
|
||||||
emailBlacklist = configFile.getStringList("Email.emailBlacklisted");
|
emailBlacklist = configFile.getStringList("Email.emailBlacklisted");
|
||||||
|
emailWhitelist = configFile.getStringList("Email.emailWhitelisted");
|
||||||
|
|
||||||
// Reload the welcome message
|
// Reload the welcome message
|
||||||
getWelcomeMessage(AuthMe.getInstance());
|
getWelcomeMessage(AuthMe.getInstance());
|
||||||
@ -789,8 +792,12 @@ public final class Settings extends YamlConfiguration {
|
|||||||
set("Email.emailBlacklisted", new ArrayList<String>());
|
set("Email.emailBlacklisted", new ArrayList<String>());
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
if (contains("Performances.useMultiThreading")) set(
|
if (contains("Performances.useMultiThreading"))
|
||||||
"Performances.useMultiThreading", null);
|
set("Performances.useMultiThreading", null);
|
||||||
|
if (!contains("Email.emailWhitelisted")) {
|
||||||
|
set("Email.emailWhitelisted", new ArrayList<String>());
|
||||||
|
changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (changes) {
|
if (changes) {
|
||||||
plugin.getLogger()
|
plugin.getLogger()
|
||||||
@ -1008,10 +1015,23 @@ public final class Settings extends YamlConfiguration {
|
|||||||
if (!email.contains("@")) correct = false;
|
if (!email.contains("@")) correct = false;
|
||||||
if (!email.equalsIgnoreCase("your@email.com")) correct = false;
|
if (!email.equalsIgnoreCase("your@email.com")) correct = false;
|
||||||
String emailDomain = email.split("@")[1];
|
String emailDomain = email.split("@")[1];
|
||||||
for (String domain : emailBlacklist) {
|
if (emailWhitelist != null && !emailWhitelist.isEmpty()) {
|
||||||
if (domain.equalsIgnoreCase(emailDomain)) {
|
for (String domain : emailWhitelist) {
|
||||||
correct = false;
|
if (!domain.equalsIgnoreCase(emailDomain)) {
|
||||||
break;
|
correct = false;
|
||||||
|
} else {
|
||||||
|
correct = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return correct;
|
||||||
|
}
|
||||||
|
if (emailBlacklist != null && !emailBlacklist.isEmpty()) {
|
||||||
|
for (String domain : emailBlacklist) {
|
||||||
|
if (domain.equalsIgnoreCase(emailDomain)) {
|
||||||
|
correct = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return correct;
|
return correct;
|
||||||
|
|||||||
@ -359,9 +359,11 @@ Email:
|
|||||||
recallPlayers: false
|
recallPlayers: false
|
||||||
# Delay in minute for the recall scheduler
|
# Delay in minute for the recall scheduler
|
||||||
delayRecall: 5
|
delayRecall: 5
|
||||||
# Blacklist these domain for emails
|
# Blacklist these domains for emails
|
||||||
emailBlacklisted:
|
emailBlacklisted:
|
||||||
- 10minutemail.com
|
- 10minutemail.com
|
||||||
|
# WhiteList only these domains for emails
|
||||||
|
emailWhitelisted: []
|
||||||
Hooks:
|
Hooks:
|
||||||
# Do we need to hook with multiverse for spawn checking?
|
# Do we need to hook with multiverse for spawn checking?
|
||||||
multiverse: true
|
multiverse: true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user