Commit 989b28f3 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Allow recaptcha to use ssl for api js files

parent d8eabd0f
......@@ -57,9 +57,10 @@ CLOUD_SERVICES = getattr(settings, 'ASTAKOS_CLOUD_SERVICES', (
RECAPTCHA_PUBLIC_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PUBLIC_KEY', '')
RECAPTCHA_PRIVATE_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PRIVATE_KEY', '')
RECAPTCHA_OPTIONS = getattr(settings, 'ASTAKOS_RECAPTCHA_OPTIONS', {'theme': 'white'})
RECAPTCHA_USE_SSL = getattr(settings, 'ASTAKOS_RECAPTCHA_USE_SSL', True)
# Set where the user should be redirected after logout
LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '')
# Set user email patterns that are automatically activated
RE_USER_EMAIL_PATTERNS = getattr(settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
\ No newline at end of file
RE_USER_EMAIL_PATTERNS = getattr(settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
......@@ -37,7 +37,8 @@ from django import forms
from django.utils.safestring import mark_safe
from django.utils import simplejson as json
from astakos.im.settings import RECAPTCHA_PUBLIC_KEY, RECAPTCHA_OPTIONS
from astakos.im.settings import RECAPTCHA_PUBLIC_KEY, RECAPTCHA_OPTIONS, \
RECAPTCHA_USE_SSL
class RecaptchaWidget(forms.Widget):
""" A Widget which "renders" the output of captcha.displayhtml """
......@@ -47,7 +48,8 @@ class RecaptchaWidget(forms.Widget):
'var RecaptchaOptions = %s'
'</script>') % json.dumps(conf)
return mark_safe(recaptcha_conf + \
captcha.displayhtml(RECAPTCHA_PUBLIC_KEY))
captcha.displayhtml(RECAPTCHA_PUBLIC_KEY,
use_ssl=RECAPTCHA_USE_SSL))
class DummyWidget(forms.Widget):
"""
......
......@@ -58,6 +58,7 @@
#ASTAKOS_RECAPTCHA_PUBLIC_KEY = ''
#ASTAKOS_RECAPTCHA_PRIVATE_KEY = ''
#ASTAKOS_RECAPTCHA_OPTIONS = {'theme':'white'}
#ASTAKOS_RECAPTCHA_USE_SSL = False
# Set where the user should be redirected after logout
#ASTAKOS_LOGOUT_NEXT = ''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment