10,7 → 10,7 |
|
import org.apache.log4j.Logger; |
|
public class FileListener |
public class FileListener |
implements |
UserCreatedListener, |
UserModifiedListener, |
29,7 → 29,7 |
MailAliasDeletedListener |
{ |
private static final Logger logger = Logger.getLogger(FileListener.class); |
|
|
private static String fileName; |
protected static Object lock = new Object(); |
|
86,88 → 86,88 |
//=== user ==================================================================================== |
|
public void userCreated(User editor, User user) |
throws ModelException |
{ |
throws ModelException |
{ |
send("user\tcreate\t" + escape(user.getLogin()) + "\t" |
+ escape(/* FIXME user.getPassword() */ "") + "\t" |
+ user.getEnabled() + "\t" |
+ escape(user.getComment())); |
+ escape(user.getComment())); |
} |
|
|
public void userModified(User editor, User user, User oldUser) |
throws ModelException |
{ |
throws ModelException |
{ |
send("user\tmodify\t" + escape(oldUser.getLogin()) + "\t" |
+ escape(user.getLogin()) + "\t" |
+ escape(/* FIXME user.getPassword() */ "") + "\t" |
+ user.getEnabled() + "\t" |
+ escape(user.getComment())); |
+ escape(user.getComment())); |
} |
|
|
public void userDeleted(User editor, User user) |
throws ModelException |
{ |
send("user\tdelete\t" + escape(user.getLogin())); |
throws ModelException |
{ |
send("user\tdelete\t" + escape(user.getLogin())); |
} |
|
//=== inet domain ============================================================================= |
|
public void inetDomainCreated(User editor, InetDomain domain) |
throws ModelException |
{ |
throws ModelException |
{ |
send("inetDomain\tcreate\t" + escape(domain.getName()) + "\t" |
+ domain.getEnabled() + "\t" |
+ escape(domain.getComment())); |
+ escape(domain.getComment())); |
} |
|
|
public void inetDomainModified(User editor, InetDomain domain, InetDomain oldDomain) |
throws ModelException |
{ |
throws ModelException |
{ |
send("inetDomain\tmodify\t" + escape(oldDomain.getName()) + "\t" |
+ escape(domain.getName()) + "\t" |
+ domain.getEnabled() + "\t" |
+ escape(domain.getComment())); |
+ escape(domain.getComment())); |
} |
|
|
public void inetDomainDeleted(User editor, InetDomain domain) |
throws ModelException |
{ |
send("inetDomain\tdelete\t" + escape(domain.getName())); |
throws ModelException |
{ |
send("inetDomain\tdelete\t" + escape(domain.getName())); |
} |
|
//=== system user ============================================================================= |
|
public void systemUserCreated(User editor, SystemUser systemUser) |
throws ModelException |
{ |
throws ModelException |
{ |
send("systemUser\tcreate\t" + systemUser.getUid() + "\t" |
+ escape(systemUser.getName()) + "\t" |
+ systemUser.getEnabled() + "\t" |
+ escape(systemUser.getComment())); |
+ escape(systemUser.getComment())); |
} |
|
|
public void systemUserModified(User editor, SystemUser systemUser, SystemUser oldSystemUser) |
throws ModelException |
{ |
throws ModelException |
{ |
send("systemUser\tmodify\t" + oldSystemUser.getUid() + "\t" |
+ escape(oldSystemUser.getName()) + "\t" |
+ systemUser.getUid() + "\t" |
+ escape(systemUser.getName()) + "\t" |
+ systemUser.getEnabled() + "\t" |
+ escape(systemUser.getComment())); |
+ escape(systemUser.getComment())); |
} |
|
|
public void systemUserDeleted(User editor, SystemUser systemUser) |
throws ModelException |
{ |
send("systemUser\tdelete\t" + systemUser.getUid() + "\t" + escape(systemUser.getName())); |
throws ModelException |
{ |
send("systemUser\tdelete\t" + systemUser.getUid() + "\t" + escape(systemUser.getName())); |
} |
|
//=== mailbox ================================================================================= |
|
public void mailboxCreated(User editor, Mailbox mailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
send("mailbox\tcreate\t" + escape(mailbox.getLogin()) + "\t" |
+ escape(/* FIXME user.getPassword() */ "") + "\t" |
+ escape(mailbox.getDomain().getName()) + "\t" |
176,12 → 176,12 |
+ (mailbox.getSystemUser() == null ? "" : mailbox.getSystemUser().getUid().toString()) |
+ "\t" |
+ mailbox.getEnabled() + "\t" |
+ escape(mailbox.getComment())); |
+ escape(mailbox.getComment())); |
} |
|
|
public void mailboxModified(User editor, Mailbox mailbox, Mailbox oldMailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
send("mailbox\tmodify\t" + escape(oldMailbox.getLogin()) + "\t" |
+ escape(oldMailbox.getDomain().getName()) + "\t" |
+ escape(mailbox.getLogin()) + "\t" |
192,20 → 192,20 |
+ (mailbox.getSystemUser() == null ? "" : mailbox.getSystemUser().getUid().toString()) |
+ "\t" |
+ mailbox.getEnabled() + "\t" |
+ escape(mailbox.getComment())); |
+ escape(mailbox.getComment())); |
} |
|
|
public void mailboxDeleted(User editor, Mailbox mailbox) |
throws ModelException |
{ |
throws ModelException |
{ |
send("mailbox\tdelete\t" + escape(mailbox.getLogin()) + "\t" |
+ escape(mailbox.getDomain().getName())); |
+ escape(mailbox.getDomain().getName())); |
} |
|
//=== mail alias ============================================================================== |
|
private String formMailAliasDestinations(User editor, MailAlias mailAlias) |
throws ModelException |
throws ModelException |
{ |
StringBuffer b = new StringBuffer(); |
|
225,18 → 225,18 |
} |
|
public void mailAliasCreated(User editor, MailAlias mailAlias) |
throws ModelException |
throws ModelException |
{ |
send(" mailAlias\tcreate\t" + escape(mailAlias.getAddress()) + "\t" |
+ escape(mailAlias.getDomain().getName()) + "\t" |
+ mailAlias.getEnabled() + "\t" |
+ escape(mailAlias.getComment()) |
+ formMailAliasDestinations(editor, mailAlias)); |
+ formMailAliasDestinations(editor, mailAlias)); |
} |
|
|
public void mailAliasModified(User editor, MailAlias mailAlias, MailAlias oldMailAlias) |
throws ModelException |
{ |
throws ModelException |
{ |
send(" mailAlias\tmodify\t" + escape(oldMailAlias.getAddress()) + "\t" |
+ escape(oldMailAlias.getDomain().getName()) + "\t" |
+ escape(mailAlias.getAddress()) + "\t" |
243,13 → 243,13 |
+ escape(mailAlias.getDomain().getName()) + "\t" |
+ mailAlias.getEnabled() + "\t" |
+ escape(mailAlias.getComment()) |
+ formMailAliasDestinations(editor, mailAlias)); |
+ formMailAliasDestinations(editor, mailAlias)); |
} |
|
|
public void mailAliasDeleted(User editor, MailAlias mailAlias) |
throws ModelException |
{ |
throws ModelException |
{ |
send(" mailAlias\tdelete\t" + escape(mailAlias.getAddress())+ "\t" |
+ escape(mailAlias.getDomain().getName())); |
+ escape(mailAlias.getDomain().getName())); |
} |
} |