Various minor changes

- AsynchronousLogin: call common permission methods through CommonService instead of PermissionsManager
- CommandManager: remove superfluous replacement of %p (handled by lazy tag replacer)
- Remove unused method in CommonService
- Create DebugSectionConsistencyTest
- SendMailSSL: Enable debug output if AuthMe log level is set to debug
- Add Utils#logAndSendMessage and replace existing, separate implementations
This commit is contained in:
ljacqu
2017-03-12 14:04:39 +01:00
parent 72acf28233
commit 10d8f00c92
13 changed files with 148 additions and 65 deletions
@@ -1,8 +1,10 @@
package fr.xephi.authme.mail;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.output.LogLevel;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.EmailSettings;
import fr.xephi.authme.settings.properties.PluginSettings;
import fr.xephi.authme.util.StringUtils;
import org.apache.commons.mail.EmailConstants;
import org.apache.commons.mail.EmailException;
@@ -56,6 +58,9 @@ public class SendMailSSL {
email.setFrom(senderMail, senderName);
email.setSubject(settings.getProperty(EmailSettings.RECOVERY_MAIL_SUBJECT));
email.setAuthentication(settings.getProperty(EmailSettings.MAIL_ACCOUNT), mailPassword);
if (settings.getProperty(PluginSettings.LOG_LEVEL).includes(LogLevel.DEBUG)) {
email.setDebug(true);
}
setPropertiesForPort(email, port);
return email;