plone - Plone 用户注册表中的验证码字段

标签 plone plone-4.x

我需要 plone 默认用户注册表单中的验证码字段 (@@register)。

最佳答案

使用 https://plone.org/products/quintagroup.formlib.captcha 解决

from mypackage import myMessageFactory as _
from quintagroup.formlib.captcha import Captcha
from quintagroup.formlib.captcha import CaptchaWidget
from plone.app.users.browser.register import RegistrationForm
from zope.interface import Interface
from zope.formlib import form


class ICaptchaSchema(Interface):
    captcha = Captcha(
        title=_(u'Prevent spam'),
        description=_(
            u'Type the text in the picture.'
        ),
    )


class CustomRegistrationForm(RegistrationForm):
    """ Custom registration form
    """

    @property
    def form_fields(self):
        fields = super(CustomRegistrationForm, self).form_fields
        fields += form.Fields(ICaptchaSchema)
        fields['captcha'].custom_widget = CaptchaWidget

        return fields

关于plone - Plone 用户注册表中的验证码字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33011737/

相关文章:

css - 如何在 plone + Zope 站点上快速加载/卸载 css 更改? (小白)

Plone 消息工具告诉用户维护停机时间

python - Plone 4.3.3 - 模式驱动类型 - plone.directives.form 未导入

javascript - Plone 和 AngularJS 路由

python - 每个文件夹站点使用一种语言的 Plone 导航

javascript - 如何针对 Plone 中的特定 View 注册 Javascript

plone - Plone测试中出现未经授权的错误,尽管可以通过网络添加内容类型

plone - 评论 Dexterity 对象时出错

user-interface - 如何在用户 Plone 中插入生日?

plone - 无法添加我的基于原型(prototype)的内容类型