root / snf-astakos-app / astakos / im / urls.py @ 74796dd8
History | View | Annotate | Download (7.8 kB)
1 |
# Copyright 2011-2012 GRNET S.A. All rights reserved.
|
---|---|
2 |
#
|
3 |
# Redistribution and use in source and binary forms, with or
|
4 |
# without modification, are permitted provided that the following
|
5 |
# conditions are met:
|
6 |
#
|
7 |
# 1. Redistributions of source code must retain the above
|
8 |
# copyright notice, this list of conditions and the following
|
9 |
# disclaimer.
|
10 |
#
|
11 |
# 2. Redistributions in binary form must reproduce the above
|
12 |
# copyright notice, this list of conditions and the following
|
13 |
# disclaimer in the documentation and/or other materials
|
14 |
# provided with the distribution.
|
15 |
#
|
16 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
17 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
18 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
19 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
20 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
23 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
24 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
25 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
26 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 |
# POSSIBILITY OF SUCH DAMAGE.
|
28 |
#
|
29 |
# The views and conclusions contained in the software and
|
30 |
# documentation are those of the authors and should not be
|
31 |
# interpreted as representing official policies, either expressed
|
32 |
# or implied, of GRNET S.A.
|
33 |
|
34 |
from django.conf.urls.defaults import patterns, url |
35 |
|
36 |
from astakos.im.forms import (ExtendedPasswordResetForm, |
37 |
ExtendedPasswordChangeForm, |
38 |
ExtendedSetPasswordForm, LoginForm) |
39 |
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, EMAILCHANGE_ENABLED |
40 |
|
41 |
urlpatterns = patterns('astakos.im.views',
|
42 |
url(r'^$', 'index', {}, name='index'), |
43 |
url(r'^login/?$', 'index', {}, name='login'), |
44 |
url(r'^profile/?$','edit_profile', {}, name='edit_profile'), |
45 |
url(r'^feedback/?$', 'feedback', {}, name='feedback'), |
46 |
url(r'^signup/?$', 'signup', {'on_success': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='signup'), |
47 |
url(r'^logout/?$', 'logout', {'template': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='logout'), |
48 |
url(r'^activate/?$', 'activate', {}, name='activate'), |
49 |
url(r'^approval_terms/?$', 'approval_terms', {}, name='latest_terms'), |
50 |
url(r'^approval_terms/(?P<term_id>\d+)/?$', 'approval_terms'), |
51 |
url(r'^send/activation/(?P<user_id>\d+)/?$', 'send_activation', {}, name='send_activation'), |
52 |
url(r'^resources/?$', 'resource_usage', {}, name='resource_usage'), |
53 |
# url(r'^billing/?$', 'billing', {}, name='billing'),
|
54 |
url(r'^timeline/?$', 'timeline', {}, name='timeline'), |
55 |
url(r'^group/add/complete/?$', 'group_add_complete', {}, name='group_add_complete'), |
56 |
url(r'^group/add/(?P<kind_name>\w+)?$', 'group_add', {}, name='group_add'), |
57 |
url(r'^group/list/?$', 'group_list', {}, name='group_list'), |
58 |
url(r'^group/(?P<group_id>\d+)/?$', 'group_detail', {}, name='group_detail'), |
59 |
url(r'^group/search/?$', 'group_search', {}, name='group_search'), |
60 |
url(r'^group/all/?$', 'group_all', {}, name='group_all'), |
61 |
url(r'^group/(?P<group_id>\d+)/join/?$', 'group_join', {}, name='group_join'), |
62 |
url(r'^group/(?P<group_id>\d+)/leave/?$', 'group_leave', {}, name='group_leave'), |
63 |
url(r'^group/(?P<group_id>\d+)/(?P<user_id>\d+)/approve/?$', 'approve_member', {}, name='approve_member'), |
64 |
url(r'^group/(?P<group_id>\d+)/(?P<user_id>\d+)/disapprove/?$', 'disapprove_member', {}, name='disapprove_member'), |
65 |
url(r'^group/create/?$', 'group_create_list', {}, name='group_create_list'), |
66 |
url(r'^remove_auth_provider/(?P<pk>\d+)?$', 'remove_auth_provider', {}, |
67 |
name='remove_auth_provider'),
|
68 |
url(r'^group/how_it_works/?$', 'how_it_works', {}, name='how_it_works') |
69 |
) |
70 |
|
71 |
|
72 |
if EMAILCHANGE_ENABLED:
|
73 |
urlpatterns += patterns('astakos.im.views',
|
74 |
url(r'^email_change/?$', 'change_email', {}, name='email_change'), |
75 |
url(r'^email_change/confirm/(?P<activation_key>\w+)/?$', 'change_email', {}, |
76 |
name='email_change_confirm')
|
77 |
) |
78 |
|
79 |
urlpatterns += patterns('astakos.im.target',
|
80 |
url(r'^login/redirect/?$', 'redirect.login') |
81 |
) |
82 |
|
83 |
if 'local' in IM_MODULES: |
84 |
urlpatterns += patterns('astakos.im.target',
|
85 |
url(r'^local/?$', 'local.login'), |
86 |
url(r'^password_change/?$', 'local.password_change', { |
87 |
'post_change_redirect':'profile', |
88 |
'password_change_form':ExtendedPasswordChangeForm
|
89 |
}, |
90 |
name='password_change'),
|
91 |
url(r'^local/password_reset/done$', 'local.password_reset_done'), |
92 |
url(r'^local/reset/confirm/done$',
|
93 |
'local.password_reset_confirm_done')
|
94 |
) |
95 |
urlpatterns += patterns('django.contrib.auth.views',
|
96 |
url(r'^local/password_reset/?$', 'password_reset', { |
97 |
'email_template_name':'registration/password_email.txt', |
98 |
'password_reset_form':ExtendedPasswordResetForm,
|
99 |
'post_reset_redirect':'password_reset/done' |
100 |
}), |
101 |
url(r'^local/password_reset_done/?$', 'password_reset_done'), |
102 |
url(r'^local/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/?$',
|
103 |
'password_reset_confirm', {
|
104 |
'set_password_form':ExtendedSetPasswordForm,
|
105 |
'post_reset_redirect': 'done' |
106 |
}), |
107 |
url(r'^local/password/reset/complete/?$', 'password_reset_complete') |
108 |
) |
109 |
|
110 |
if INVITATIONS_ENABLED:
|
111 |
urlpatterns += patterns('astakos.im.views',
|
112 |
url(r'^invite/?$', 'invite', {}, name='invite') |
113 |
) |
114 |
|
115 |
if 'shibboleth' in IM_MODULES: |
116 |
urlpatterns += patterns('astakos.im.target',
|
117 |
url(r'^login/shibboleth/?$', 'shibboleth.login'), |
118 |
) |
119 |
|
120 |
if 'twitter' in IM_MODULES: |
121 |
urlpatterns += patterns('astakos.im.target',
|
122 |
url(r'^login/twitter/?$', 'twitter.login'), |
123 |
url(r'^login/twitter/authenticated/?$',
|
124 |
'twitter.authenticated'),
|
125 |
) |
126 |
|
127 |
if 'google' in IM_MODULES: |
128 |
urlpatterns += patterns('astakos.im.target',
|
129 |
url(r'^login/goggle/?$', 'google.login'), |
130 |
url(r'^login/google/authenticated/?$',
|
131 |
'google.authenticated'),
|
132 |
) |
133 |
if 'linkedin' in IM_MODULES: |
134 |
urlpatterns += patterns('astakos.im.target',
|
135 |
url(r'^login/linkedin/?$', 'linkedin.login'), |
136 |
url(r'^login/linkedin/authenticated/?$',
|
137 |
'linkedin.authenticated'),
|
138 |
) |
139 |
|
140 |
urlpatterns += patterns('astakos.im.api',
|
141 |
url(r'^get_services/?$', 'get_services'), |
142 |
url(r'^get_menu/?$', 'get_menu'), |
143 |
) |
144 |
|
145 |
urlpatterns += patterns('astakos.im.api.admin',
|
146 |
url(r'^authenticate/?$', 'authenticate_old'), |
147 |
#url(r'^authenticate/v2/?$', 'authenticate'),
|
148 |
url(r'^admin/api/v2.0/users/?$', 'get_user_by_email'), |
149 |
url(r'^admin/api/v2.0/users/(?P<user_id>.+?)/?$',
|
150 |
'get_user_by_username'),
|
151 |
) |
152 |
|
153 |
urlpatterns += patterns('astakos.im.api.service',
|
154 |
#url(r'^service/api/v2.0/tokens/(?P<token_id>.+?)/?$', 'validate_token'),
|
155 |
url(r'^service/api/v2.0/feedback/?$', 'send_feedback'), |
156 |
url(r'^service/api/v2.0/users/?$',
|
157 |
'get_user_by_email'),
|
158 |
url(r'^service/api/v2.0/users/(?P<user_id>.+?)/?$',
|
159 |
'get_user_by_username'),
|
160 |
) |