summaryrefslogtreecommitdiffstats
path: root/django_authopenid/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'django_authopenid/util.py')
-rw-r--r--django_authopenid/util.py16
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_