Skip to content

Instantly share code, notes, and snippets.

@amusarra
Last active August 29, 2015 14:24
Show Gist options
  • Save amusarra/55b971f083251cbc0f2f to your computer and use it in GitHub Desktop.
Save amusarra/55b971f083251cbc0f2f to your computer and use it in GitHub Desktop.
Hook recaptcha theme
##
## Captcha
##
#
# reCAPTCHA
#
#
# Configuration thema reCaptcha for siteid
# You can see the use of the configuration parameter on
# html\taglib\ui\captcha\recaptcha.jsp
#
captcha.engine.recaptcha.theme[11905]=clean
captcha.engine.recaptcha.theme[10182]=white
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ include file="/html/taglib/ui/captcha/init.jsp" %>
<noscript>
<iframe frameborder="0" height="300" src="<%= HttpUtil.protocolize(PropsValues.CAPTCHA_ENGINE_RECAPTCHA_URL_NOSCRIPT, request.isSecure()) %><%= PrefsPropsUtil.getString(PropsKeys.CAPTCHA_ENGINE_RECAPTCHA_KEY_PUBLIC, PropsValues.CAPTCHA_ENGINE_RECAPTCHA_KEY_PUBLIC) %>" width="500"></iframe><br />
<textarea cols="40" name="recaptcha_challenge_field" rows="3"></textarea>
<input name="recaptcha_response_field" type="hidden" value="manual_challenge" />
</noscript>
<aui:script position="inline">
var RecaptchaOptions = {
lang : '<%= locale.getLanguage() %>',
theme : '<%=(Validator.isNotNull(PropsUtil.get("captcha.engine.recaptcha.theme", new Filter(Long.toString(themeDisplay.getScopeGroupId()))))) ? PropsUtil.get("captcha.engine.recaptcha.theme", new Filter(Long.toString(themeDisplay.getScopeGroupId()))) : "white" %>'
};
</aui:script>
<script src="<%= HttpUtil.protocolize(PropsValues.CAPTCHA_ENGINE_RECAPTCHA_URL_SCRIPT, request.isSecure()) %><%= PrefsPropsUtil.getString(PropsKeys.CAPTCHA_ENGINE_RECAPTCHA_KEY_PUBLIC, PropsValues.CAPTCHA_ENGINE_RECAPTCHA_KEY_PUBLIC) %>" type="text/javascript"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment