summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-05-12 14:00:49 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-05-12 14:09:01 -0400
commita4cda02f044971f1031dd76d2dadf5d34dc58b5f (patch)
treec58519a66adb159fd20cbec16e9c6f4f8ec6dc05
parentb279caec89d9565f462930c659f30b278fa6fd50 (diff)
downloadaskbot-a4cda02f044971f1031dd76d2dadf5d34dc58b5f.tar.gz
askbot-a4cda02f044971f1031dd76d2dadf5d34dc58b5f.tar.bz2
askbot-a4cda02f044971f1031dd76d2dadf5d34dc58b5f.zip
added "allow account recovery by email" setting and incremented version
-rw-r--r--askbot/conf/user_settings.py13
-rw-r--r--askbot/deps/django_authopenid/views.py2
-rw-r--r--askbot/skins/default/templates/authopenid/signin.html2
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>