long[] userGroupIds = new long[] {};
ServiceContext serviceContext = new ServiceContext();
// Add the user to the Liferay database (create an account).
User user = UserLocalServiceUtil.addUser(creatorUserId, companyId, autoPassword, password1, password2,
autoScreenName, screenName, emailAddress, facebookId, openId, locale, firstName, middleName, lastName,
prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
roleIds, userGroupIds, sendEmail, serviceContext);
registrant.setUserId(user.getUserId());
registrant.setContactId(user.getContactId());
// Disable the ability to login until someone approves the account.
if (!active) {
UserLocalServiceUtil.updateStatus(user.getUserId(), user.getStatus());
}
// Add mobile phone.
updateMobilePhone(creatorUserId, companyId, registrant);