use of com.liferay.portal.UserSmsException in project liferay-ide by liferay.
the class UserLocalServiceImpl method validate.
protected void validate(long userId, String screenName, String emailAddress, String openId, String firstName, String middleName, String lastName, String smsSn) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
if (!StringUtil.equalsIgnoreCase(user.getScreenName(), screenName)) {
validateScreenName(user.getCompanyId(), userId, screenName);
}
validateEmailAddress(user.getCompanyId(), emailAddress);
validateOpenId(user.getCompanyId(), userId, openId);
if (!user.isDefaultUser()) {
if (Validator.isNotNull(emailAddress) && !StringUtil.equalsIgnoreCase(user.getEmailAddress(), emailAddress)) {
if (userPersistence.fetchByC_EA(user.getCompanyId(), emailAddress) != null) {
throw new DuplicateUserEmailAddressException("{userId=" + userId + "}");
}
}
validateFullName(user.getCompanyId(), firstName, middleName, lastName);
}
if (Validator.isNotNull(smsSn) && !Validator.isEmailAddress(smsSn)) {
throw new UserSmsException();
}
}
Aggregations