diff options
Diffstat (limited to 'django_authopenid/util.py')
-rw-r--r-- | django_authopenid/util.py | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/django_authopenid/util.py b/django_authopenid/util.py index edb6808e..969af0b9 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 @@ -15,28 +14,16 @@ try: except: from yadis import xri -import time, base64, hashlib, operator -import urllib +import time, base64, hashlib, operator, logging +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): + logging.debug('init janrain openid object') self.openid = openid_ self.issued = issued self.attrs = attrs or {} |