source: products/qPloneCaptchas/tags/0.8/skins/plone_captchas/getCaptchaImage.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: 470 bytes
Line 
1## Script (Python) "getCaptchaImage"
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.config import CAPTCHAS_COUNT
10request = context.REQUEST
11key = request.traverse_subpath[0]
12index = int(key[:4],16)%CAPTCHAS_COUNT
13if index == 0:
14    index = CAPTCHAS_COUNT
15img = getattr(context, '%s.jpg' % index)
16return img.index_html(request, request.RESPONSE)
Note: See TracBrowser for help on using the repository browser.