summaryrefslogtreecommitdiffstats
path: root/django_authopenid/util.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-01-24 19:53:24 -0500
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2010-01-24 20:03:45 -0500
commitad2e22b999b3b795f60e0f95abcaf3b339567294 (patch)
treeebea9e231463d878ff869e4a74ecd4620e743a95 /django_authopenid/util.py
parentc4da893b2e28dbd2a04f8c6f61c52936119b1148 (diff)
downloadaskbot-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.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_