gender = "m";
} else {
institution = "yourinst";
gender = "f";
}
User user = UserManager.getInstance().createUser(username + "first", username + "last", username + "@test.test");
user.setProperty(UserConstants.GENDER, gender);
user.setProperty(UserConstants.BIRTHDAY, "24.07.3007");
user.setProperty(UserConstants.STREET, "Zähringerstrasse 26");
user.setProperty(UserConstants.EXTENDEDADDRESS, null);
user.setProperty(UserConstants.POBOX, null);
user.setProperty(UserConstants.CITY, "Zürich");
user.setProperty(UserConstants.COUNTRY, "Switzerland");
user.setProperty(UserConstants.TELMOBILE, "123456789");
user.setProperty(UserConstants.TELOFFICE, "123456789");
user.setProperty(UserConstants.TELPRIVATE, "123456789");
user.setProperty(UserConstants.INSTITUTIONALEMAIL, username + "@" + institution);
user.setProperty(UserConstants.INSTITUTIONALNAME, institution);
user.setProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, username + "-" + institution);
AuthHelper.createAndPersistIdentityAndUserWithUserGroup(username, "hokuspokus", user);
if (i % 10 == 0) {
// flush now to obtimize performance
DBFactory.getInstance().closeSession();