Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/java/fr/paris/lutece/plugins/contact/web/ContactApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import fr.paris.lutece.portal.service.security.LuteceUser;
import fr.paris.lutece.portal.service.security.SecurityService;
import fr.paris.lutece.portal.service.template.AppTemplateService;
import fr.paris.lutece.portal.service.util.AppPropertiesService;
import fr.paris.lutece.portal.service.util.BeanUtils;
import fr.paris.lutece.portal.util.mvc.commons.annotations.Action;
import fr.paris.lutece.portal.util.mvc.commons.annotations.View;
Expand Down Expand Up @@ -140,6 +141,7 @@ public class ContactApp extends MVCApplication
private static final String PROPERTY_LIST_NOT_EXISTS = "contact.message_contact.listNotExists";
private static final String PROPERTY_NOT_AUTHORIZED = "contact.message_contact.notauthorized";
private static final String PROPERTY_NO_LIST_VISIBLE = "contact.message_contact.noListVisible";
private static final String PROPERTY_CAPTCHA_ENABLED = "contact.captcha.enabled";
private static final String CAPTCHA_PLUGIN = "captcha";
private static final String EMPTY_STRING = "";
private static final String ACTION_SEND_MESSAGE = "actionSendMessage";
Expand Down Expand Up @@ -201,7 +203,7 @@ public XPage getForm( HttpServletRequest request ) throws SiteMessageException

model.put( MARK_PORTAL_URL, strPortalUrl );

boolean bIsCaptchaEnabled = PluginService.isPluginEnable( CAPTCHA_PLUGIN );
boolean bIsCaptchaEnabled = PluginService.isPluginEnable( CAPTCHA_PLUGIN ) && AppPropertiesService.getPropertyBoolean( PROPERTY_CAPTCHA_ENABLED, true );
model.put( MARK_IS_ACTIVE_CAPTCHA, bIsCaptchaEnabled );

if ( bIsCaptchaEnabled )
Expand Down Expand Up @@ -426,7 +428,8 @@ public XPage doSendMessage( HttpServletRequest request ) throws SiteMessageExcep
}

// test the captcha
if ( PluginService.isPluginEnable( CAPTCHA_PLUGIN ) )
boolean bIsCaptchaEnabled = PluginService.isPluginEnable( CAPTCHA_PLUGIN ) && AppPropertiesService.getPropertyBoolean( PROPERTY_CAPTCHA_ENABLED, true );
if ( bIsCaptchaEnabled )
{

boolean isValid = _captchaService.isResolvable( ) ? _captchaService.get( ).validate( request ) : false;
Expand Down
2 changes: 2 additions & 0 deletions webapp/WEB-INF/conf/plugins/contact.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ contact.listContacts.itemsPerPage=50
contact.pageTitle=Contact
contact.pagePathLabel=Contact

contact.captcha.enabled=true