source: products/quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/skins/plone_captchas/dynamic/getCaptcha.py @ 1542

Last change on this file since 1542 was 797, checked in by chervol, 17 years ago

initial import

File size: 405 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 quintagroup.plonecaptchas.utils import getCaptchasCount, formKey, encrypt
10
11from random import randint
12key = formKey(randint(0, getCaptchasCount(True)))
13encrypted_key = encrypt(context.captcha_key, key)
14
15return encrypted_key
Note: See TracBrowser for help on using the repository browser.