Commit 12e4efc4 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Change setting name

Refs: #2612
parent a69599b6
......@@ -89,7 +89,7 @@ ASTAKOS_ADMIN_NOTIFICATION_EMAIL_SUBJECT '%s alpha2 testing account created (
ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT '%s alpha2 testing account activated (%%(user)s)' % SITENAME Account activation helpdesk notification email subject
ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT 'Email change on %s alpha2 testing' % SITENAME Email change subject
ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT 'Password reset on %s alpha2 testing' % SITENAME Password change email subject
ASTAKOS_ENFORCE_TOKEN_RENEWAL True Enforce token renewal on password change/reset. If set to False, user can optionally decide
ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN True Enforce token renewal on password change/reset. If set to False, user can optionally decide
whether to renew the token or not.
=========================================== ============================================================================= ===========================================================================================
......
......@@ -51,7 +51,7 @@ from astakos.im.models import AstakosUser, Invitation, get_latest_terms, EmailCh
from astakos.im.settings import INVITATIONS_PER_LEVEL, DEFAULT_FROM_EMAIL, \
BASEURL, SITENAME, RECAPTCHA_PRIVATE_KEY, DEFAULT_CONTACT_EMAIL, \
RECAPTCHA_ENABLED, LOGGING_LEVEL, PASSWORD_RESET_EMAIL_SUBJECT, \
ENFORCE_TOKEN_RENEWAL
NEWPASSWD_INVALIDATE_TOKEN
from astakos.im.widgets import DummyWidget, RecaptchaWidget
from astakos.im.functions import send_change_email
......@@ -475,7 +475,7 @@ class ExtendedPasswordChangeForm(PasswordChangeForm):
Extends PasswordChangeForm by enabling user
to optionally renew also the token.
"""
if not ENFORCE_TOKEN_RENEWAL:
if not NEWPASSWD_INVALIDATE_TOKEN:
renew = forms.BooleanField(label='Renew token', required=False,
initial=True,
help_text='Unsetting this may result in security risk.')
......@@ -485,7 +485,7 @@ class ExtendedPasswordChangeForm(PasswordChangeForm):
def save(self, commit=True):
user = super(ExtendedPasswordChangeForm, self).save(commit=False)
if ENFORCE_TOKEN_RENEWAL or self.cleaned_data.get('renew'):
if NEWPASSWD_INVALIDATE_TOKEN or self.cleaned_data.get('renew'):
user.renew_token()
if commit:
user.save()
......@@ -496,7 +496,7 @@ class ExtendedSetPasswordForm(SetPasswordForm):
Extends SetPasswordForm by enabling user
to optionally renew also the token.
"""
if not ENFORCE_TOKEN_RENEWAL:
if not NEWPASSWD_INVALIDATE_TOKEN:
renew = forms.BooleanField(label='Renew token', required=False,
initial=True,
help_text='Unsetting this may result in security risk.')
......@@ -506,7 +506,7 @@ class ExtendedSetPasswordForm(SetPasswordForm):
def save(self, commit=True):
user = super(ExtendedSetPasswordForm, self).save(commit=False)
if ENFORCE_TOKEN_RENEWAL or self.cleaned_data.get('renew'):
if NEWPASSWD_INVALIDATE_TOKEN or self.cleaned_data.get('renew'):
try:
user = AstakosUser.objects.get(id=user.id)
except AstakosUser.DoesNotExist:
......
......@@ -119,4 +119,4 @@ PASSWORD_RESET_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_S
'Password reset on %s alpha2 testing' % SITENAME)
# Enforce token renewal on password change/reset
ENFORCE_TOKEN_RENEWAL = getattr(settings, 'ASTAKOS_ENFORCE_TOKEN_RENEWAL', True)
\ No newline at end of file
NEWPASSWD_INVALIDATE_TOKEN = getattr(settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
\ No newline at end of file
......@@ -112,4 +112,4 @@
#ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s alpha2 testing' % SITENAME
# Enforce token renewal on password change/reset
# ENFORCE_TOKEN_RENEWAL = getattr(settings, 'ASTAKOS_ENFORCE_TOKEN_RENEWAL', True)
NEWPASSWD_INVALIDATE_TOKEN = getattr(settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment