Changeset 3694 in products


Ignore:
Timestamp:
Jul 4, 2013 10:30:59 AM (11 years ago)
Author:
vmaksymiv
Message:

skip inline-validation requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.z3cform.captcha/trunk/quintagroup/z3cform/captcha/validator.py

    r3671 r3694  
    55from zope.i18n import MessageFactory 
    66 
     7try: 
     8    from plone.app.z3cform import inline_validation 
     9except ImportError: 
     10    # BBB Plone < 4.3 compatibility 
     11    from plone.app.form.kss import validation as inline_validation 
     12 
    713from Products.CMFCore.utils import getToolByName 
    814 
    9 from quintagroup.captcha.core.utils import decrypt, parseKey, encrypt1, getWord 
     15from quintagroup.captcha.core.utils import (decrypt, parseKey, encrypt1, 
     16                                            getWord, detectInlineValidation) 
    1017 
    1118from z3c.form.validator import SimpleFieldValidator 
     
    2330    def validate(self, value): 
    2431        # Verify the user input against the captcha 
    25         if 'kss_z3cform_inline_validation' in self.request['URL']: 
     32 
     33        # Captcha validation is one-time process to prevent hacking 
     34        # This is the reason for in-line validation to be disabled. 
     35        if detectInlineValidation(inline_validation): 
    2636            return 
     37 
    2738        context = self.context 
    2839        request = self.request 
Note: See TracChangeset for help on using the changeset viewer.