18 package org.turro.mail.impl;
20 import java.util.Date;
21 import org.turro.elephant.context.ElephantContext;
22 import org.turro.elephant.context.IConstructor;
23 import org.turro.elephant.impl.context.ContextFactory;
24 import org.turro.elephant.security.IUser;
33 private String link, message, exParam;
38 this.constructor = constructor;
40 this.message = message;
41 this.exParam = exParam;
45 this.constructor = constructor;
48 this.message = message;
49 this.exParam = exParam;
60 if(user ==
null)
return null;
62 if(message.indexOf(
"{linkTmpSes}") > -1) {
63 String key = user.
createTmpKey(
new Date(
new Date().getTime() + (2L * 24L * 60L * 60L * 1000L)));
65 (exParam ==
null ?
"?" : exParam +
"&") +
"tmpses=" + key;
66 message = message.replaceAll(
"\\{linkTmpSes\\}",
"<a href=\"" + server +
"\">" + link +
"</a>");
69 message = message.replaceAll(
"\\{login\\}", user.
getId())
70 .replaceAll(
"\\{name\\}", user.
getName())
71 .replaceAll(
"\\{comment\\}", comment);
81 if (getClass() != obj.getClass()) {
85 if (this.user.
getId() != other.user.
getId() && (this.user.
getId() ==
null || !this.user.
getId().equals(other.user.
getId()))) {
94 hash = 31 * hash + (this.user !=
null && this.user.
getId() !=
null ? this.user.
getId().hashCode() : 0);
static String getServerUrl(String scheme)
static IUser getUser(IConstructor constructor)
MailUser(IConstructor constructor, IUser user, String link, String message, String exParam)
String getMessage(String comment)
boolean equals(Object obj)
MailUser(IConstructor constructor, String login, String link, String message, String exParam)
static final String CONNECTOR_EMAIL
boolean impersonate(String login)
String getProperty(String key)
String createTmpKey(Date valid)