cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
user.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 ##
21 # @package src.wi.urls.guest.user
22 #
23 # @author Piotr W√≥jcik
24 # @date 1.10.2010
25 #
26 
27 from django.conf.urls import url, patterns, include
28 
29 from wi.utils.views import direct_to_template
30 from wi.views.guest.user import reg_activate, reg_register
31 
32 
33 auth_patterns = patterns('wi.views.guest.user',
34  url(r'^login/$', 'login', name='login'),
35  url(r'^logout/$', 'logout', name='logout'),
36 )
37 
38 main_patterns = patterns('wi.views.guest.user',
39  url(r'^change_language/(?P<lang>\w+)/$', 'change_language', name='change_language'),
40 )
41 
42 account_patterns = patterns('wi.views.guest.user',
43  url(r'^password_reset/$', 'acc_password_reset', name='acc_password_reset'),
44  url(r'^password_reset_error/$', direct_to_template, {'template_name': 'account/password_reset_error_email.html'},
45  name='acc_password_reset_error'),
46 
47  url(r'^password_change/done/$', direct_to_template,
48  {'template_name': 'account/password_change_done.html'}, name='acc_password_change_done'),
49  url(r'^password_reset_error_token/$', direct_to_template,
50  {'template_name': 'account/password_reset_error_token.html'}, name='acc_password_reset_error_token'),
51 
52  url(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'acc_password_reset_confirm', name='acc_password_reset_confirm'),
53  url(r'^password_reset/done/$', direct_to_template,
54  {'template_name': 'account/password_reset_done.html'}, name='acc_password_reset_done'),
55  url(r'^reset/done/$', direct_to_template,
56  {'template_name': 'account/password_reset_complete.html'}, name='acc_password_reset_complete'),
57 )
58 
59 help_patterns = patterns('wi.views.guest.user',
60  url(r'^$', 'hlp_help', name='hlp_help'),
61 )
62 
63 registration_patterns = patterns('wi.views.guest.user',
64  # Activation keys get matched by \w+ instead of the more specific
65  # [a-fA-F0-9]{40} because a bad activation key should still get to the view;
66  # that way it can return a sensible "invalid key" message instead of a
67  # confusing 404.
68  url(r'^activate/key/(?P<activation_key>\w+)/$', reg_activate, name='reg_activate'),
69  url(r'^register/$', reg_register, name='reg_register'),
70  url(r'^register/closed/$', direct_to_template, {'template_name': 'registration/registration_closed.html'}, name='reg_disallowed'),
71 
72  url(r'^register/completed/$', direct_to_template, {'template_name': 'registration/registration_completed.html'}, name='registration_completed'),
73  url(r'^register/mail_confirmation/$', direct_to_template, {'template_name': 'registration/registration_mail_confirmation.html'}, name='registration_mail_confirmation'),
74  url(r'^register/admin_confirmation/$', direct_to_template, {'template_name': 'registration/registration_admin_confirmation.html'}, name='registration_admin_confirmation'),
75  url(r'^register/error/$', direct_to_template, {'template_name': 'registration/registration_error.html'}, name='registration_error'),
76 
77  url(r'^activate/completed/$', direct_to_template, {'template_name': 'registration/activation_completed.html'}, name='activation_completed'),
78  url(r'^activate/admin_confirmation/$', direct_to_template, {'template_name': 'registration/activation_admin_confirmation.html'}, name='activation_admin_confirmation'),
79  url(r'^activate/error/$', direct_to_template, {'template_name': 'registration/activation_error.html'}, name='activation_error'),
80 )
81 
82 urlpatterns = patterns('',
83  url(r'^auth/', include(auth_patterns)),
84  url(r'', include(main_patterns)),
85  url(r'^account/', include(account_patterns)),
86  url(r'^help/', include(help_patterns)),
87  url(r'^registration/', include(registration_patterns)),
88 )
89