Java Code Examples for com.zhazhapan.util.Checker#isEmail()

The following examples show how to use com.zhazhapan.util.Checker#isEmail() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UserServiceImpl.java    From efo with MIT License 5 votes vote down vote up
@Override
public boolean register(String username, String email, String password) {
    boolean allowRegister = settings.getBooleanUseEval(ConfigConsts.ALLOW_REGISTER_OF_SETTINGS);
    if (allowRegister) {
        boolean isValid = Checker.isEmail(email) && checkPassword(password) && Pattern.compile(settings
                .getStringUseEval(ConfigConsts.USERNAME_PATTERN_OF_SETTINGS)).matcher(username).matches();
        if (isValid) {
            User user = new User(username, ValueConsts.EMPTY_STRING, email, password);
            int[] auth = SettingConfig.getAuth(ConfigConsts.USER_DEFAULT_AUTH_OF_SETTING);
            user.setAuth(auth[0], auth[1], auth[2], auth[3], auth[4]);
            return userDAO.insertUser(user);
        }
    }
    return false;
}
 
Example 2
Source File: UserServiceImpl.java    From efo with MIT License 4 votes vote down vote up
@Override
public boolean resetPasswordByEmail(String email, String password) {
    return Checker.isEmail(email) && checkPassword(password) && userDAO.updatePasswordByEmail(password, email);
}
 
Example 3
Source File: UserServiceImpl.java    From efo with MIT License 4 votes vote down vote up
@Override
public boolean emailExists(String email) {
    return Checker.isEmail(email) && userDAO.checkEmail(email) > 0;
}
 
Example 4
Source File: UserServiceImpl.java    From efo with MIT License 4 votes vote down vote up
@Override
public boolean updateBasicInfoById(int id, String avatar, String realName, String email) {
    return Checker.isEmail(email) && userDAO.updateBasicInfo(id, Checker.checkNull(avatar), Checker.checkNull
            (realName), email);
}