Email verification code (#1382)

* Base verification code implementation, must define command, manager, events
* VerificationManager, verification command and messages, handled some sensible commands, configuration values
* Improved manager and sensible commands trigger
* Updated messages
* Updated verification code manager, fixed tests
* Switched to a permission based command
* Verification manager and command improved and added tests
* Edited messages
This commit is contained in:
HexelDev
2017-10-28 12:23:14 +02:00
committed by ljacqu
parent 8422581a82
commit ba65633182
58 changed files with 1227 additions and 67 deletions
@@ -20,6 +20,7 @@ public class Settings extends SettingsManager {
private final File pluginFolder;
private String passwordEmailMessage;
private String verificationEmailMessage;
private String recoveryCodeEmailMessage;
/**
@@ -46,6 +47,15 @@ public class Settings extends SettingsManager {
return passwordEmailMessage;
}
/**
* Return the text for verification emails (before sensitive commands can be used).
*
* @return The email message
*/
public String getVerificationEmailMessage() {
return verificationEmailMessage;
}
/**
* Return the text to use when someone requests to receive a recovery code.
*
@@ -57,6 +67,7 @@ public class Settings extends SettingsManager {
private void loadSettingsFromFiles() {
passwordEmailMessage = readFile("email.html");
verificationEmailMessage = readFile("verification_code_email.html");
recoveryCodeEmailMessage = readFile("recovery_code_email.html");
}
@@ -147,6 +147,10 @@ public final class SecuritySettings implements SettingsHolder {
public static final Property<Boolean> USE_EMAIL_MASKING =
newProperty("Security.privacy.enableEmailMasking", false);
@Comment("Minutes after which a verification code will expire")
public static final Property<Integer> VERIFICATION_CODE_EXPIRATION_MINUTES =
newProperty("Security.privacy.verificationCodeExpiration", 10);
private SecuritySettings() {
}