urls.py 7.31 KB
Newer Older
Antony Chazapis's avatar
Antony Chazapis committed
1
# Copyright 2011-2012 GRNET S.A. All rights reserved.
2
#
3
4
5
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
6
#
7
8
9
#   1. Redistributions of source code must retain the above
#      copyright notice, this list of conditions and the following
#      disclaimer.
10
#
11
12
13
14
#   2. Redistributions in binary form must reproduce the above
#      copyright notice, this list of conditions and the following
#      disclaimer in the documentation and/or other materials
#      provided with the distribution.
15
#
16
17
18
19
20
21
22
23
24
25
26
27
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
30
31
32
33
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.

34
from django.conf.urls.defaults import patterns, url
35

36
37
38
39
from astakos.im.forms import (
    ExtendedPasswordResetForm,
    ExtendedPasswordChangeForm,
    ExtendedSetPasswordForm, LoginForm)
40
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, EMAILCHANGE_ENABLED
41

42
43
urlpatterns = patterns(
    'astakos.im.views',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
44
45
    url(r'^$', 'index', {}, name='index'),
    url(r'^login/?$', 'index', {}, name='login'),
46
47
48
49
50
    url(r'^profile/?$','edit_profile', {}, name='edit_profile'),
    url(r'^feedback/?$', 'feedback', {}, name='feedback'),
    url(r'^signup/?$', 'signup', {'on_success': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='signup'),
    url(r'^logout/?$', 'logout', {'template': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='logout'),
    url(r'^activate/?$', 'activate', {}, name='activate'),
51
    url(r'^approval_terms/?$', 'approval_terms', {}, name='latest_terms'),
52
    url(r'^approval_terms/(?P<term_id>\d+)/?$', 'approval_terms'),
53
    url(r'^send/activation/(?P<user_id>\d+)/?$', 'send_activation', {}, name='send_activation'),
54
    url(r'^resources/?$', 'resource_usage', {}, name='resource_usage'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
55

root's avatar
root committed
56
#    url(r'^billing/?$', 'billing', {}, name='billing'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
57
58
#    url(r'^timeline/?$', 'timeline', {}, name='timeline'),

59
60
61
62
63
64
65
66
67
68
    url(r'^projects/add/?$', 'project_add', {}, name='project_add'),
    url(r'^projects/update/(?P<application_id>\w+)/?$', 'project_update', {}, name='project_update'),
    url(r'^projects/?$', 'project_list', {}, name='project_list'),
    url(r'^projects/search/?$', 'project_search', {}, name='project_search'),
    url(r'^projects/(?P<application_id>\w+)/?$', 'project_detail', {}, name='project_detail'),
    url(r'^projects/(?P<application_id>\w+)/join/?$', 'project_join', {}, name='project_join'),
    url(r'^projects/(?P<application_id>\w+)/leave/?$', 'project_leave', {}, name='project_leave'),
    url(r'^projects/(?P<application_id>\w+)/(?P<user_id>\d+)/accept/?$', 'project_accept_member', {}, name='project_accept_member'),
    url(r'^projects/(?P<application_id>\w+)/(?P<user_id>\d+)/reject/?$', 'project_reject_member', {}, name='project_reject_member'),
    url(r'^projects/(?P<application_id>\w+)/(?P<user_id>\d+)/remove/?$', 'project_remove_member', {}, name='project_remove_member'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
69
    
70
    url(r'^projects/how_it_works/?$', 'how_it_works', {}, name='how_it_works'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
71
    url(r'^remove_auth_provider/(?P<pk>\d+)?$', 'remove_auth_provider', {}, name='remove_auth_provider'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
72
73
74
)


75
if EMAILCHANGE_ENABLED:
76
77
    urlpatterns += patterns(
        'astakos.im.views',
78
        url(r'^email_change/?$', 'change_email', {}, name='email_change'),
79
        url(r'^email_change/confirm/(?P<activation_key>\w+)/?$', 'change_email', {},
80
            name='email_change_confirm'))
81

82
83
84
urlpatterns += patterns(
    'astakos.im.target',
    url(r'^login/redirect/?$', 'redirect.login'))
85

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
86
if 'local' in IM_MODULES:
87
88
    urlpatterns += patterns(
        'astakos.im.target',
89
90
91
        url(r'^local/?$', 'local.login'),
        url(r'^password_change/?$', 'local.password_change', {
            'post_change_redirect':'profile',
92
            'password_change_form':ExtendedPasswordChangeForm},
93
94
95
96
            name='password_change'),
        url(r'^local/password_reset/done$', 'local.password_reset_done'),
        url(r'^local/reset/confirm/done$',
            'local.password_reset_confirm_done')
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
97
98
    )
    urlpatterns += patterns('django.contrib.auth.views',
99
100
101
        url(r'^local/password_reset/?$', 'password_reset', {
            'email_template_name':'registration/password_email.txt',
            'password_reset_form':ExtendedPasswordResetForm,
102
            'post_reset_redirect':'password_reset/done'}),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
103
        url(r'^local/password_reset_done/?$', 'password_reset_done'),
104
        url(r'^local/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/?$',
105
106
         'password_reset_confirm', {
             'set_password_form':ExtendedSetPasswordForm,
107
             'post_reset_redirect': 'done'}),
108
        url(r'^local/password/reset/complete/?$', 'password_reset_complete')
109
110
    )

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
111
if INVITATIONS_ENABLED:
112
113
114
    urlpatterns += patterns(
        'astakos.im.views',
        url(r'^invite/?$', 'invite', {}, name='invite'))
115

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
116
if 'shibboleth' in IM_MODULES:
117
118
    urlpatterns += patterns(
        'astakos.im.target',
119
        url(r'^login/shibboleth/?$', 'shibboleth.login'),
120
121
    )

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
122
if 'twitter' in IM_MODULES:
123
124
125
126
127
    urlpatterns += patterns(
        'astakos.im.target',
        url(r'^login/twitter/?$', 'twitter.login'),
        url(r'^login/twitter/authenticated/?$',
            'twitter.authenticated'))
128

129
if 'google' in IM_MODULES:
130
131
132
133
134
135
    urlpatterns += patterns(
        'astakos.im.target',
        url(r'^login/goggle/?$', 'google.login'),
        url(r'^login/google/authenticated/?$',
            'google.authenticated'))

136
if 'linkedin' in IM_MODULES:
137
138
139
140
141
142
143
144
145
146
    urlpatterns += patterns(
        'astakos.im.target',
        url(r'^login/linkedin/?$', 'linkedin.login'),
        url(r'^login/linkedin/authenticated/?$',
            'linkedin.authenticated'))

urlpatterns += patterns(
    'astakos.im.api',
    url(r'^get_services/?$', 'get_services'),
    url(r'^get_menu/?$', 'get_menu'))
147

148
149
150
151
urlpatterns += patterns(
    'astakos.im.api',
    url(r'^get_services/?$', 'get_services'),
    url(r'^get_menu/?$', 'get_menu'))
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
152

153
154
155
156
157
158
159
urlpatterns += patterns(
    'astakos.im.api.admin',
    url(r'^authenticate/?$', 'authenticate_old'),
    #url(r'^authenticate/v2/?$', 'authenticate'),
    url(r'^admin/api/v2.0/users/?$', 'get_user_by_email'),
    url(r'^admin/api/v2.0/users/(?P<user_id>.+?)/?$',
        'get_user_by_username'))
160

161
162
163
164
165
166
167
urlpatterns += patterns(
    'astakos.im.api.service',
    #url(r'^service/api/v2.0/tokens/(?P<token_id>.+?)/?$', 'validate_token'),
    url(r'^service/api/v2.0/feedback/?$', 'send_feedback'),
    url(r'^service/api/v2.0/users/?$',
        'get_user_by_email'),
    url(r'^service/api/v2.0/users/(?P<user_id>.+?)/?$',
168
        'get_user_by_username'))