protected boolean validateChallenge(PortletRequest portletRequest)
throws CaptchaException {
PortletSession portletSession = portletRequest.getPortletSession();
String captchaText = (String)portletSession.getAttribute(
WebKeys.CAPTCHA_TEXT);
if (captchaText == null) {
_log.error(
"Captcha text is null. User " + portletRequest.getRemoteUser() +
" may be trying to circumvent the captcha.");
throw new CaptchaTextException();
}
boolean valid = captchaText.equals(
ParamUtil.getString(portletRequest, "captchaText"));
if (valid) {
portletSession.removeAttribute(WebKeys.CAPTCHA_TEXT);
}
return valid;
}
SimpleCaptchaImpl.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:edemocracia
作者:
评论列表
文章目录