Search in sources :

Example 1 with LostPasswordSpammer

use of net.jforum.util.mail.LostPasswordSpammer in project jforum2 by rafaelsteil.

the class UserAction method lostPasswordSend.

// Send lost password email
public void lostPasswordSend() {
    String email = this.request.getParameter("email");
    String username = this.request.getParameter("username");
    User user = this.prepareLostPassword(username, email);
    if (user == null) {
        // user could not be found
        this.context.put("message", I18n.getMessage("PasswordRecovery.invalidUserEmail"));
        this.lostPassword();
        return;
    }
    Executor.execute(new EmailSenderTask(new LostPasswordSpammer(user, SystemGlobals.getValue(ConfigKeys.MAIL_LOST_PASSWORD_SUBJECT))));
    this.setTemplateName(TemplateKeys.USER_LOSTPASSWORD_SEND);
    this.context.put("message", I18n.getMessage("PasswordRecovery.emailSent", new String[] { this.request.getContextPath() + "/user/login" + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION) }));
}
Also used : EmailSenderTask(net.jforum.util.mail.EmailSenderTask) User(net.jforum.entities.User) LostPasswordSpammer(net.jforum.util.mail.LostPasswordSpammer)

Aggregations

User (net.jforum.entities.User)1 EmailSenderTask (net.jforum.util.mail.EmailSenderTask)1 LostPasswordSpammer (net.jforum.util.mail.LostPasswordSpammer)1