Class CaptchaSecurityService
java.lang.Object
fr.paris.lutece.portal.service.captcha.CaptchaSecurityService
- All Implemented Interfaces:
ICaptchaSecurityService
@Deprecated(since="8.0",
forRemoval=true)
public class CaptchaSecurityService
extends Object
implements ICaptchaSecurityService
Deprecated, for removal: This API element is subject to removal in a future version.
Legacy implementation providing access to the
ICaptchaService.
This class is deprecated and will be removed in a future release.
It was originally responsible for managing access to the ICaptchaService.
The recommended approach is now to use CDI dependency injection to obtain
the ICaptchaService directly, instead of instantiating or referencing this class.
Example of recommended usage:
@Inject
@Named(BeanUtils.BEAN_CAPTCHA_SERVICE)
private Instance<ICaptchaService> _captchaService;
-
Field Summary
Fields inherited from interface fr.paris.lutece.portal.service.captcha.ICaptchaSecurityService
EMPTY_STRING -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Return an EMPTY_STRING if service is not available nor activebooleanisActive()Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.voidsetActive(boolean isActive) Deprecated, for removal: This API element is subject to removal in a future version.Activate the service for the current clientbooleanvalidate(jakarta.servlet.http.HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.Validates a captcha only if the service is available and active
-
Constructor Details
-
CaptchaSecurityService
public CaptchaSecurityService()Deprecated, for removal: This API element is subject to removal in a future version.Default constructor. Gets the captchaValidator from the captcha plugin. If the validator is missing, sets available to false;
-
-
Method Details
-
getActiveBlockHtml
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getActiveBlockHtmlin interfaceICaptchaSecurityService- Returns:
- the html code used by an admin to activate the captcha
-
getHtmlCode
Deprecated, for removal: This API element is subject to removal in a future version.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) Deprecated, for removal: This API element is subject to removal in a future version.Activate the service for the current client- Specified by:
setActivein interfaceICaptchaSecurityService- Parameters:
isActive- True to activate, otherwise false
-
validate
public boolean validate(jakarta.servlet.http.HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.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()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isActivein interfaceICaptchaSecurityService- Returns:
- true if the service is active for the current client
-
isAvailable
public boolean isAvailable()Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isAvailablein interfaceICaptchaSecurityService- Returns:
- true if a captcha security service is loaded
-
ICaptchaServicebean instead.