}
}
// Create transient user without firstName,lastName, email
UserManager um = UserManager.getInstance();
User newUser = um.createUser(null, null, null);
List<UserPropertyHandler> userProperties = userPropertyHandlers;
int col = 4;
String thisValue = "", stringValue;
for (UserPropertyHandler userPropertyHandler : userProperties) {
thisValue = singleUser.get(col);
stringValue = userPropertyHandler.getStringValue(thisValue, getLocale());
userPropertyHandler.setUserProperty(newUser, stringValue);
col++;
}
// Init preferences
newUser.getPreferences().setLanguage(lang);
newUser.getPreferences().setInformSessionTimeout(true);
// Save everything in database
Identity ident = AuthHelper.createAndPersistIdentityAndUserWithUserGroup(login, pwd, newUser);
return ident;
}