Search in sources :

Example 1 with UserSmsException

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();
    }
}
Also used : UserSmsException(com.liferay.portal.UserSmsException) User(com.liferay.portal.model.User) DuplicateUserEmailAddressException(com.liferay.portal.DuplicateUserEmailAddressException)

Aggregations

DuplicateUserEmailAddressException (com.liferay.portal.DuplicateUserEmailAddressException)1 UserSmsException (com.liferay.portal.UserSmsException)1 User (com.liferay.portal.model.User)1