Giter VIP home page Giter VIP logo

plone.formwidget.captcha's Introduction

This repository is archived and read only.

If you want to unarchive it, then post to the [Admin & Infrastructure (AI) Team category on the Plone Community Forum](https://community.plone.org/c/aiteam/55).

Introduction

image

image

plone.formwidget.captcha is a z3c.form captcha widget for use with Plone. It is a z3c.form re-implementation of the collective.captcha package written by Martijn Pieters.

Buildout Installation

Add the following code to your buildout.cfg to install plone.formwidget.captcha:

[buildout]
...
eggs =
    ...
    plone.formwidget.captcha
    ...

...
[instance]
...
zcml =
    ...
    plone.formwidget.captcha
...

Captchas without server state

(From collective.captcha)

A view to generate a captcha image and/or wav file, and to verify user input against it.

A cookie is used to transfer state from one request to the next. The state is used, together with a server-side secret, to create a random string of characters, which in turn is displayed as a captcha image, or transformed to an audio file. Verification happens case-insensitively.

Note that the captcha 'word' is only usable for 5-10 minutes, after which the view will not accept it any more. Moreover, a different word will be generated for a given session key every 5 minutes.

This makes these captchas replayable for up to 10 minutes if a determined user keeps sending the same session id. Because of the server-secret though, captchas are not transferrable between sites.

plone.formwidget.captcha's People

Contributors

hvelarde avatar hannosch avatar tdesvenain avatar vincentfretin avatar romanofski avatar maartenkling avatar tcurvelo avatar agnogueira avatar cedricmessiant avatar davidjb avatar gforcada avatar jianaijun avatar naro avatar garbas avatar

Stargazers

Leonardo J. Caballero G. avatar  avatar

Watchers

David Bain avatar Dylan Jay avatar David Glick avatar Mikko Ohtamaa avatar TsungWei Hu avatar Jesse Snyder avatar John S. De Stefano Jr avatar  avatar Rob Porter avatar  avatar Rodrigo Ferreira de Souza avatar Christian Klinger avatar Mauro Amico avatar Leonardo J. Caballero G. avatar Silviu Bogan avatar Daniel Manchon avatar Robert Niederreiter avatar  avatar Ramiro Batista da Luz avatar  avatar Cleber J Santos avatar Takeshi Yamamoto avatar Brayton Osgood avatar  avatar Rudd-O avatar Gildardo Bautista avatar Peter Holzer avatar Felipi Macedo avatar Rudá Porto Filgueiras avatar ringobouya avatar Armin Stross-Radschinski avatar Cris Ewing avatar Davi Medeiros avatar trabby avatar Fulvio Casali avatar Eric BREHAULT avatar Zoltan Szabo avatar Takashi NAGAI avatar Manabu TERADA avatar Low Kian Seong avatar Joao S. O. Bueno avatar Bert Vanderbauwhede avatar Daniel Murray avatar Rizwan avatar Jean Ferri avatar  avatar andreasma avatar  avatar Georg Gogo. BERNHARD avatar Ken Wasetis avatar Wyn Williams avatar Rob Gietema avatar Roché Compaan avatar T. Kim Nguyen avatar Thomas Clement Mogensen avatar awello avatar James Cloos avatar  avatar Hans-Peter Locher avatar Yoan Le Clanche avatar Ralph Jacobs avatar Charles Beebe avatar Chris Calloway avatar Mohammad Tareq Alam avatar Franklin Kingma avatar Carol Ganz avatar Juan Carlos Coruña avatar  avatar Maik Röder avatar Corina Riba avatar Espen Moe-Nilssen avatar  avatar Laurent Lasudry avatar Tânia Andrea avatar tiazma avatar Harald Friessnegger avatar nilo avatar  avatar Derrick Stone avatar André NUYENS avatar Alexandru Ghica avatar DHietpas avatar Fazal Sulaiman avatar Jonathan Lewis avatar Bogdan Girman avatar Max Jakob avatar  avatar Gauthier Bastien avatar Stefaner Benjamin avatar  avatar Luca avatar Lucas Aquino avatar  avatar Alice Tseng avatar Luca Pisani avatar Stéphan Geulette avatar Zoltan Benedek avatar Ian Anderson avatar Adam avatar Jason Craig avatar

plone.formwidget.captcha's Issues

Noise configuration

A number of bots are being able to decipher the captcha, probably using an image to text library. Is is possible to increase the noise to make them harder to the bots?

Does not work on Plone 6

Dec 26 04:11:47 ring2-plonedev frontend[180401]: 2021-12-26 04:11:47,729 ERROR   [plone.autoinclude.loader:40][MainThread] Could not import plone.formwidget.captcha.
Dec 26 04:11:47 ring2-plonedev frontend[180401]: Traceback (most recent call last):
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "/home/user/optplone/buildout-cache/eggs/cp38/plone.autoinclude-1.0.0a3-py3.8.egg/plone/autoinclude/loader.py", line 36, in load_z3c_packages
Dec 26 04:11:47 ring2-plonedev frontend[180401]:     dist = importlib.import_module(module_name)
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "/home/user/optpython/3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
Dec 26 04:11:47 ring2-plonedev frontend[180401]:     return _bootstrap._gcd_import(name[level:], package, level)
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "/home/user/optplone/buildout-cache/eggs/cp38/plone.formwidget.captcha-1.0.3-py3.8.egg/plone/formwidget/captcha/__init__.py", line 4, in <module>
Dec 26 04:11:47 ring2-plonedev frontend[180401]:     from plone.formwidget.captcha.widget import CaptchaWidget
Dec 26 04:11:47 ring2-plonedev frontend[180401]:   File "/home/user/optplone/buildout-cache/eggs/cp38/plone.formwidget.captcha-1.0.3-py3.8.egg/plone/formwidget/captcha/widget.py", line 10, in <module>
Dec 26 04:11:47 ring2-plonedev frontend[180401]:     from interfaces import ICaptchaWidget
Dec 26 04:11:47 ring2-plonedev frontend[180401]: ModuleNotFoundError: No module named 'interfaces'

WrongCaptchaCode

I'm using plone.formwidget.captcha for plone.app.discussion http://pythonhosted.org/plone.app.discussion/captcha.html
I installed the plugin by setup.py http://pastie.org/9392259
When I enabled comments by anonymous and chose Captcha (plone.formwidget.captcha) for captcha settings under Discussion settings, I'm getting this traceback when I'm posting a comment as anonymous user.
Am I missing out something?

http://pastebin.com/QA4SiRcx

2014-07-15 13:16:55 ERROR Zope.SiteErrorLog 1405410415.490.766747873661 http://localhost:8080/Plone/forumboard/df/@@view
Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module plone.autoform.view, line 49, in __call__
  Module plone.autoform.view, line 40, in render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 888, in do_useMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 852, in do_condition
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/home/aman/gsoc/collective.ploneboard/eggs/plonetheme.sunburst-1.4.6-py2.7.egg/plonetheme/sunburst/skins/sunburst_templates/main_template.pt
   - Line 134, Column 12
   - Expression: <StringExpr u'plone.belowcontent'>
   - Names:
      {'args': (),
       'container': <Item at /Plone/forumboard/df>,
       'context': <Item at /Plone/forumboard/df>,
       'default': <object object at 0x7ffa6e7e44d0>,
       'here': <Item at /Plone/forumboard/df>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x8ac0368>,
       'request': <HTTPRequest, URL=http://localhost:8080/Plone/forumboard/df/@@view>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7ffa509b3b10>,
       'traverse_subpath': [],
       'user': <SpecialUser 'Anonymous User'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /home/aman/gsoc/collective.ploneboard/eggs/plone.app.dexterity-2.0.11-py2.7.egg/plone/app/dexterity/browser/item.pt object at 0x7ffa59408a10>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7ffa594802d0>}
  Module zope.contentprovider.tales, line 77, in __call__
  Module zope.viewlet.manager, line 112, in update
  Module zope.viewlet.manager, line 118, in _updateViewlets
  Module plone.app.discussion.browser.comments, line 298, in update
  Module plone.z3cform.fieldsets.extensible, line 59, in update
  Module plone.z3cform.patch, line 30, in GroupForm_update
  Module z3c.form.group, line 141, in update
  Module plone.app.z3cform.csrf, line 21, in execute
  Module z3c.form.action, line 98, in execute
  Module z3c.form.button, line 315, in __call__
  Module z3c.form.button, line 170, in __call__
  Module plone.app.discussion.browser.comments, line 170, in handleComment
  Module plone.app.discussion.browser.validator, line 59, in validate
WrongCaptchaCode
2014-07-15 13:16:56 ERROR root Exception while rendering an error message
Traceback (most recent call last):
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/OFS/SimpleItem.py", line 242, in raise_standardErrorMessage
    v = s(**kwargs)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Products.CMFCore-2.2.7-py2.7.egg/Products/CMFCore/FSPythonScript.py", line 127, in __call__
    return Script.__call__(self, *args, **kw)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Products.PythonScripts-2.13.2-py2.7.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
    result = f(*args, **kw)
  File "Script (Python)", line 35, in standard_error_message
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Products.CMFCore-2.2.7-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 237, in _exec
    result = self.pt_render(extra_context=bound_names)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Products.CMFCore-2.2.7-py2.7.egg/Products/CMFCore/FSPageTemplate.py", line 177, in pt_render
    self, source, extra_context
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/Products/PageTemplates/PageTemplate.py", line 79, in pt_render
    showtal=showtal)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.pagetemplate-3.6.3-py2.7.egg/zope/pagetemplate/pagetemplate.py", line 240, in __call__
    interpreter()
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 888, in do_useMacro
    self.interpret(macro)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 852, in do_condition
    self.interpret(block)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
    structure = self.engine.evaluateStructure(expr)
  File "/home/aman/gsoc/collective.ploneboard/eggs/Zope2-2.13.22-py2.7.egg/Products/PageTemplates/Expressions.py", line 218, in evaluateStructure
    text = super(ZopeContext, self).evaluateStructure(expr)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.tales-3.5.3-py2.7.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.contentprovider-3.7.2-py2.7.egg/zope/contentprovider/tales.py", line 77, in __call__
    provider.update()
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.viewlet-3.7.2-py2.7.egg/zope/viewlet/manager.py", line 112, in update
    self._updateViewlets()
  File "/home/aman/gsoc/collective.ploneboard/eggs/zope.viewlet-3.7.2-py2.7.egg/zope/viewlet/manager.py", line 118, in _updateViewlets
    viewlet.update()
  File "/home/aman/gsoc/collective.ploneboard/extras/plone.app.discussion/plone/app/discussion/browser/comments.py", line 298, in update
    self.form.update()
  File "/home/aman/gsoc/collective.ploneboard/eggs/plone.z3cform-0.8.0-py2.7.egg/plone/z3cform/fieldsets/extensible.py", line 59, in update
    super(ExtensibleForm, self).update()
  File "/home/aman/gsoc/collective.ploneboard/eggs/plone.z3cform-0.8.0-py2.7.egg/plone/z3cform/patch.py", line 30, in GroupForm_update
    _original_GroupForm_update(self)
  File "/home/aman/gsoc/collective.ploneboard/eggs/z3c.form-3.1.1-py2.7.egg/z3c/form/group.py", line 141, in update
    self.actions.execute()
  File "/home/aman/gsoc/collective.ploneboard/eggs/plone.app.z3cform-0.7.6-py2.7.egg/plone/app/z3cform/csrf.py", line 21, in execute
    super(AuthenticatedButtonActions, self).execute()
  File "/home/aman/gsoc/collective.ploneboard/eggs/z3c.form-3.1.1-py2.7.egg/z3c/form/action.py", line 98, in execute
    result = handler()
  File "/home/aman/gsoc/collective.ploneboard/eggs/z3c.form-3.1.1-py2.7.egg/z3c/form/button.py", line 315, in __call__
    return handler(self.form, self.action)
  File "/home/aman/gsoc/collective.ploneboard/eggs/z3c.form-3.1.1-py2.7.egg/z3c/form/button.py", line 170, in __call__
    return self.func(form, action)
  File "/home/aman/gsoc/collective.ploneboard/extras/plone.app.discussion/plone/app/discussion/browser/comments.py", line 170, in handleComment
    captcha.validate(data['captcha'])
  File "/home/aman/gsoc/collective.ploneboard/extras/plone.app.discussion/plone/app/discussion/browser/validator.py", line 59, in validate
    raise WrongCaptchaCode
WrongCaptchaCode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.