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= |
---|
9 | from Products.qPloneCaptchas.config import CAPTCHAS_COUNT |
---|
10 | request = context.REQUEST |
---|
11 | key = request.traverse_subpath[0] |
---|
12 | index = int(key[:4],16)%CAPTCHAS_COUNT |
---|
13 | if index == 0: |
---|
14 | index = CAPTCHAS_COUNT |
---|
15 | img = getattr(context, '%s.jpg' % index) |
---|
16 | return img.index_html(request, request.RESPONSE) |
---|
Note: See
TracBrowser
for help on using the repository browser.