23,6 → 23,7 |
InetDomainDeletingListener |
{ |
private MailboxStore store; |
private Class[] passwordStores; |
|
private Collection createdListeners = new ArrayList(); |
private Collection modifiedListeners = new ArrayList(); |
44,12 → 45,8 |
if(!allowedToCreate(editor)) throw new ModelSecurityException(); |
|
Mailbox mailbox = new Mailbox(); |
setMailboxPasswordStores(mailbox); |
|
// FIXME: make this configurable |
mailbox.addPasswordStore(new PasswordStoreMd5()); |
mailbox.addPasswordStore(new PasswordStoreCrypt()); |
mailbox.addPasswordStore(new PasswordStorePlain()); |
|
return mailbox; |
} |
|
315,6 → 312,20 |
return cascade; |
} |
|
protected void setMailboxPasswordStores(Mailbox mailbox) |
throws ModelException |
{ |
if(passwordStores == null) return; |
|
try { |
for(int i = 0; i < passwordStores.length; i++) |
mailbox.addPasswordStore((PasswordStore)passwordStores[i].newInstance()); |
} |
catch(Exception ex) { |
throw new ModelException(ex); |
} |
} |
|
public static final Integer SORT_LOGIN = new Integer(1); |
public static final Integer SORT_DOMAIN = new Integer(2); |
|
381,8 → 392,16 |
try { |
mailboxManager = this; |
|
Class c = Class.forName((String)params.get("store")); |
Class c = Class.forName(((String[])params.get("store"))[0]); |
store = (MailboxStore)c.newInstance(); |
|
String[] passwordStoreNames = (String[])params.get("passwordStore"); |
if(passwordStoreNames != null) { |
passwordStores = new Class[passwordStoreNames.length]; |
for(int i = 0; i < passwordStoreNames.length; i++) { |
passwordStores[i] = Class.forName(passwordStoreNames[i]); |
} |
} |
} |
catch(Exception ex) { |
throw new ModelException(ex); |