Merge pull request #1 from Xephi/master

Up
This commit is contained in:
Gabriele C. 2015-06-21 20:27:32 +02:00
commit 1fcf019b2b
4 changed files with 1745 additions and 1745 deletions

14
pom.xml
View File

@ -203,14 +203,14 @@
<!-- Multi World plugin, http://www.spigotmc.org/resources/multiverse-core.390/ -->
<dependency>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Essentials plugin-->
<!-- Essentials plugin -->
<dependency>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>

View File

@ -3,8 +3,8 @@ package fr.xephi.authme;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
@ -44,13 +44,13 @@ public class SendMailSSL {
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", String.valueOf(Settings.getMailPort));
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(Settings.getmailAccount, Settings.getmailPassword);
}
});
try {
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(Settings.getmailAccount, Settings.getmailPassword);
}
});
final Message message = new MimeMessage(session);
try {
message.setFrom(new InternetAddress(Settings.getmailAccount, sendername));
@ -66,19 +66,20 @@ public class SendMailSSL {
text = text.replace("<generatedpass>", newPass);
message.setContent(text, "text/html");
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
try {
Transport.send(message);
} catch (MessagingException e) {
e.printStackTrace();
} catch (Exception e) {
ConsoleLogger.showError("Some error appears while trying to send mail to " + auth.getEmail());
}
}
});
if (!Settings.noConsoleSpam)
ConsoleLogger.info("Email sent to : " + auth.getNickname());
} catch (MessagingException e) {
throw new RuntimeException(e);
} catch (Exception e) {
ConsoleLogger.showError("Some error appears while trying to send mail to " + auth.getEmail());
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff