1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 from django.conf.urls.defaults import patterns, url
17 from django.views.generic.base import TemplateView
18
19
20 from django.contrib.auth import views as auth_views
21 from django.conf import settings
22 from madrona.openid import views as oid_views
23 from registration import views as reg_views
24 from registration.views import activate
25 from registration.views import register
26 from madrona.common.registration_backend.forms import MadronaRegistrationForm
27
28 urlpatterns = patterns('',
29 url(r'^password/reset/$', auth_views.password_reset, name='auth_password_reset'),
30 url(r'^password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
31 auth_views.password_reset_confirm,
32 name='auth_password_reset_confirm'),
33 url(r'^password/reset/complete/$',
34 auth_views.password_reset_complete,
35 name='auth_password_reset_complete'),
36 url(r'^password/reset/done/$',
37 auth_views.password_reset_done,
38 name='auth_password_reset_done'),
39 url(r'^password/$',oid_views.password_change, name='auth_password_change'),
40
41
42 url(r'^associate/complete/$', oid_views.complete_associate, name='user_complete_associate'),
43 url(r'^associate/$', oid_views.associate, name='user_associate'),
44 url(r'^dissociate/$', oid_views.dissociate, name='user_dissociate'),
45 url(r'^register/$', oid_views.register, name='user_register'),
46 url(r'^signout/$', oid_views.signout, {'next_page': settings.LOGIN_REDIRECT_URL}, name='user_signout'),
47 url(r'^signout/$', oid_views.signout, {'next_page': settings.LOGIN_REDIRECT_URL}, name='auth_logout'),
48 url(r'^signin/complete/$', oid_views.complete_signin, name='user_complete_signin'),
49 url(
50 r'^signup/$',
51 reg_views.register,
52 {'backend': 'registration.backends.default.DefaultBackend',
53 'form_class': MadronaRegistrationForm},
54 name='registration_register'
55 ),
56 url(r'^signup/complete/$',
57 TemplateView.as_view(template_name='registration/registration_complete.html'),
58 name='registration_complete'),
59
60 url(r'^activate/complete/$',
61 TemplateView.as_view(template_name='registration/activation_complete.html'),
62 {'extra_context': {'group_request_email': settings.GROUP_REQUEST_EMAIL}},
63 name='registration_activation_complete'),
64
65
66
67
68 url(r'^activate/(?P<activation_key>\w+)/$',
69 activate,
70 {'backend': 'madrona.common.registration_backend.LingcodBackend'},
71 name='registration_activate'),
72 url(r'^register/closed/$',
73 TemplateView.as_view(template_name='registration/registration_closed.html'),
74 name='registration_disallowed'),
75
76
77 url(r'^yadis.xrdf$', oid_views.xrdf, name='oid_xrdf'),
78 )
79
80
81
82
83
84
85 try:
86 use_openid = settings.OPENID_ENABLED
87 except:
88 use_openid = False
89
90 if use_openid:
91 template_name = 'authopenid/signin.html'
92 else:
93 template_name = 'authopenid/signin_local.html'
94
95 urlpatterns += patterns('',
96 url(r'^signin/$', oid_views.signin, {'template_name':template_name}, name='user_signin'),
97 url(r'^signin/$', oid_views.signin, {'template_name':template_name}, name='auth_login'),
98 )
99