source: products/qPloneCaptchas/tags/1.3.0/skins/plone_captchas/dynamic/getCaptcha.py

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

Building directory structure

  • Property svn:eol-style set to native
File size: 410 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 random import randint
13key = formKey(randint(0, getCaptchasCount(True)))
14encrypted_key = encrypt(context.captcha_key, key)
15
16return encrypted_key
Note: See TracBrowser for help on using the repository browser.