UserLocalManagerUtil.getDefaultUser(companyId);
locale = defaultUser.getLocale();
}
Captcha captcha = null;
if (GetterUtil.getBoolean(
PropsUtil.get(PropsUtil.CAPTCHA_CHALLENGE)) &&
(config.getPortletName().equals(PortletKeys.MY_ACCOUNT))) {
captcha = (Captcha)ses.getAttribute(
WebKeys.CAPTCHA, PortletSession.APPLICATION_SCOPE);
Boolean validResponse = captcha.validateResponse(
ParamUtil.getString(req, "captcha_response"));
if ((validResponse == null) ||
(validResponse.equals(Boolean.FALSE))) {
ses.removeAttribute(
WebKeys.CAPTCHA, PortletSession.APPLICATION_SCOPE);
throw new CaptchaException();
}
}
UserManagerUtil.addUser(
companyId, autoUserId, userId, autoPassword, password1,
password2, passwordReset, firstName, middleName, lastName,
nickName, male,
new GregorianCalendar(bdYear, bdMonth, bdDay).getTime(),
emailAddress, locale);
if (captcha != null) {
captcha.disposeChallenge();
ses.removeAttribute(
WebKeys.CAPTCHA, PortletSession.APPLICATION_SCOPE);
}