Last change
on this file since 2542 was
1955,
checked in by mylan, 14 years ago
|
#172: Fix 'plone_captchas' references to 'captcha_core'
|
File size:
716 bytes
|
Rev | Line | |
---|
[797] | 1 | ## Script (Python) "getCaptchaType" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=actions=None |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
[1955] | 10 | import string |
---|
[797] | 11 | from Products.CMFCore.utils import getToolByName |
---|
[1955] | 12 | from quintagroup.captcha.core.config import LAYER_DYNAMIC_CAPTCHAS |
---|
| 13 | from quintagroup.captcha.core.config import LAYER_STATIC_CAPTCHAS |
---|
| 14 | |
---|
[797] | 15 | skinsTool = getToolByName(context, 'portal_skins') |
---|
| 16 | default_skin = skinsTool.getDefaultSkin() |
---|
| 17 | path = skinsTool.getSkinPath(default_skin) |
---|
| 18 | path = map( string.strip, string.split( path,',' ) ) |
---|
| 19 | |
---|
[1955] | 20 | if LAYER_STATIC_CAPTCHAS in path: |
---|
[797] | 21 | return 'static' |
---|
[1955] | 22 | elif LAYER_DYNAMIC_CAPTCHAS in path: |
---|
[797] | 23 | return 'dynamic' |
---|
| 24 | else: |
---|
[1955] | 25 | return None |
---|
Note: See
TracBrowser
for help on using the repository browser.