开发者

Creating your own plone.app.discussion captcha

I'd like to create a static captcha for plone.app.discussion with cultural context: people from a certain nation would be likely to understand the question and know the answer.

plone.app.discussion documentation page discussed about captcha architecture

http://packages.python.org/plone.app.discussion/captcha.html

However, it does not provide steps what you need to do to get your own captcha running or what adapters etc. are involved and how to register it. It mentions

<meta:provides feature="plone.app.discus开发者_StackOverflow中文版sion-captcha" />

... but does not give any hint what this should do.


You can always extend the comment form with a custom captcha field and validator. See http://packages.python.org/plone.app.discussion/howtos/howto_extend_the_comment_form.html for details about how to extend the comment form and http://svn.plone.org/svn/plone/plone.app.discussion/trunk/plone/app/discussion/browser/validator.py for how to write a custom validator.

Monkey patching code is not necessary. The only reason for captcha specific code in p.a.discussion is, that most captcha solutions (such as plone.formwidget.captcha and plone.formwidget.recaptcha) are only generic plone.z3cform fields/widgets. These generic fields/widgets need to be plugged into the comment form to make the captcha field and validator actually work (which right now happens in p.a.discussion itself, but this could also happen in the captcha field packages).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜