diff options
-rw-r--r-- | askbot/conf/user_settings.py | 13 | ||||
-rw-r--r-- | askbot/deps/django_authopenid/views.py | 2 | ||||
-rw-r--r-- | 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 @@ </form>
{% 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 %}
<form id="account-recovery-form" action="{% url user_account_recover %}" method="post">{% csrf_token %}
{% if view_subtype != 'bad_key' %}
<h2 id='account-recovery-heading'>{% trans %}Still have trouble signing in?{% endtrans %}</h2>
|