diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-01-24 19:53:24 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-01-24 20:03:45 -0500 |
commit | ad2e22b999b3b795f60e0f95abcaf3b339567294 (patch) | |
tree | ebea9e231463d878ff869e4a74ecd4620e743a95 /django_authopenid/util.py | |
parent | c4da893b2e28dbd2a04f8c6f61c52936119b1148 (diff) | |
download | askbot-ad2e22b999b3b795f60e0f95abcaf3b339567294.tar.gz askbot-ad2e22b999b3b795f60e0f95abcaf3b339567294.tar.bz2 askbot-ad2e22b999b3b795f60e0f95abcaf3b339567294.zip |
recaptcha for conventional registration\n\
simpler email subscription form at registration\n\
fixed urls in rss feed\n\
added experimental remote password login api (cleartext password for remote site entered locally)\n\
included example for Mediawiki Authentication plugin\n\
very simple message to everyone management command
Diffstat (limited to 'django_authopenid/util.py')
-rw-r--r-- | django_authopenid/util.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/django_authopenid/util.py b/django_authopenid/util.py index edb6808e..165756e0 100644 --- a/django_authopenid/util.py +++ b/django_authopenid/util.py @@ -6,7 +6,6 @@ import openid.store from django.db.models.query import Q from django.conf import settings -from django.http import str_to_unicode from django.core.urlresolvers import reverse # needed for some linux distributions like debian @@ -16,25 +15,12 @@ except: from yadis import xri import time, base64, hashlib, operator -import urllib +from utils.forms import clean_next, get_next_url from models import Association, Nonce __all__ = ['OpenID', 'DjangoOpenIDStore', 'from_openid_response', 'clean_next'] -DEFAULT_NEXT = '/' + getattr(settings, 'FORUM_SCRIPT_ALIAS') -def clean_next(next): - if next is None: - return DEFAULT_NEXT - next = str_to_unicode(urllib.unquote(next), 'utf-8') - next = next.strip() - if next.startswith('/'): - return next - return DEFAULT_NEXT - -def get_next_url(request): - return clean_next(request.REQUEST.get('next')) - class OpenID: def __init__(self, openid_, issued, attrs=None, sreg_=None): self.openid = openid_ |