|
Last change
on this file since 1955 was
1955,
checked in by mylan, 16 years ago
|
|
#172: Fix 'plone_captchas' references to 'captcha_core'
|
|
File size:
716 bytes
|
| Line | |
|---|
| 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 | ## |
|---|
| 10 | import string |
|---|
| 11 | from Products.CMFCore.utils import getToolByName |
|---|
| 12 | from quintagroup.captcha.core.config import LAYER_DYNAMIC_CAPTCHAS |
|---|
| 13 | from quintagroup.captcha.core.config import LAYER_STATIC_CAPTCHAS |
|---|
| 14 | |
|---|
| 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 | |
|---|
| 20 | if LAYER_STATIC_CAPTCHAS in path: |
|---|
| 21 | return 'static' |
|---|
| 22 | elif LAYER_DYNAMIC_CAPTCHAS in path: |
|---|
| 23 | return 'dynamic' |
|---|
| 24 | else: |
|---|
| 25 | return None |
|---|
Note: See
TracBrowser
for help on using the repository browser.