Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / messages.py @ 450093ec

History | View | Annotate | Download (11 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 import settings
35

    
36
ACCOUNT_AUTHENTICATION_FAILED           =   'Cannot authenticate account.'
37
ACCOUNT_ALREADY_ACTIVE                  =   'Account is already active.'
38
ACCOUNT_PENDING_ACTIVATION              =   'Your request is pending activation.'
39
ACCOUNT_PENDING_MODERATION              =   'Your request is pending moderation.'
40
ACCOUNT_INACTIVE                        =   'Your account is disabled.'
41
ACCOUNT_RESEND_ACTIVATION               =   'You have not followed the activation link. <a href="%(send_activation_url)s">Resend activation email?</a>'
42
INACTIVE_ACCOUNT_CHANGE_EMAIL           =   ''.join([ACCOUNT_RESEND_ACTIVATION, ' or <a href="%(signup_url)s">Provide new email?</a>'])
43

    
44
ACCOUNT_PENDING_ACTIVATION_HELP         =   'If you haven\'t received activation email, be sure to check your spam folder.'
45

    
46
ACCOUNT_ACTIVATED                       =   'Congratulations. Your account has' + \
47
                                            ' been activated and you have been' + \
48
                                            ' automatically signed in to your account.'
49
PASSWORD_RESET_DONE                     =   'A mail with details on how to change your password was sent.'
50
PASSWORD_RESET_CONFIRM_DONE             =   'Password changed. You can now login using your new password.'
51

    
52
ACCOUNT_RESEND_ACTIVATION_PROMPT        =   'Resend activation mail'
53
ACCOUNT_USER_ACTIVATION_PENDING         =   'You have not followed the activation link'
54

    
55
ACCOUNT_UNKNOWN                         =   'There is no such account.'
56
TOKEN_UNKNOWN                           =   'There is no user matching this token.'
57

    
58
PROFILE_UPDATED                         =   'Profile has been updated successfully.'
59
FEEDBACK_SENT                           =   'Feedback successfully sent.'
60
EMAIL_CHANGED                           =   'Account email has been changed successfully.'
61
EMAIL_CHANGE_REGISTERED                 =   'Change email request has been registered succefully. \
62
                                               You are going to receive a verification email in the new address.'
63

    
64
OBJECT_CREATED                          =   'The %(verbose_name)s was created successfully.'
65
MEMBER_JOINED_GROUP                     =   '%(realname)s has been successfully joined the group.'
66
MEMBER_REMOVED                          =   '%(realname)s has been successfully removed from the group.'
67
BILLING_ERROR                           =   'Service response status: %(status)d'
68
LOGOUT_SUCCESS                          =   'You have successfully logged out.'
69
LOGIN_SUCCESS                           =   'You have successfully logged in.'
70

    
71
GENERIC_ERROR                           =   'Something wrong has happened. \
72
                                               Please contact the administrators for more details.'
73

    
74
MAX_INVITATION_NUMBER_REACHED   =           'There are no invitations left.'
75
GROUP_MAX_PARTICIPANT_NUMBER_REACHED    =   'Group maximum participant number has been reached.'
76
NO_APPROVAL_TERMS                       =   'There are no approval terms.'
77
PENDING_EMAIL_CHANGE_REQUEST            =   'There is already a pending change email request. ' + \
78
                                            'Submiting a new email will cancel any previous requests.'
79
OBJECT_CREATED_FAILED                   =   'The %(verbose_name)s creation failed: %(reason)s.'
80
GROUP_JOIN_FAILURE                      =   'Failed to join group.'
81
GROUPKIND_UNKNOWN                       =   'There is no such a group kind'
82
NOT_MEMBER                              =   'User is not member of the group.'
83
NOT_OWNER                               =   'User is not a group owner.'
84
OWNER_CANNOT_LEAVE_GROUP                =   'Owner cannot leave the group.'
85

    
86
# Field validation fields
87
REQUIRED_FIELD                          =   'This field is required.'
88
EMAIL_USED                              =   'This email address is already in use. Please supply a different email address.'
89
SHIBBOLETH_EMAIL_USED                   =   'This email is already associated with another shibboleth account.'
90
SHIBBOLETH_INACTIVE_ACC                 =   'This email is already associated with an inactive account. \
91
                                               You need to wait to be activated before being able to switch to a shibboleth account.'
92
SHIBBOLETH_MISSING_EPPN                 =   'Missing unique token in request.'
93
SHIBBOLETH_MISSING_NAME                 =   'Missing user name in request.'
94

    
95
SIGN_TERMS                              =   'You have to agree with the terms.'
96
CAPTCHA_VALIDATION_ERR                  =   'You have not entered the correct words.'
97
SUSPENDED_LOCAL_ACC                     =   'Local login is not the current authentication method for this account.'
98
UNUSABLE_PASSWORD                       =   'This account has not a usable password.'
99
EMAIL_UNKNOWN                           =   'That e-mail address doesn\'t have an associated user account. \
100
                                               Are you sure you\'ve registered?'
101
INVITATION_EMAIL_EXISTS                 =   'There is already invitation for this email.'
102
INVITATION_CONSUMED_ERR                 =   'Invitation is used.'
103
UNKNOWN_USERS                           =   'Unknown users: %s'
104
UNIQUE_EMAIL_IS_ACTIVE_CONSTRAIN_ERR    =   'Another account with the same email & is_active combination found.'
105
INVALID_ACTIVATION_KEY                  =   'Invalid activation key.'
106
NEW_EMAIL_ADDR_RESERVED                 =   'The new email address is reserved.'
107
EMAIL_RESERVED                          =   'Email: %(email)s is reserved'
108
NO_LOCAL_AUTH                           =   'Local login is not the current authentication method for this account.'
109
SWITCH_ACCOUNT_FAILURE                  =   'Account failed to switch. Invalid parameters.'
110
SWITCH_ACCOUNT_SUCCESS_WITH_PROVIDER    =   'Account failed to switch to %(provider)s.'
111
SWITCH_ACCOUNT_SUCCESS                  =   'Account successfully switched to %(provider)s.'
112

    
113
# Field help text
114
ADD_GROUP_MEMBERS_Q_HELP                =   'Add comma separated user emails, eg. user1@user.com, user2@user.com'
115
ASTAKOSUSER_GROUPS_HELP                 =   'In addition to the permissions manually assigned, \
116
                                               this user will also get all permissions granted to each group he/she is in.'
117
EMAIL_CHANGE_NEW_ADDR_HELP              =   'Your old email address will be used until you verify your new one.'
118

    
119
EMAIL_SEND_ERR                          =   'Failed to send %s.'
120
ADMIN_NOTIFICATION_SEND_ERR             =   EMAIL_SEND_ERR % 'admin notification'
121
VERIFICATION_SEND_ERR                   =   EMAIL_SEND_ERR % 'verification'
122
INVITATION_SEND_ERR                     =   EMAIL_SEND_ERR % 'invitation'
123
GREETING_SEND_ERR                       =   EMAIL_SEND_ERR % 'greeting'
124
FEEDBACK_SEND_ERR                       =   EMAIL_SEND_ERR % 'feedback'
125
CHANGE_EMAIL_SEND_ERR                   =   EMAIL_SEND_ERR % 'feedback'
126
NOTIFICATION_SEND_ERR                   =   EMAIL_SEND_ERR % 'notification'
127

    
128
MISSING_NEXT_PARAMETER                  =   'No next parameter'
129

    
130
INVITATION_SENT                         =   'Invitation sent to %(email)s.'
131
VERIFICATION_SENT                       =   'Registration completed but account is not active yet. Account activation link was sent to your email address.'
132
SWITCH_ACCOUNT_LINK_SENT                =   'This email is already associated with another local account. \
133
                                               To change this account to a shibboleth one follow the link in the verification email sent to %(email)s. \
134
                                               Otherwise just ignore it.'
135
NOTIFICATION_SENT                       =   'Your request for an account was successfully received and is now pending approval. \
136
                                               You will be notified by email in the next few days. \
137
                                               Thanks for your interest in ~okeanos! The GRNET team.'
138
ACTIVATION_SENT                         =   'An email containing your activation link was sent to your email address.'
139

    
140
REGISTRATION_COMPLETED                  =   'Registration completed you can now login to your account.'
141

    
142
NO_RESPONSE                             =   'There is no response.'
143
NOT_ALLOWED_NEXT_PARAM                  =   'Not allowed next parameter.'
144
MISSING_KEY_PARAMETER                   =   'Missing key parameter.'
145
INVALID_KEY_PARAMETER                   =   'Invalid key.'
146
DOMAIN_VALUE_ERR                        =   'Enter a valid domain.'
147

    
148
# Auth providers messages
149
AUTH_PROVIDER_NOT_ACTIVE                     =   "'%(provider)s' is disabled"
150
AUTH_PROVIDER_NOT_ACTIVE_FOR_LOGIN           =   "Login using '%(provider)s' is disabled"
151
AUTH_PROVIDER_NOT_ACTIVE_FOR_USER            =   "You cannot login using '%(provider)s'"
152
AUTH_PROVIDER_NOT_ACTIVE_FOR_CREATE          =   "Signup using '%(provider)s' is disabled."
153
AUTH_PROVIDER_NOT_ACTIVE_FOR_ADD             =   "You cannot add %(provider)s login method."
154
AUTH_PROVIDER_ADDED                          =   "New login method added."
155
AUTH_PROVIDER_ADD_FAILED                     =   "Failed to add new login method."
156
AUTH_PROVIDER_ADD_EXISTS                     =   "Account already assigned to another user."
157
AUTH_PROVIDER_LOGIN_TO_ADD                   =   "The new login method will be assigned once you login to your account."
158
AUTH_PROVIDER_INVALID_LOGIN                  =   "No account exists."
159

    
160

    
161
messages = locals().keys()
162
for msg in messages:
163
    if msg == msg.upper():
164
        attr = "ASTAKOS_%s_MESSAGE" % msg
165
        settings_value = getattr(settings, attr, None)
166
        if settings_value:
167
            locals()[msg] = settings_value
168