Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.z3cform.norobots

How to install collective.z3cform.norobots

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.z3cform.norobots
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.3.1
1.4.2.2Never BuiltWhy not?
1.3.1 Available View build log
1.3 Available View build log
1.2.1 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
Windows (64-bit)
1.3.1
1.4.2.2Never BuiltWhy not?
1.3.1 Available View build log
1.3 Available View build log
1.2.1 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
Mac OS X (10.5+)
1.3.1
1.4.2.2Never BuiltWhy not?
1.3.1 Available View build log
1.3 Available View build log
1.2.1 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
Linux (32-bit)
1.4.1
1.4.2.2Never BuiltWhy not?
1.4.1 Available View build log
1.4 Available View build log
1.3.1 Available View build log
1.3 Available View build log
1.2.1 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
Linux (64-bit)
1.4.2.2 Available View build log
1.4.1 Available View build log
1.4 Available View build log
1.3.1 Available View build log
1.3 Available View build log
1.2.1 Available View build log
1.2 Available View build log
1.1 Available View build log
1.0 Available View build log
 
License
GPL
Lastest release
version 1.4.2.2 on May 14th, 2013

Overview

collective.z3cform.norobots provides a "human" captcha widget based on a list of question/answer(s).

This captcha can be used :

  • as a plone.app.discussion (Plone Discussions) captcha plugin
  • as a z3c form field
  • as a PloneFormGen field with collective.pfg.norobots

The widget is based on z3c.form.TextWidget.

Since version 1.4, questions configuration uses a dedicated control panel (using plone.app.registry) instead of a simple properties sheet. An upgrade step provides migration from earlier versions.

Interface is translated in the following languages: Czech [cs], Danish [da], German [de], Basque [eu], Spanish [es], Suomeksi [fi], French [fr], Dutch [nl], Simplified Chinese [zh_CN] and Italian [it].

Requirements

I have tested this release with Plone 4.3, Plone 4.2.5 and Plone 4.1.6 (http://plone.org/products/plone).

See previous releases for Plone 4.0.

Installation

Getting the module

Add collective.z3cform.norobots to your plone.recipe.zope2instance buildout section e.g.:

[instance]
...
eggs =
    Plone
    ...
    collective.z3cform.norobots

...

zcml =
    ...
    collective.z3cform.norobots

Or, you can add it as a dependency on your own product setup.py:

install_requires=[
    ...
    'collective.z3cform.norobots',
],
Enabling the module
In the Addons control panel, install "Norobots captcha field (collective.z3cform.norobots)".
Add a new question

In the "Norobots widget settings" control panel, add a new line in the field "Norobots question::answer":

your_question::the_answer

Example : What is 10 + 12 ?::22

Answer can contain multiple values delimited by semicolon:

your_question::the_answer;another_answer

Example : What is 5 + 5 ?::10;ten
Quickly test ?

Download collective.z3cform.norobots and use virtualenv and buildout to test the module:

easy_install virtualenv
cd collective.z3cform.norobots
virtualenv .
source bin/activate
(collective.z3cform.norobots) easy_install zc.buildout
!!! check the buildout config file ``test-plone-base.cfg`` before running !!!
(collective.z3cform.norobots) ln -s test-plone-4.2.x.cfg buildout.cfg
(collective.z3cform.norobots) python bootstrap.py
(collective.z3cform.norobots) bin/buildout
[...] be patient... [...]
(collective.z3cform.norobots) ./bin/instance fg

Go to http://localhost:8080, add a new Plone Site and install collective.z3cform.norobots (see above).

Launch tests:

(collective.z3cform.norobots) ./bin/test -s collective.z3cform.norobots

Launch code coverage:

(collective.z3cform.norobots) bin/coverage
(collective.z3cform.norobots) bin/report
And open with a browser htmlcov/index.html

Usage in a z3c form

You can use this widget setting the "widgetFactory" property of a form field:

from zope import interface, schema
from z3c.form import interfaces, form, field, button, validator
from plone.app.z3cform.layout import wrap_form

from collective.z3cform.norobots.i18n import MessageFactory as _
from collective.z3cform.norobots.widget import NorobotsFieldWidget
from collective.z3cform.norobots.validator import NorobotsValidator

class INorobotsForm(interface.Interface):
    norobots = schema.TextLine(title=_(u'Are you a human ?'),
                               description=_(u'In order to avoid spam, please answer the question below.'),
                               required=True)

class NorobotsForm(form.Form):
    fields = field.Fields(INorobotsForm)
    fields['norobots'].widgetFactory = NorobotsFieldWidget

# wrap the form with plone.app.z3cform's Form wrapper
NorobotsFormView = wrap_form(NorobotsForm)

# Register Norobots validator for the correponding field in the IContactInfo interface
validator.WidgetValidatorDiscriminators(NorobotsValidator, field=INorobotsForm['norobots'])

for more information see contact_info.py in the plone_forms directory.

Possible problems

Credits

Source code

Source code is hosted on Github.

Contributors

  • Sylvain Boureliou [sylvainb]
  • Mikel Larreategi [erral]
  • Aijun Jian
  • Radim Novotny [naro]
  • Thomas Clement Mogensen [tmog]
  • Peter Mathis [petschki]
  • Petri Savolainen [petri]
  • Helmut Toplitzer
  • Luca Fabbri [keul]

Changelog

1.4.2.2 (2013-04-25)
  • added italian translation [keul]
1.4.2.1 (2013-01-17)
  • add Dutch Translations [maartenkling]
1.4.2 (2012-10-03)
  • Add compatibility for collective.pfg.norobots : allow to use the Norobots captcha with PloneFormGen. [sylvainb]
  • Fix widget template to allow good redirection when the answer is bad in plone.app.discussion forms. [sylvainb]
  • Move source code in "src" directory. [sylvainb]
  • Update tests, buildouts and add test coverage. Plone 4.0 is no longer supported. [sylvainb]
  • Change MessageFactory name to get translations picked up by Plone [erral]
  • Updated basque translation and added Spanish translation. [erral]
1.4.1 (2012-07-02)
  • Fix Unicode error when a question contains non-ascii char. [sylvainb, Helmut Toplitzer]
1.4 (2012-06-22)
  • Use plone.app.registry instead of a property sheet for the questions configuration. Questions can now be added using a dedicated control panel. [sylvainb]
  • Add an upgrade step (1 -> 2) to copy questions from the old properties sheet to plone.app.registry. [sylvainb]
  • Fix the widget template for use with plone.app.discussion (there was no redirection to the comment form when only the captcha is wrong). [sylvainb]
  • Update translations (some new strings added). [sylvainb]
  • Add Basque translation [erral]
1.3.1 (2012-03-28)
  • Add simplified chinese translation [Aijun Jian]
1.3 (2012-02-27)
  • Allow multiple answers for a question [naro]
  • Added danish translation [tmog]
1.2.1 (2010-11-05)
  • Added german translation [petschki]
1.2 (2010-10-31)
  • Fix tests for Plone 4 [sylvainb]
  • Added Czech translation [naro]
1.1 (2010-09-15)
  • Support for using as a plone.app.discussion captcha plugin (Plone 4) [Petri Savolainen]
  • Finnish translations [Petri Savolainen]
1.0 (2010-01-13)
  • Initial release [sylvainb]

Subscribe to package updates

Last updated May 14th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.