Package org.encuestame.utils.captcha

Examples of org.encuestame.utils.captcha.ReCaptchaResponse


        log.info("result erros  " + result.getAllErrors().size());
        log.info("result erros  " + result.getErrorCount());
        final String email = user.getEmail() == null ? "" : user.getEmail();
        if (!email.isEmpty()) {
                log.debug("email " + email);
                final ReCaptchaResponse reCaptchaResponse = getReCaptcha().checkAnswer(
                        req.getRemoteAddr(), challenge, response);
                final ValidateOperations validation = new ValidateOperations(
                        getSecurityService());
                boolean _isValidEmailFormat = validation.validateEmail(email);
                log.info("EMAIL FORMAT NOT VALID --> " + _isValidEmailFormat);
                if (_isValidEmailFormat) {
                     final UserAccount userValidate = validation.checkifEmailExist(email);
                     if (userValidate == null) {
                         result.rejectValue("email", "secure.email.notvalid", new Object[] { user.getEmail() }, "");
                     }
                     log.info("reCaptchaResponse " + reCaptchaResponse.isValid());
                     //validate reCaptcha
                     validation.validateCaptcha(reCaptchaResponse, result);
                     if(reCaptchaResponse.getErrorMessage() != null) {
                         RequestSessionMap.getCurrent(req).put("resetError", Boolean.TRUE);
                         RequestSessionMap.getCurrent(req).put("resetErrorMessage", reCaptchaResponse.getErrorMessage());
                         log.fatal("reCaptcha Fatal Error: "+reCaptchaResponse.getErrorMessage());
                     }
                    log.info("result.hasErrors() " + result.hasErrors());
                    if (result.hasErrors()) {
                        return "forgot";
                    } else {
View Full Code Here


             log.info("vote2--> "+vote.toString());
             final String IP = getIpClient(req);
             //security service
             final SecurityOperations securityService = getServiceManager().getApplicationServices().getSecurityService();
             //check if captcha is valid
             final ReCaptchaResponse reCaptchaResponse = getReCaptcha().checkAnswer(req.getRemoteAddr(), challenge, response);
             //validation layer
             final ValidateOperations validation = new ValidateOperations(securityService);
             validation.validateCaptcha(reCaptchaResponse, result);
             log.info("reCaptchaResponse "+reCaptchaResponse.getErrorMessage());
             log.info("reCaptchaResponse "+reCaptchaResponse.isValid());
             log.info("result.hasErrors() "+result.hasErrors());
             if (result.hasErrors()) {
                //build new reCAPTCHA
                final String errMsg = reCaptchaResponse.getErrorMessage();
                final String html = getReCaptcha().createRecaptchaHtml(errMsg, null);
                vote.setCaptcha(html);
                vote.setCodeVote(code);
                model.addAttribute("captchaForm", vote);
                result.reject("form.problems");
View Full Code Here

TOP

Related Classes of org.encuestame.utils.captcha.ReCaptchaResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.