#427 Replace registration settings with one registration type property

- Merge "useEmail" / "usePasswordConfirmation" / "useEmailConfirmation" settings into enum property
- Migrate old settings
This commit is contained in:
ljacqu
2016-12-15 22:36:54 +01:00
parent 811ceaf7ff
commit f9acb3cca1
15 changed files with 157 additions and 103 deletions
@@ -9,6 +9,7 @@ import fr.xephi.authme.process.AsynchronousProcess;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.service.ValidationService;
import fr.xephi.authme.settings.properties.RegistrationSettings;
import fr.xephi.authme.settings.properties.RegistrationArgumentType.Execution;
import org.bukkit.entity.Player;
import javax.inject.Inject;
@@ -63,7 +64,7 @@ public class AsyncAddEmail implements AsynchronousProcess {
private void sendUnloggedMessage(Player player) {
if (dataSource.isAuthAvailable(player.getName())) {
service.send(player, MessageKey.LOGIN_MESSAGE);
} else if (service.getProperty(RegistrationSettings.USE_EMAIL_REGISTRATION)) {
} else if (service.getProperty(RegistrationSettings.REGISTRATION_TYPE).getExecution() == Execution.EMAIL) {
service.send(player, MessageKey.REGISTER_EMAIL_MESSAGE);
} else {
service.send(player, MessageKey.REGISTER_MESSAGE);