/**
* if enabled in the configuration some testusers for IM are created in the
* database. It has nothing to do with accounts on the jabber server itself.
*/
private void checkAndCreateTestUsers() {
Identity identity;
Authentication auth;
Manager securityManager = ManagerFactory.getManager();
identity = securityManager.findIdentityByName("author");
auth = ManagerFactory.getManager().findAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING);
if (auth == null) { // create new authentication for provider
ManagerFactory.getManager().createAndPersistAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING, identity.getName(),
"test");
InstantMessagingModule.getAdapter().createAccount("author", "test", "Aurich Throw", "author@olat-newinstallation.org");
}
identity = securityManager.findIdentityByName("administrator");
auth = ManagerFactory.getManager().findAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING);
if (auth == null) { // create new authentication for provider
ManagerFactory.getManager().createAndPersistAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING, identity.getName(),
"olat");
InstantMessagingModule.getAdapter().createAccount("administrator", "olat", "Administrator", "administrator@olat-newinstallation.org");
}
identity = securityManager.findIdentityByName("learner");
auth = ManagerFactory.getManager().findAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING);
if (auth == null) { // create new authentication for provider
ManagerFactory.getManager().createAndPersistAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING, identity.getName(),
"test");
InstantMessagingModule.getAdapter().createAccount("learner", "test", "Leise Arnerich", "learner@olat-newinstallation.org");
}
identity = securityManager.findIdentityByName("test");
auth = ManagerFactory.getManager().findAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING);
if (auth == null) { // create new authentication for provider
ManagerFactory.getManager().createAndPersistAuthentication(identity, ClientManager.PROVIDER_INSTANT_MESSAGING, identity.getName(),
"test");
InstantMessagingModule.getAdapter().createAccount("test", "test", "Thomas Est", "test@olat-newinstallation.org");
}
}