source: products/quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/browser/register.py @ 1860

Last change on this file since 1860 was 1860, checked in by liebster, 14 years ago

Added captcha in registation form by plone4

File size: 828 bytes
Line 
1from zope.interface import Interface
2from zope.formlib import form
3
4from plone.app.users.browser.register import RegistrationForm
5
6from quintagroup.plonecaptchas.browser.field import Captcha
7from quintagroup.plonecaptchas import ProductMessageFactory as _
8
9class ICaptchaSchema(Interface):
10    captcha = Captcha(
11        title=_(u'enter_word',
12                default=u'Enter the word below'),
13        description=_(u'label_help_captchas',
14                      default=u"Enter the word below for registration. "))
15
16
17class CustomRegistrationForm(RegistrationForm):
18    """ For default registration form added captcha field.
19    """
20
21    @property
22    def form_fields(self):
23        defaultFields = super(CustomRegistrationForm, self).form_fields
24        defaultFields += form.Fields(ICaptchaSchema)
25        return defaultFields
Note: See TracBrowser for help on using the repository browser.