/hostadmiral/trunk/src/ak/hostadmiral/core/model/UserManager.java |
---|
30,7 → 30,6 |
private Collection deletingListeners = new ArrayList(); |
private Collection deletedListeners = new ArrayList(); |
// FIMXE: check that it works |
private Map loggedinUsers = new WeakHashMap(); |
public UserManager() |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/InetDomain.java |
---|
131,9 → 131,4 |
d.setName(origin.getName()); |
return d; |
} |
public String toString() |
{ |
return "InetDomain id=[" + getId() + "] name=[" + name + "]"; |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/Mailbox.java |
---|
292,10 → 292,4 |
m.setOwner(origin.getOwner()); |
return m; |
} |
public String toString() |
{ |
return "Mailbox id=[" + getId() + "] login=[" + login + "@" |
+ (domain == null ? "_none_" : domain.getName()) + "]"; |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAlias.java |
---|
201,10 → 201,4 |
m.setOwner(origin.getOwner()); |
return m; |
} |
public String toString() |
{ |
return "MailAlias id=[" + getId() + "] address=[" + address + "@" |
+ (domain == null ? "_none_" : domain.getName()) + "]"; |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAliasDestination.java |
---|
128,14 → 128,5 |
{ |
return true; |
} |
} |
public String toString() |
{ |
return "MailAliasDestination id=[" + getId() + "] alias=[" |
+ (alias == null ? "_none_" : alias.getAddress() + "@" |
+ (alias.getDomain() == null ? "_none_" : alias.getDomain().getName())) |
+ "] mailbox=[" + (mailbox == null ? "_none_" : mailbox.getLogin() + "@" |
+ (mailbox.getDomain() == null ? "_none_" : mailbox.getDomain().getName())) + "]" |
+ "] email=[" + (email == null ? "_none_" : email) + "]"; |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/User.java |
---|
295,6 → 295,14 |
this.loginHistory = loginHistory; |
} |
public boolean equals(Object o) |
{ |
if(o == null || !(o instanceof User)) return false; |
User u = (User)o; |
return (getId() != null) && (u.getId() != null) && (getId().equals(u.getId())); |
} |
protected void update(User origin) |
{ |
this.login = origin.login; |
303,6 → 311,14 |
this.locale = origin.locale; |
} |
public int hashCode() |
{ |
if(getId() == null) |
return 0; |
else |
return getId().hashCode(); |
} |
public String getTypeKey() |
{ |
return ak.hostadmiral.core.resources.CoreResources.TYPE_USER; |
371,6 → 387,6 |
public String toString() |
{ |
return "User id=[" + getId() + "] login=[" + login + "]"; |
return getClass().getName() + " [" + getId() + "] [" + getLogin() + "]"; |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/SystemUser.java |
---|
156,9 → 156,4 |
u.setName(origin.getName()); |
return u; |
} |
public String toString() |
{ |
return "SystemUser id=[" + getId() + "] uid=[" + uid + "] name=[" + name + "]"; |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/GeneralModelObject.java |
---|
121,26 → 121,4 |
{ |
this.modUser = modUser; |
} |
public String toString() |
{ |
return getClass().getName() + " [" + getId() + "]"; |
} |
public boolean equals(Object o) |
{ |
if(o == null) return false; |
if(!getClass().isInstance(o)) return false; |
ModelObject u = (ModelObject)o; |
return (getId() != null) && (u.getId() != null) && (getId().equals(u.getId())); |
} |
public int hashCode() |
{ |
if(getId() == null) |
return 0; |
else |
return getId().hashCode(); |
} |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/UserUpdater.java |
---|
File deleted |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/UserLoginsAction.java |
---|
17,7 → 17,6 |
import ak.hostadmiral.util.CollectionInfo; |
import ak.hostadmiral.core.model.User; |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class UserLoginsAction |
extends Action |
29,7 → 28,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
DynaActionForm theForm = (DynaActionForm)form; |
Long userId = StringConverter.parseLong(theForm.get("id")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/MailboxAction.java |
---|
32,7 → 32,6 |
import ak.hostadmiral.core.model.MailboxManager; |
import ak.hostadmiral.core.model.SystemUserManager; |
import ak.hostadmiral.core.model.InetDomainManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class MailboxAction |
extends Action |
46,7 → 45,7 |
{ |
ActionUtils.prepare(request, response); |
if("submit".equals(mapping.getParameter())) { |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
initLists(request, user); |
} |
} |
56,7 → 55,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
if("list".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long page = StringConverter.parseLong(theForm.get("pg")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/MailAliasAction.java |
---|
38,7 → 38,6 |
import ak.hostadmiral.core.model.MailAliasDestination; |
import ak.hostadmiral.core.model.MailAliasDestinationManager; |
import ak.hostadmiral.core.model.InetDomainManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
import ak.hostadmiral.core.form.MailAliasDestBean; |
public final class MailAliasAction |
53,7 → 52,7 |
{ |
ActionUtils.prepare(request, response); |
if("submit".equals(mapping.getParameter())) { |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
initLists(request, user); |
} |
} |
63,7 → 62,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
if("list".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long page = StringConverter.parseLong(theForm.get("pg")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/UserAction.java |
---|
28,7 → 28,6 |
import ak.hostadmiral.core.resources.CoreResources; |
import ak.hostadmiral.core.model.User; |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class UserAction |
extends Action |
42,7 → 41,7 |
{ |
ActionUtils.prepare(request, response); |
if("submit".equals(mapping.getParameter()) || "partsubmit".equals(mapping.getParameter())) { |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
initUserList(request, user); |
DynaActionForm theForm = (DynaActionForm)form; |
70,7 → 69,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
if("list".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/SystemUserAction.java |
---|
30,7 → 30,6 |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.model.SystemUser; |
import ak.hostadmiral.core.model.SystemUserManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class SystemUserAction |
extends Action |
44,7 → 43,7 |
{ |
ActionUtils.prepare(request, response); |
if("submit".equals(mapping.getParameter())) { |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
initUserList(request, user); |
} |
} |
54,7 → 53,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
if("list".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/InetDomainAction.java |
---|
30,7 → 30,6 |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.model.InetDomain; |
import ak.hostadmiral.core.model.InetDomainManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class InetDomainAction |
extends Action |
44,7 → 43,7 |
{ |
ActionUtils.prepare(request, response); |
if("submit".equals(mapping.getParameter())) { |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
initUserList(request, user); |
} |
} |
54,7 → 53,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
if("list".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/ChangePasswordAction.java |
---|
17,7 → 17,6 |
import ak.hostadmiral.core.resources.CoreResources; |
import ak.hostadmiral.core.model.User; |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class ChangePasswordAction |
extends Action |
33,7 → 32,7 |
else { |
DynaActionForm theForm = (DynaActionForm)form; |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
if(user.checkPassword((String)theForm.get("oldpassword"))) { |
user.setPassword(user, (String)theForm.get("password")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/LoginAction.java |
---|
18,7 → 18,6 |
import ak.hostadmiral.core.resources.CoreResources; |
import ak.hostadmiral.core.model.User; |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class LoginAction |
extends Action |
47,7 → 46,7 |
return mapping.getInputForward(); |
} |
else { |
request.getSession().setAttribute(SessionKeys.USER, user); |
request.getSession().setAttribute("user", user); |
request.getSession().setAttribute(Globals.LOCALE_KEY, user.getLocale()); |
String origin = BackPath.findBackPath(request).getBackwardUrl(); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/IndexAction.java |
---|
14,7 → 14,6 |
import ak.hostadmiral.core.model.InetDomainManager; |
import ak.hostadmiral.core.model.MailboxManager; |
import ak.hostadmiral.core.model.MailAliasManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class IndexAction |
extends Action |
24,7 → 23,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
request.setAttribute("showSystemUsers", |
Boolean.valueOf(SystemUserManager.getInstance().areSystemUsersAvailable(user))); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/FailedLoginsAction.java |
---|
16,7 → 16,6 |
import ak.hostadmiral.util.StringConverter; |
import ak.hostadmiral.core.model.User; |
import ak.hostadmiral.core.model.UserManager; |
import ak.hostadmiral.core.servlet.SessionKeys; |
public final class FailedLoginsAction |
extends Action |
26,7 → 25,7 |
throws Exception |
{ |
ActionUtils.prepare(request, response); |
User user = (User)request.getSession().getAttribute(SessionKeys.USER); |
User user = (User)request.getSession().getAttribute("user"); |
List logins = new ArrayList(UserManager.getInstance().listFailedLogins(user)); |
Collections.sort(logins, UserManager.LOGINS_TIME_COMPARATOR); |
/hostadmiral/trunk/src/ak/hostadmiral/core/servlet/SessionKeys.java |
---|
File deleted |
/hostadmiral/trunk/src/ak/hostadmiral/core/servlet/LoginFilter.java |
---|
126,7 → 126,7 |
if(session == null) |
throw new AccessControlException("No session"); |
Object userObj = session.getAttribute(SessionKeys.USER); |
Object userObj = session.getAttribute("user"); |
if(userObj == null) |
throw new AccessControlException("No user"); |