Package com.dotcms.repackage.com.octo.captcha.service.sound

Examples of com.dotcms.repackage.com.octo.captcha.service.sound.SoundCaptchaService


      isResponseCorrect = Boolean.TRUE;
      session.removeAttribute(Captcha.NAME);
     
    }else if(UtilMethods.isSet(audioCaptcha) && UtilMethods.isSet(captchaId)){

      SoundCaptchaService soundCaptchaService = (SoundCaptchaService)session.getAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE);
     
      try {
        isResponseCorrect = soundCaptchaService.validateResponseForID(captchaId, audioCaptcha);
   
      } catch (CaptchaServiceException e) {
        Logger.error(CaptchaUtil.class, "An error ocurred trying to validate audio captcha", e);
      }
    }
View Full Code Here


        //the same id must be used to validate the response, the session id is a good candidate!
        //Look for the captcha parameter from the session if it's null create a new audio challenge  
        String captchaId = request.getSession().getId();
        //challenge = CaptchaServiceSingleton.getInstance().getSoundChallengeForID(captchaId);
       
        SoundCaptchaService soundCaptchaService = new DefaultManageableSoundCaptchaService();
        challenge = soundCaptchaService.getSoundChallengeForID(captchaId);
        request.getSession().setAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE, soundCaptchaService);
      }

      AudioSystem.write(challenge, AudioFileFormat.Type.WAVE, soundOutputStream);
      soundOutputStream.flush();
View Full Code Here

   
    if(UtilMethods.isSet(audioCaptcha) && UtilMethods.isSet(captchaId)){
      try {
        //isResponseCorrect = CaptchaServiceSingleton.getInstance().validateResponseForID(captchaId, audioCaptcha);
       
        SoundCaptchaService soundCaptchaService = (SoundCaptchaService) request.getSession().getAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE);
        isResponseCorrect = soundCaptchaService.validateResponseForID(captchaId, audioCaptcha);
        request.getSession().removeAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE);
      } catch (CaptchaServiceException e) {
        Logger.error(CaptchaUtil.class, "An error ocurred trying to validate audio captcha", e);
      }
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.com.octo.captcha.service.sound.SoundCaptchaService

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.