Configure in ``settings.py`` or a ``.conf`` file in ``/etc/synnefo`` if using snf-webproject.
-================================= ============================================================================= ===========================================================================================
+=================================== ============================================================================= ===========================================================================================
Name Default value Description
-================================= ============================================================================= ===========================================================================================
+=================================== ============================================================================= ===========================================================================================
ASTAKOS_AUTH_TOKEN_DURATION one month Expiration time of newly created auth tokens
ASTAKOS_DEFAULT_USER_LEVEL 4 Default (not-invited) user level
ASTAKOS_INVITATIONS_PER_LEVEL {0:100, 1:2, 2:0, 3:0, 4:0} Number of user invitations per user level
ASTAKOS_DEFAULT_FROM_EMAIL GRNET Cloud <no-reply\@grnet.gr> ``from`` parameter passed in ``django.core.mail.send_mail``
ASTAKOS_DEFAULT_CONTACT_EMAIL support\@cloud.grnet.gr Contact email
ASTAKOS_DEFAULT_ADMIN_EMAIL support\@cloud.grnet.gr Administrator email to receive user creation notifications (if None disables notifications)
-ASTAKOS_IM_MODULES ['local', 'shibboleth'] Signup modules
+ASTAKOS_IM_MODULES ['local', 'shibboleth'] Signup modules
ASTAKOS_FORCE_PROFILE_UPDATE True Force user profile verification
ASTAKOS_INVITATIONS_ENABLED True Enable invitations
ASTAKOS_COOKIE_NAME _pithos2_a ``Key`` parameter passed in ``django.http.HttpResponse.set_cookie``
ASTAKOS_LOGIN_MESSAGES {} Notification messages to display on login page header
e.g. {'warning': 'Warning message (can contain html)'}
-ASTAKOS_PROFILE_EXTRA_LINKS {} messages to display as extra actions in account forms
+ASTAKOS_PROFILE_EXTRA_LINKS {} Messages to display as extra actions in account forms
e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
-ASTAKOS_RATELIMIT_RETRIES_ALLOWED 3 Number of unsuccessful login requests allowed for a specific account.
+ASTAKOS_RATELIMIT_RETRIES_ALLOWED 3 Number of unsuccessful login requests per minute allowed for a specific account.
When this number exceeds and ASTAKOS_RECAPTCHA_ENABLED is set the user has to solve a
captcha challenge.
-================================= ============================================================================= ===========================================================================================
+ASTAKOS_EMAILCHANGE_ENABLED False Enable email change mechanism
+ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS 10 Number of days that email change requests remain active
+=================================== ============================================================================= ===========================================================================================
Administrator functions
-----------------------
from astakos.im.faults import BadRequest, Unauthorized, InternalServerError, Fault
from astakos.im.models import AstakosUser
-from astakos.im.settings import CLOUD_SERVICES, INVITATIONS_ENABLED, COOKIE_NAME
+from astakos.im.settings import CLOUD_SERVICES, INVITATIONS_ENABLED, COOKIE_NAME, \
+EMAILCHANGE_ENABLED
from astakos.im.util import epoch
logger = logging.getLogger(__name__)
if user.has_usable_password():
l.append({ 'url': absolute(reverse('password_change')),
'name': "Change password" })
- l.append({'url':absolute(reverse('email_change')),
- 'name': "Change email"})
+ if EMAILCHANGE_ENABLED:
+ l.append({'url':absolute(reverse('email_change')),
+ 'name': "Change email"})
if INVITATIONS_ENABLED:
l.append({ 'url': absolute(reverse('astakos.im.views.invite')),
'name': "Invitations" })
# The number of unsuccessful login requests per minute allowed for a specific email
RATELIMIT_RETRIES_ALLOWED = getattr(settings, 'ASTAKOS_RATELIMIT_RETRIES_ALLOWED', 3)
-# # Set the expiration time of email change requests
+# If False the email change mechanism is disabled
+EMAILCHANGE_ENABLED = getattr(settings, 'ASTAKOS_EMAILCHANGE_ENABLED', False)
+
+# Set the expiration time (in days) of email change requests
EMAILCHANGE_ACTIVATION_DAYS = getattr(settings, 'ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS', 10)
from django.contrib.auth.views import password_change
from astakos.im.forms import ExtendedPasswordResetForm, LoginForm
-from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED
+from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, EMAILCHANGE_ENABLED
from astakos.im.views import signed_terms_required
urlpatterns = patterns('astakos.im.views',
url(r'^approval_terms/?$', 'approval_terms', {}, name='latest_terms'),
url(r'^approval_terms/(?P<term_id>\d+)/?$', 'approval_terms'),
url(r'^password/?$', 'change_password', {}, name='password_change'),
- url(r'^email_change/?$', 'change_email', {}, name='email_change'),
- url(r'^email_change/confirm/(?P<activation_key>\w+)/', 'change_email', {},
- name='email_change_confirm')
)
+if EMAILCHANGE_ENABLED:
+ urlpatterns += patterns('astakos.im.views',
+ url(r'^email_change/?$', 'change_email', {}, name='email_change'),
+ url(r'^email_change/confirm/(?P<activation_key>\w+)/', 'change_email', {},
+ name='email_change_confirm')
+)
+
urlpatterns += patterns('astakos.im.target',
url(r'^login/redirect/?$', 'redirect.login')
)