source: products/qPloneCaptchas/tags/0.9/skins/plone_captchas/getCaptcha.py @ 458

Last change on this file since 458 was 1, checked in by myroslav, 19 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 464 bytes
Line 
1## Script (Python) "getCaptcha"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9from Products.qPloneCaptchas.utils import getCaptchasCount, formKey, \
10     encrypt
11
12from Products.qPloneCaptchas.config import havePIL
13from random import randint
14key = formKey(randint(0, getCaptchasCount(havePIL)))
15encrypted_key = encrypt(context.captcha_key, key)
16
17return encrypted_key
Note: See TracBrowser for help on using the repository browser.