summaryrefslogtreecommitdiffstats
path: root/django_authopenid
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2009-08-19 21:29:51 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2009-08-19 21:29:51 -0400
commit2022b772a01f36fa74de002b5370dd70b6c051ba (patch)
tree2ce70a5d5fb0eab245126fab7fac628fab0cffbe /django_authopenid
parent1bc0d490820c4587a8902747e8516aa6ae98a515 (diff)
downloadaskbot-2022b772a01f36fa74de002b5370dd70b6c051ba.tar.gz
askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.tar.bz2
askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.zip
added Adolfos mods, django_authopeid bug, unified traditional and OpenID login
Diffstat (limited to 'django_authopenid')
-rw-r--r--django_authopenid/urls.py12
-rw-r--r--django_authopenid/views.py23
2 files changed, 17 insertions, 18 deletions
diff --git a/django_authopenid/urls.py b/django_authopenid/urls.py
index 9c0887d8..f5d7a72f 100644
--- a/django_authopenid/urls.py
+++ b/django_authopenid/urls.py
@@ -12,17 +12,15 @@ urlpatterns = patterns('django_authopenid.views',
url(r'^%s$' % _('signout/'), 'signout', name='user_signout'),
url(r'^%s%s$' % (_('signin/'), _('complete/')), 'complete_signin',
name='user_complete_signin'),
- url(r'^%s$' % _('register/'), 'register', name='user_register'),
+ #url(r'^%s$' % _('register/'), 'register', name='user_register'),
url(r'^%s$' % _('signup/'), 'signup', name='user_signup'),
#disable current sendpw function
- url(r'^%s$' % _('sendpw/'), 'signin', name='user_sendpw'),
- #url(r'^%s$' % _('sendpw/'), 'sendpw', name='user_sendpw'),
- #url(r'^%s%s$' % (_('password/'), _('confirm/')), 'confirmchangepw',
- # name='user_confirmchangepw'),
+ url(r'^%s$' % _('sendpw/'), 'sendpw', name='user_sendpw'),
+ url(r'^%s%s$' % (_('password/'), _('confirm/')), 'confirmchangepw', name='user_confirmchangepw'),
# manage account settings
- #url(r'^$', _('account_settings'), name='user_account_settings'),
- #url(r'^%s$' % _('password/'), 'changepw', name='user_changepw'),
+ url(r'^$', _('account_settings'), name='user_account_settings'),
+ url(r'^%s$' % _('password/'), 'changepw', name='user_changepw'),
url(r'^%s$' % _('email/'), 'changeemail', name='user_changeemail',kwargs = {'action':'change'}),
url(r'^%s%s$' % (_('email/'),_('validate/')), 'changeemail', name='user_changeemail',kwargs = {'action':'validate'}),
#url(r'^%s$' % _('openid/'), 'changeopenid', name='user_changeopenid'),
diff --git a/django_authopenid/views.py b/django_authopenid/views.py
index 218a31a2..65d579f4 100644
--- a/django_authopenid/views.py
+++ b/django_authopenid/views.py
@@ -175,9 +175,18 @@ def signin(request,newquestion=False,newanswer=False):
form_auth = OpenidAuthForm(initial={'next':next})
if request.POST:
-
- if 'bsignin' in request.POST.keys() or 'openid_username' in request.POST.keys():
+ if 'blogin' in request.POST.keys():
+ # perform normal django authentification
+ form_auth = OpenidAuthForm(request.POST)
+ if form_auth.is_valid():
+ user_ = form_auth.get_user()
+ login(request, user_)
+ next = clean_next(form_auth.cleaned_data.get('next'))
+ print 'next stop is "%s"' % next
+ return HttpResponseRedirect(next)
+
+ elif 'bsignin' in request.POST.keys() or 'openid_username' in request.POST.keys():
form_signin = OpenidSigninForm(request.POST)
if form_signin.is_valid():
next = clean_next(form_signin.cleaned_data.get('next'))
@@ -193,14 +202,6 @@ def signin(request,newquestion=False,newanswer=False):
on_failure=signin_failure,
sreg_request=sreg_req)
- elif 'blogin' in request.POST.keys():
- # perform normal django authentification
- form_auth = OpenidAuthForm(request.POST)
- if form_auth.is_valid():
- user_ = form_auth.get_user()
- login(request, user_)
- next = clean_next(form_auth.cleaned_data.get('next'))
- return HttpResponseRedirect(next)
question = None
if newquestion == True:
@@ -368,7 +369,7 @@ def register(request):
return render('authopenid/complete.html', {
'form1': form1,
'form2': form2,
- 'provider':providers[provider_name],
+ 'provider':provider_logo,
'nickname': nickname,
'email': email
}, context_instance=RequestContext(request))