Class CaptchaSecurityService
- java.lang.Object
-
- fr.paris.lutece.portal.service.captcha.CaptchaSecurityService
-
- All Implemented Interfaces:
ICaptchaSecurityService
public class CaptchaSecurityService extends java.lang.Object implements ICaptchaSecurityService
Default captcha security service implementation
-
-
Field Summary
-
Fields inherited from interface fr.paris.lutece.portal.service.captcha.ICaptchaSecurityService
EMPTY_STRING
-
-
Constructor Summary
Constructors Constructor Description CaptchaSecurityService()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetActiveBlockHtml()java.lang.StringgetHtmlCode()Return an EMPTY_STRING if service is not available nor activebooleanisActive()booleanisAvailable()voidsetActive(boolean isActive)Activate the service for the current clientbooleanvalidate(javax.servlet.http.HttpServletRequest request)Validates a captcha only if the service is available and active
-
-
-
Method Detail
-
getActiveBlockHtml
public java.lang.String getActiveBlockHtml()
- Specified by:
getActiveBlockHtmlin interfaceICaptchaSecurityService- Returns:
- the html code used by an admin to activate the captcha
-
getHtmlCode
public java.lang.String getHtmlCode()
Return an EMPTY_STRING if service is not available nor active- Specified by:
getHtmlCodein interfaceICaptchaSecurityService- Returns:
- the html code of a captcha
-
setActive
public void setActive(boolean isActive)
Activate the service for the current client- Specified by:
setActivein interfaceICaptchaSecurityService- Parameters:
isActive- True to activate, otherwise false
-
validate
public boolean validate(javax.servlet.http.HttpServletRequest request)
Validates a captcha only if the service is available and active- Specified by:
validatein interfaceICaptchaSecurityService- Parameters:
request- the request, which must contain the parameter j_captcha_response- Returns:
- true if captcha is valid or service is not available
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceICaptchaSecurityService- Returns:
- true if the service is active for the current client
-
isAvailable
public boolean isAvailable()
- Specified by:
isAvailablein interfaceICaptchaSecurityService- Returns:
- true if a captcha security service is loaded
-
-