Skip to content
OSGI modules para usar reCAPTCHA v3 en Liferay 7.3
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
modules/com.miguelangeljulvez.recaptcha
.gitignore
README.markdown
build.gradle
gradlew
gradlew.bat
settings.gradle

README.markdown

Recaptcha V3

Este module configura Liferay 7.3 con una nueva opción para poder usar reCAPTCHAv3

##Para compilar:

./gradlew clean build

##Instalación

  • Copiar con el tomcat parado com.miguelangeljulvez.recaptcha/recaptcha-api/build/libs/com.liferay.captcha.api.jar a bundles/osgi/marketplace/override/ y borrar bundles/osgi/state/
  • Copiar com.miguelangeljulvez.recaptcha/recaptcha-impl/build/libs/com.miguelangeljulvez.recaptcha.impl.jar a bundles/osgi/modules/
  • Copiar com.miguelangeljulvez.recaptcha/recaptcha-taglbi/build/libs/com.miguelangeljulvez.recaptcha.taglib.jar a bundles/osgi/modules/

##Uso del taglib en los jsp

<%@ taglib prefix="maj" uri="http://miguelangeljulvez.com/tld/recaptcha" %>
...
<liferay-ui:error exception="<%= CaptchaTextException.class %>" message="text-verification-failed" />
<liferay-ui:error exception="<%= CaptchaConfigurationException.class %>" message="a-captcha-error-occurred-please-contact-an-administrator" />
<liferay-ui:error exception="<%= CaptchaException.class %>" message="a-captcha-error-occurred-please-contact-an-administrator" />
...
<aui:form>
...
<maj:recaptchaV3 action="<NombreDeLaAcción>" />
...
</aui:form>

##Validación del taglib en el portlet

try {
    CaptchaUtil.check(actionRequest);
} catch (CaptchaConfigurationException e) {
    e.printStackTrace();
    SessionErrors.add(actionRequest, CaptchaConfigurationException.class.getName());
    return;
} catch (CaptchaTextException e) {
    e.printStackTrace();
    SessionErrors.add(actionRequest, CaptchaTextException.class.getName());
    return;
} catch (CaptchaException e) {
    e.printStackTrace();
    SessionErrors.add(actionRequest, CaptchaException.class.getName());
    return;
}

Más información en: https://www.miguelangeljulvez.com

You can’t perform that action at this time.