Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / urls.py @ 85d444db

History | View | Annotate | Download (8.2 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 (
37
    ExtendedPasswordResetForm,
38
    ExtendedPasswordChangeForm,
39
    ExtendedSetPasswordForm, LoginForm)
40
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, EMAILCHANGE_ENABLED
41

    
42
urlpatterns = patterns(
43
    'astakos.im.views',
44
    url(r'^$', 'index', {}, name='index'),
45
    url(r'^login/?$', 'index', {}, name='login'),
46
    url(r'^profile/?$','edit_profile', {}, name='edit_profile'),
47
    url(r'^feedback/?$', 'feedback', {}, name='feedback'),
48
    url(r'^signup/?$', 'signup', {'on_success': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='signup'),
49
    url(r'^logout/?$', 'logout', {'template': 'im/login.html', 'extra_context': {'login_form': LoginForm()}}, name='logout'),
50
    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'),
55

    
56
#    url(r'^billing/?$', 'billing', {}, name='billing'),
57
#    url(r'^timeline/?$', 'timeline', {}, name='timeline'),
58

    
59
#     url(r'^group/add/complete/?$', 'group_add_complete', {}, name='group_add_complete'),
60
#     url(r'^group/add/(?P<kind_name>\w+)?$', 'group_add', {}, name='group_add'),
61
#     url(r'^group/list/?$', 'group_list', {}, name='group_list'),
62
#     url(r'^group/(?P<group_id>\d+)/?$', 'group_detail', {}, name='group_detail'),
63
#     url(r'^group/search/?$', 'group_search', {}, name='group_search'),
64
#     url(r'^group/all/?$', 'group_all', {}, name='group_all'),
65
#     url(r'^group/(?P<group_id>\d+)/join/?$', 'group_join', {}, name='group_join'),
66
#     url(r'^group/(?P<group_id>\d+)/leave/?$', 'group_leave', {}, name='group_leave'),
67
#     url(r'^group/(?P<group_id>\d+)/(?P<user_id>\d+)/approve/?$', 'approve_member', {}, name='approve_member'),
68
#     url(r'^group/(?P<group_id>\d+)/(?P<user_id>\d+)/disapprove/?$', 'disapprove_member', {}, name='disapprove_member'),
69
#     url(r'^group/create/?$', 'group_create_list', {}, name='group_create_list'),
70
    url(r'^projects/add/?$', 'project_add', {}, name='project_add'),
71
    url(r'^projects/update/(?P<application_id>\w+)/?$', 'project_update', {}, name='project_update'),
72
    url(r'^projects/?$', 'project_list', {}, name='project_list'),
73
    url(r'^projects/search/?$', 'project_search', {}, name='project_search'),
74
    url(r'^projects/(?P<application_id>\w+)/?$', 'project_detail', {}, name='project_detail'),
75
    url(r'^projects/(?P<application_id>\w+)/join/?$', 'project_join', {}, name='project_join'),
76
    url(r'^projects/(?P<application_id>\w+)/leave/?$', 'project_leave', {}, name='project_leave'),
77
    url(r'^projects/(?P<application_id>\w+)/(?P<user_id>\d+)/accept/?$', 'project_accept_member', {}, name='project_accept_member'),
78
    url(r'^projects/(?P<application_id>\w+)/(?P<user_id>\d+)/reject/?$', 'project_reject_member', {}, name='project_reject_member'),
79
    url(r'^projects/(?P<application_id>\w+)/(?P<user_id>\d+)/remove/?$', 'project_remove_member', {}, name='project_remove_member'),
80
    
81
    url(r'^projects/how_it_works/?$', 'how_it_works', {}, name='how_it_works'),
82
    url(r'^remove_auth_provider/(?P<pk>\d+)?$', 'remove_auth_provider', {}, name='remove_auth_provider'),
83
)
84

    
85

    
86
if EMAILCHANGE_ENABLED:
87
    urlpatterns += patterns(
88
        'astakos.im.views',
89
        url(r'^email_change/?$', 'change_email', {}, name='email_change'),
90
        url(r'^email_change/confirm/(?P<activation_key>\w+)/?$', 'change_email', {},
91
            name='email_change_confirm'))
92

    
93
urlpatterns += patterns(
94
    'astakos.im.target',
95
    url(r'^login/redirect/?$', 'redirect.login'))
96

    
97
if 'local' in IM_MODULES:
98
    urlpatterns += patterns(
99
        'astakos.im.target',
100
        url(r'^local/?$', 'local.login'),
101
        url(r'^password_change/?$', 'local.password_change', {
102
            'post_change_redirect':'profile',
103
            'password_change_form':ExtendedPasswordChangeForm},
104
            name='password_change'),
105
        url(r'^local/password_reset/done$', 'local.password_reset_done'),
106
        url(r'^local/reset/confirm/done$',
107
            'local.password_reset_confirm_done')
108
    )
109
    urlpatterns += patterns('django.contrib.auth.views',
110
        url(r'^local/password_reset/?$', 'password_reset', {
111
            'email_template_name':'registration/password_email.txt',
112
            'password_reset_form':ExtendedPasswordResetForm,
113
            'post_reset_redirect':'password_reset/done'}),
114
        url(r'^local/password_reset_done/?$', 'password_reset_done'),
115
        url(r'^local/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/?$',
116
         'password_reset_confirm', {
117
             'set_password_form':ExtendedSetPasswordForm,
118
             'post_reset_redirect': 'done'}),
119
        url(r'^local/password/reset/complete/?$', 'password_reset_complete')
120
    )
121

    
122
if INVITATIONS_ENABLED:
123
    urlpatterns += patterns(
124
        'astakos.im.views',
125
        url(r'^invite/?$', 'invite', {}, name='invite'))
126

    
127
if 'shibboleth' in IM_MODULES:
128
    urlpatterns += patterns(
129
        'astakos.im.target',
130
        url(r'^login/shibboleth/?$', 'shibboleth.login'),
131
    )
132

    
133
if 'twitter' in IM_MODULES:
134
    urlpatterns += patterns(
135
        'astakos.im.target',
136
        url(r'^login/twitter/?$', 'twitter.login'),
137
        url(r'^login/twitter/authenticated/?$',
138
            'twitter.authenticated'))
139

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

    
147
if 'linkedin' in IM_MODULES:
148
    urlpatterns += patterns(
149
        'astakos.im.target',
150
        url(r'^login/linkedin/?$', 'linkedin.login'),
151
        url(r'^login/linkedin/authenticated/?$',
152
            'linkedin.authenticated'))
153

    
154
urlpatterns += patterns(
155
    'astakos.im.api',
156
    url(r'^get_services/?$', 'get_services'),
157
    url(r'^get_menu/?$', 'get_menu'))
158

    
159
urlpatterns += patterns(
160
    'astakos.im.api',
161
    url(r'^get_services/?$', 'get_services'),
162
    url(r'^get_menu/?$', 'get_menu'))
163

    
164
urlpatterns += patterns(
165
    'astakos.im.api.admin',
166
    url(r'^authenticate/?$', 'authenticate_old'),
167
    #url(r'^authenticate/v2/?$', 'authenticate'),
168
    url(r'^admin/api/v2.0/users/?$', 'get_user_by_email'),
169
    url(r'^admin/api/v2.0/users/(?P<user_id>.+?)/?$',
170
        'get_user_by_username'))
171

    
172
urlpatterns += patterns(
173
    'astakos.im.api.service',
174
    #url(r'^service/api/v2.0/tokens/(?P<token_id>.+?)/?$', 'validate_token'),
175
    url(r'^service/api/v2.0/feedback/?$', 'send_feedback'),
176
    url(r'^service/api/v2.0/users/?$',
177
        'get_user_by_email'),
178
    url(r'^service/api/v2.0/users/(?P<user_id>.+?)/?$',
179
        'get_user_by_username'))