Changeset 25270

Show
Ignore:
Timestamp:
23.03.2012 15:42:22 (7 years ago)
Author:
sjm84
Message:

Removed the emailing code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/Authentication.java

    r25258 r25270  
    1818import java.io.File; 
    1919 
    20 import javax.mail.Message; 
    21 import javax.mail.Session; 
    22 import javax.mail.Transport; 
    23 import javax.mail.internet.InternetAddress; 
    24 import javax.mail.internet.MimeMessage; 
    25  
    26 import net.tanesha.recaptcha.ReCaptchaImpl; 
    2720import net.tanesha.recaptcha.ReCaptchaImpl; 
    2821import net.tanesha.recaptcha.ReCaptchaResponse; 
     
    4841    protected static final int ERROR_CAPTCHA_MISSING = -15; 
    4942    protected static final int ERROR_NOT_AUTHORISED = -16; 
    50     protected static final int ERROR_COULD_NOT_RESET_PASSWORD = -17; 
    5143 
    5244    protected static final HashMap<Integer, String> _errorMessageMap; 
     
    7163        errorMessageMap.put(ERROR_CAPTCHA_MISSING, "The information from the captcha is missing."); 
    7264        errorMessageMap.put(ERROR_NOT_AUTHORISED, "You are not authorised to access this page."); 
    73         errorMessageMap.put(ERROR_COULD_NOT_RESET_PASSWORD, "Your password could not be reset, your email address may be invalid."); 
    7465 
    7566        _errorMessageMap = errorMessageMap; 
     
    542533            String host = request.getAttribute("remoteAddress"); 
    543534             
    544             Properties props = System.getProperties(); 
    545             props.setProperty("mail.smtp.host", host); 
    546              
    547             Session session = Session.getDefaultInstance(props); 
    548              
    549             try 
    550             { 
    551                 MimeMessage message = new MimeMessage(session); 
    552                 message.setFrom(new InternetAddress(from)); 
    553                 message.addRecipient(Message.RecipientType.TO, new InternetAddress(email)); 
    554                 message.setSubject("Password reset"); 
    555                 message.setText("Your password was reset to " + newPassword); 
    556                  
    557                 Transport.send(message); 
    558             } 
    559             catch(Exception ex) 
    560             { 
    561                 GSXML.addError(this.doc, result, _errorMessageMap.get(ERROR_COULD_NOT_RESET_PASSWORD)); 
    562                 serviceNode.setAttribute("operation", ACCOUNT_SETTINGS); 
    563                 ex.printStackTrace(); 
    564                 return result; 
    565             } 
    566              
    567             System.err.println("MAIL SUCCESS"); 
     535            //TODO: FINISH THIS 
    568536        } 
    569537        else if (op.equals(PERFORM_DELETE_USER))