/hostadmiral/trunk/src/ak/hostadmiral/core/model/UserManager.java |
---|
20,7 → 20,7 |
protected static void register() |
{ |
synchronized(MailboxManager.class) { |
synchronized(UserManager.class) { |
if(registered) return; |
registered = true; |
/hostadmiral/trunk/src/ak/hostadmiral/core/servlet/ListenerRegistratorServlet.java |
---|
18,7 → 18,7 |
public void init() |
throws ServletException |
{ |
// users |
// -- user -------------------------------------------------------------------------------- |
register("UserCreatedListener", new Registrar() { |
public void reg(Object o) { |
UserManager.getInstance().addCreatedListener((UserCreatedListener)o); |
39,6 → 39,98 |
UserManager.getInstance().addDeletedListener((UserDeletedListener)o); |
} |
}); |
// -- inet domain ------------------------------------------------------------------------- |
register("InetDomainCreatedListener", new Registrar() { |
public void reg(Object o) { |
InetDomainManager.getInstance().addCreatedListener((InetDomainCreatedListener)o); |
} |
}); |
register("InetDomainModifiedListener", new Registrar() { |
public void reg(Object o) { |
InetDomainManager.getInstance().addModifiedListener((InetDomainModifiedListener)o); |
} |
}); |
register("InetDomainBeforeDeleteListener", new Registrar() { |
public void reg(Object o) { |
InetDomainManager.getInstance().addBeforeDeleteListener( |
(InetDomainBeforeDeleteListener)o); |
} |
}); |
register("InetDomainDeletedListener", new Registrar() { |
public void reg(Object o) { |
InetDomainManager.getInstance().addDeletedListener((InetDomainDeletedListener)o); |
} |
}); |
// -- system user ------------------------------------------------------------------------- |
register("SystemUserCreatedListener", new Registrar() { |
public void reg(Object o) { |
SystemUserManager.getInstance().addCreatedListener((SystemUserCreatedListener)o); |
} |
}); |
register("SystemUserModifiedListener", new Registrar() { |
public void reg(Object o) { |
SystemUserManager.getInstance().addModifiedListener((SystemUserModifiedListener)o); |
} |
}); |
register("SystemUserBeforeDeleteListener", new Registrar() { |
public void reg(Object o) { |
SystemUserManager.getInstance().addBeforeDeleteListener( |
(SystemUserBeforeDeleteListener)o); |
} |
}); |
register("SystemUserDeletedListener", new Registrar() { |
public void reg(Object o) { |
SystemUserManager.getInstance().addDeletedListener((SystemUserDeletedListener)o); |
} |
}); |
// -- mailbox ----------------------------------------------------------------------------- |
register("MailboxCreatedListener", new Registrar() { |
public void reg(Object o) { |
MailboxManager.getInstance().addCreatedListener((MailboxCreatedListener)o); |
} |
}); |
register("MailboxModifiedListener", new Registrar() { |
public void reg(Object o) { |
MailboxManager.getInstance().addModifiedListener((MailboxModifiedListener)o); |
} |
}); |
register("MailboxBeforeDeleteListener", new Registrar() { |
public void reg(Object o) { |
MailboxManager.getInstance().addBeforeDeleteListener( |
(MailboxBeforeDeleteListener)o); |
} |
}); |
register("MailboxDeletedListener", new Registrar() { |
public void reg(Object o) { |
MailboxManager.getInstance().addDeletedListener((MailboxDeletedListener)o); |
} |
}); |
// -- mail alias -------------------------------------------------------------------------- |
register("MailAliasCreatedListener", new Registrar() { |
public void reg(Object o) { |
MailAliasManager.getInstance().addCreatedListener((MailAliasCreatedListener)o); |
} |
}); |
register("MailAliasModifiedListener", new Registrar() { |
public void reg(Object o) { |
MailAliasManager.getInstance().addModifiedListener((MailAliasModifiedListener)o); |
} |
}); |
register("MailAliasBeforeDeleteListener", new Registrar() { |
public void reg(Object o) { |
MailAliasManager.getInstance().addBeforeDeleteListener( |
(MailAliasBeforeDeleteListener)o); |
} |
}); |
register("MailAliasDeletedListener", new Registrar() { |
public void reg(Object o) { |
MailAliasManager.getInstance().addDeletedListener((MailAliasDeletedListener)o); |
} |
}); |
} |
private void register(String paramName, Registrar registrar) |
/hostadmiral/trunk/src/ak/hostadmiral/core/listener/file/FileListener.java |
---|
14,7 → 14,19 |
implements |
UserCreatedListener, |
UserModifiedListener, |
UserDeletedListener |
UserDeletedListener, |
InetDomainCreatedListener, |
InetDomainModifiedListener, |
InetDomainDeletedListener, |
SystemUserCreatedListener, |
SystemUserModifiedListener, |
SystemUserDeletedListener, |
MailboxCreatedListener, |
MailboxModifiedListener, |
MailboxDeletedListener, |
MailAliasCreatedListener, |
MailAliasModifiedListener, |
MailAliasDeletedListener |
{ |
private static final Logger logger = Logger.getLogger(FileListener.class); |
41,6 → 53,7 |
s = s.replaceAll("\\\\", "\\\\\\\\"); |
s = s.replaceAll("\t", "\\\\t"); |
s = s.replaceAll("\n", "\\\\n"); |
s = s.replaceAll("\r", "\\\\r"); |
return s; |
} |
160,7 → 173,8 |
+ escape(mailbox.getDomain().getName()) + "\t" |
+ mailbox.getVirusCheck() + "\t" |
+ mailbox.getSpamCheck() + "\t" |
+ mailbox.getSystemUser().getUid() + "\t" |
+ (mailbox.getSystemUser() == null ? "" : mailbox.getSystemUser().getUid().toString()) |
+ "\t" |
+ mailbox.getEnabled() + "\t" |
+ escape(mailbox.getComment())); |
} |
175,7 → 189,8 |
+ escape(mailbox.getDomain().getName()) + "\t" |
+ mailbox.getVirusCheck() + "\t" |
+ mailbox.getSpamCheck() + "\t" |
+ mailbox.getSystemUser().getUid() + "\t" |
+ (mailbox.getSystemUser() == null ? "" : mailbox.getSystemUser().getUid().toString()) |
+ "\t" |
+ mailbox.getEnabled() + "\t" |
+ escape(mailbox.getComment())); |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/InetDomainAction.java |
---|
3,6 → 3,7 |
import java.util.List; |
import java.util.Collections; |
import java.util.ArrayList; |
import java.util.HashSet; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
84,6 → 85,18 |
else |
return mapping.findForward("view"); |
} |
else if("deleting".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long domainId = StringConverter.parseLong(theForm.get("id")); |
InetDomain domain = InetDomainManager.getInstance().get(user, domainId); |
request.setAttribute("action", "/domain/delete.do"); |
request.setAttribute("object", domain); |
request.setAttribute("cascade", |
InetDomainManager.getInstance().beforeDelete(user, domain, new HashSet())); |
return mapping.findForward("default"); |
} |
else if("delete".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long domainId = StringConverter.parseLong(theForm.get("id")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/MailboxAction.java |
---|
3,6 → 3,7 |
import java.util.List; |
import java.util.Collections; |
import java.util.ArrayList; |
import java.util.HashSet; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
93,6 → 94,18 |
else |
return mapping.findForward("view"); |
} |
else if("deleting".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long boxId = StringConverter.parseLong(theForm.get("id")); |
Mailbox mailbox = MailboxManager.getInstance().get(user, boxId); |
request.setAttribute("action", "/mail/box/delete.do"); |
request.setAttribute("object", mailbox); |
request.setAttribute("cascade", |
MailboxManager.getInstance().beforeDelete(user, mailbox, new HashSet())); |
return mapping.findForward("default"); |
} |
else if("delete".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long boxId = StringConverter.parseLong(theForm.get("id")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/MailAliasAction.java |
---|
4,6 → 4,7 |
import java.util.Iterator; |
import java.util.Collections; |
import java.util.ArrayList; |
import java.util.HashSet; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
111,6 → 112,18 |
else |
return mapping.findForward("view"); |
} |
else if("deleting".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long aliasId = StringConverter.parseLong(theForm.get("id")); |
MailAlias alias = MailAliasManager.getInstance().get(user, aliasId); |
request.setAttribute("action", "/mail/alias/delete.do"); |
request.setAttribute("object", alias); |
request.setAttribute("cascade", |
MailAliasManager.getInstance().beforeDelete(user, alias, new HashSet())); |
return mapping.findForward("default"); |
} |
else if("delete".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long aliasId = StringConverter.parseLong(theForm.get("id")); |
/hostadmiral/trunk/src/ak/hostadmiral/core/action/SystemUserAction.java |
---|
3,6 → 3,7 |
import java.util.List; |
import java.util.Collections; |
import java.util.ArrayList; |
import java.util.HashSet; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
85,6 → 86,18 |
else |
return mapping.findForward("view"); |
} |
else if("deleting".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long userId = StringConverter.parseLong(theForm.get("id")); |
SystemUser u = SystemUserManager.getInstance().get(user, userId); |
request.setAttribute("action", "/user/system/delete.do"); |
request.setAttribute("object", u); |
request.setAttribute("cascade", |
SystemUserManager.getInstance().beforeDelete(user, u, new HashSet())); |
return mapping.findForward("default"); |
} |
else if("delete".equals(mapping.getParameter())) { |
DynaActionForm theForm = (DynaActionForm)form; |
Long userId = StringConverter.parseLong(theForm.get("id")); |
/hostadmiral/trunk/webapp/user/system/list.jsp |
---|
69,7 → 69,7 |
</td> |
<td> |
<core:deleteable name="u"> |
<backpath:link action="/user/system/delete" paramId="id" paramName="u" paramProperty="id"><bean:message key="ak.hostadmiral.page.user.system.list.delete" /></backpath:link> |
<backpath:link action="/user/system/deleting" paramId="id" paramName="u" paramProperty="id"><bean:message key="ak.hostadmiral.page.user.system.list.delete" /></backpath:link> |
</core:deleteable> |
<core:notDeleteable name="u"> |
|
/hostadmiral/trunk/webapp/mail/box/list.jsp |
---|
62,7 → 62,7 |
</td> |
<td> |
<core:deleteable name="mailbox"> |
<backpath:link action="/mail/box/delete" paramId="id" paramName="mailbox" paramProperty="id"><bean:message key="ak.hostadmiral.page.mail.box.list.delete" /></backpath:link> |
<backpath:link action="/mail/box/deleting" paramId="id" paramName="mailbox" paramProperty="id"><bean:message key="ak.hostadmiral.page.mail.box.list.delete" /></backpath:link> |
</core:deleteable> |
<core:notDeleteable name="mailbox"> |
|
/hostadmiral/trunk/webapp/mail/alias/list.jsp |
---|
67,7 → 67,7 |
</td> |
<td> |
<core:deleteable name="alias"> |
<backpath:link action="/mail/alias/delete" paramId="id" paramName="alias" paramProperty="id"><bean:message key="ak.hostadmiral.page.mail.alias.list.delete" /></backpath:link> |
<backpath:link action="/mail/alias/deleting" paramId="id" paramName="alias" paramProperty="id"><bean:message key="ak.hostadmiral.page.mail.alias.list.delete" /></backpath:link> |
</core:deleteable> |
<core:notDeleteable name="alias"> |
|
/hostadmiral/trunk/webapp/WEB-INF/struts-config.xml |
---|
306,6 → 306,17 |
</action> |
<action |
path="/user/system/deleting" |
type="ak.hostadmiral.core.action.SystemUserAction" |
parameter="deleting" |
name="SystemUserForm" |
validate="true" |
scope="request" |
> |
<forward name="default" path="/deleting.jsp" /> |
</action> |
<action |
path="/user/system/delete" |
type="ak.hostadmiral.core.action.SystemUserAction" |
parameter="delete" |
338,7 → 349,7 |
> |
</action> |
<!-- == system user ======================================================================= --> |
<!-- == inet domain ======================================================================= --> |
<action |
path="/domain/list" |
349,6 → 360,17 |
</action> |
<action |
path="/domain/deleting" |
type="ak.hostadmiral.core.action.InetDomainAction" |
parameter="deleting" |
name="InetDomainForm" |
validate="true" |
scope="request" |
> |
<forward name="default" path="/deleting.jsp" /> |
</action> |
<action |
path="/domain/delete" |
type="ak.hostadmiral.core.action.InetDomainAction" |
parameter="delete" |
392,6 → 414,17 |
</action> |
<action |
path="/mail/box/deleting" |
type="ak.hostadmiral.core.action.MailboxAction" |
parameter="deleting" |
name="MailboxForm" |
validate="true" |
scope="request" |
> |
<forward name="default" path="/deleting.jsp" /> |
</action> |
<action |
path="/mail/box/delete" |
type="ak.hostadmiral.core.action.MailboxAction" |
parameter="delete" |
435,6 → 468,17 |
</action> |
<action |
path="/mail/alias/deleting" |
type="ak.hostadmiral.core.action.MailAliasAction" |
parameter="deleting" |
name="MailAliasForm" |
validate="true" |
scope="request" |
> |
<forward name="default" path="/deleting.jsp" /> |
</action> |
<action |
path="/mail/alias/delete" |
type="ak.hostadmiral.core.action.MailAliasAction" |
parameter="delete" |
/hostadmiral/trunk/webapp/WEB-INF/web.xml |
---|
106,6 → 106,7 |
<param-name>InetDomainCreatedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
112,6 → 113,7 |
<param-name>InetDomainModifiedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
118,6 → 120,7 |
<param-name>InetDomainDeletedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
124,6 → 127,7 |
<param-name>SystemUserCreatedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
130,6 → 134,7 |
<param-name>SystemUserModifiedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
136,6 → 141,7 |
<param-name>SystemUserDeletedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
142,6 → 148,7 |
<param-name>MailboxCreatedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
148,6 → 155,7 |
<param-name>MailboxModifiedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
154,6 → 162,7 |
<param-name>MailboxDeletedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
160,6 → 169,7 |
<param-name>MailAliasCreatedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
166,6 → 176,7 |
<param-name>MailAliasModifiedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<init-param> |
172,6 → 183,7 |
<param-name>MailAliasDeletedListener</param-name> |
<param-value> |
ak.hostadmiral.core.listener.dummy.DummyListener; |
ak.hostadmiral.core.listener.file.FileListener; |
</param-value> |
</init-param> |
<load-on-startup>1</load-on-startup> |
/hostadmiral/trunk/webapp/domain/list.jsp |
---|
60,7 → 60,7 |
</td> |
<td> |
<core:deleteable name="domain"> |
<backpath:link action="/domain/delete" paramId="id" paramName="domain" paramProperty="id"><bean:message key="ak.hostadmiral.page.domain.list.delete" /></backpath:link> |
<backpath:link action="/domain/deleting" paramId="id" paramName="domain" paramProperty="id"><bean:message key="ak.hostadmiral.page.domain.list.delete" /></backpath:link> |
</core:deleteable> |
<core:notDeleteable name="domain"> |
|