Changeset 3694 in products for quintagroup.z3cform.captcha/trunk/quintagroup/z3cform/captcha/validator.py
- Timestamp:
- Jul 4, 2013 10:30:59 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.z3cform.captcha/trunk/quintagroup/z3cform/captcha/validator.py
r3671 r3694 5 5 from zope.i18n import MessageFactory 6 6 7 try: 8 from plone.app.z3cform import inline_validation 9 except ImportError: 10 # BBB Plone < 4.3 compatibility 11 from plone.app.form.kss import validation as inline_validation 12 7 13 from Products.CMFCore.utils import getToolByName 8 14 9 from quintagroup.captcha.core.utils import decrypt, parseKey, encrypt1, getWord 15 from quintagroup.captcha.core.utils import (decrypt, parseKey, encrypt1, 16 getWord, detectInlineValidation) 10 17 11 18 from z3c.form.validator import SimpleFieldValidator … … 23 30 def validate(self, value): 24 31 # 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): 26 36 return 37 27 38 context = self.context 28 39 request = self.request
Note: See TracChangeset
for help on using the changeset viewer.