From a4cda02f044971f1031dd76d2dadf5d34dc58b5f Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 12 May 2011 14:00:49 -0400 Subject: added "allow account recovery by email" setting and incremented version --- askbot/conf/user_settings.py | 13 +++++++++++-- askbot/deps/django_authopenid/views.py | 2 ++ askbot/skins/default/templates/authopenid/signin.html | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/askbot/conf/user_settings.py b/askbot/conf/user_settings.py index 142a5b16..45d29355 100644 --- a/askbot/conf/user_settings.py +++ b/askbot/conf/user_settings.py @@ -14,8 +14,17 @@ settings.register( livesettings.BooleanValue( USER_SETTINGS, 'EDITABLE_SCREEN_NAME', - default=True, - description=_('Allow editing user screen name') + default = True, + description = _('Allow editing user screen name') + ) +) + +settings.register( + livesettings.BooleanValue( + USER_SETTINGS, + 'ALLOW_ACCOUNT_RECOVERY_BY_EMAIL', + default = True, + description = _('Allow account recovery by email') ) ) diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index 2ab856d2..cb5994c4 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -1087,6 +1087,8 @@ def account_recover(request, key = None): url name 'user_account_recover' """ + if not askbot_settings.ALLOW_ACCOUNT_RECOVERY_BY_EMAIL: + raise Http404 if request.method == 'POST': form = forms.AccountRecoveryForm(request.POST) if form.is_valid(): diff --git a/askbot/skins/default/templates/authopenid/signin.html b/askbot/skins/default/templates/authopenid/signin.html index 01b01b25..9133fa9c 100644 --- a/askbot/skins/default/templates/authopenid/signin.html +++ b/askbot/skins/default/templates/authopenid/signin.html @@ -162,7 +162,7 @@ {% endif %} {% if view_subtype != 'email_sent' or view_subtype == 'bad_key' %} - {% if user.is_anonymous() %} + {% if user.is_anonymous() and settings.ALLOW_ACCOUNT_RECOVERY_BY_EMAIL %}
{% csrf_token %} {% if view_subtype != 'bad_key' %}

{% trans %}Still have trouble signing in?{% endtrans %}

-- cgit v1.2.3-1-g7c22