/hostadmiral/trunk/src/ak/hostadmiral/core/model/UserManager.java |
---|
22,6 → 22,7 |
{ |
private UserStore store; |
private UserValidator userValidator; |
private Class[] passwordStores; |
private Collection createdListeners = new ArrayList(); |
private Collection modifiedListeners = new ArrayList(); |
45,14 → 46,10 |
User user = new User(); |
if(!user.mayChangeBoss(editor)) { // ordinal user can create only own "subusers" |
if(!user.mayChangeBoss(editor)) // ordinal user can create only own "subusers" |
user.setBoss(editor); |
} |
// FIXME: make this configurable |
user.addPasswordStore(new PasswordStoreMd5()); |
user.addPasswordStore(new PasswordStoreCrypt()); |
user.addPasswordStore(new PasswordStorePlain()); |
setUserPasswordStores(user); |
return user; |
} |
315,6 → 312,20 |
} |
} |
protected void setUserPasswordStores(User user) |
throws ModelException |
{ |
if(passwordStores == null) return; |
try { |
for(int i = 0; i < passwordStores.length; i++) |
user.addPasswordStore((PasswordStore)passwordStores[i].newInstance()); |
} |
catch(Exception ex) { |
throw new ModelException(ex); |
} |
} |
public static final Integer SORT_LOGIN = new Integer(1); |
public static final Comparator LOGIN_COMPARATOR = new LoginComparator(); |
380,15 → 391,23 |
try { |
userManager = this; |
Class c = Class.forName((String)params.get("store")); |
Class c = Class.forName(((String[])params.get("store"))[0]); |
store = (UserStore)c.newInstance(); |
String userValidatorName = (String)params.get("userValidator"); |
String[] userValidatorName = (String[])params.get("userValidator"); |
if(userValidatorName != null) { |
Class c2 = Class.forName(userValidatorName); |
Class c2 = Class.forName(userValidatorName[0]); |
userValidator = (UserValidator)c2.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); |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/InetDomainManager.java |
---|
294,7 → 294,7 |
try { |
inetDomainManager = this; |
Class c = Class.forName((String)params.get("store")); |
Class c = Class.forName(((String[])params.get("store"))[0]); |
store = (InetDomainStore)c.newInstance(); |
} |
catch(Exception ex) { |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailboxManager.java |
---|
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,9 → 392,17 |
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); |
} |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/SystemUserManager.java |
---|
339,7 → 339,7 |
try { |
systemUserManager = this; |
Class c = Class.forName((String)params.get("store")); |
Class c = Class.forName(((String[])params.get("store"))[0]); |
store = (SystemUserStore)c.newInstance(); |
} |
catch(Exception ex) { |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAliasManager.java |
---|
326,7 → 326,7 |
try { |
mailAliasManager = this; |
Class c = Class.forName((String)params.get("store")); |
Class c = Class.forName(((String[])params.get("store"))[0]); |
store = (MailAliasStore)c.newInstance(); |
} |
catch(Exception ex) { |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAliasDestinationManager.java |
---|
119,7 → 119,7 |
try { |
mailAliasDestinationManager = this; |
Class c = Class.forName((String)params.get("store")); |
Class c = Class.forName(((String[])params.get("store"))[0]); |
store = (MailAliasDestinationStore)c.newInstance(); |
} |
catch(Exception ex) { |