summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-01-03 20:01:23 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-01-03 20:01:23 -0300
commit707bc16c662ec779ac364e219e56bb5e1c368932 (patch)
tree62c45b5e1003de5fdf2862b711c0adfefe082e79
parent694c78e348d90e8dce2411fb860f5e824278f7de (diff)
downloadaskbot-707bc16c662ec779ac364e219e56bb5e1c368932.tar.gz
askbot-707bc16c662ec779ac364e219e56bb5e1c368932.tar.bz2
askbot-707bc16c662ec779ac364e219e56bb5e1c368932.zip
when internal login app is disabled, links to log in/log out disappear, assuming that the user will provide own
-rw-r--r--askbot/context.py2
-rw-r--r--askbot/doc/source/changelog.rst1
-rw-r--r--askbot/skins/default/templates/user_profile/user_info.html2
-rw-r--r--askbot/skins/default/templates/widgets/user_navigation.html6
4 files changed, 8 insertions, 3 deletions
diff --git a/askbot/context.py b/askbot/context.py
index f3665240..17ab35bd 100644
--- a/askbot/context.py
+++ b/askbot/context.py
@@ -21,6 +21,8 @@ def application_settings(request):
my_settings['LOGIN_URL'] = url_utils.get_login_url()
my_settings['LOGOUT_URL'] = url_utils.get_logout_url()
my_settings['LOGOUT_REDIRECT_URL'] = url_utils.get_logout_redirect_url()
+ my_settings['USE_ASKBOT_LOGIN_SYSTEM'] = 'askbot.deps.django_authopenid' \
+ in settings.INSTALLED_APPS
return {
'settings': my_settings,
'skin': get_skin(request),
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index 496ac21e..c228e158 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -14,6 +14,7 @@ Development version (not released yet)
* added minimal length of question title ond body
text to live settings and allowed body-less questions (Radim Řehůřek, Evgeny)
* allowed disabling use of gravatar site-wide (Rosandra Cuello Suñol)
+* when internal login app is disabled - links to login/logout/add-remove-login-methods are gone (Evgeny)
0.7.36 (Dec 20, 2011)
---------------------
diff --git a/askbot/skins/default/templates/user_profile/user_info.html b/askbot/skins/default/templates/user_profile/user_info.html
index d6d5db17..23218df5 100644
--- a/askbot/skins/default/templates/user_profile/user_info.html
+++ b/askbot/skins/default/templates/user_profile/user_info.html
@@ -35,7 +35,7 @@
<a href="{% url edit_user view_user.id %}">
{% trans %}update profile{% endtrans %}
</a>
- {% if request.user == view_user and settings.ALLOW_ADD_REMOVE_LOGIN_METHODS %}
+ {% if settings.USE_ASKBOT_LOGIN_SYSTEM and request.user == view_user and settings.ALLOW_ADD_REMOVE_LOGIN_METHODS %}
| <a href="{{ settings.LOGIN_URL }}?next={{ settings.LOGIN_URL }}">
{% trans %}manage login methods{% endtrans %}
</a>
diff --git a/askbot/skins/default/templates/widgets/user_navigation.html b/askbot/skins/default/templates/widgets/user_navigation.html
index ae892c39..761bc88e 100644
--- a/askbot/skins/default/templates/widgets/user_navigation.html
+++ b/askbot/skins/default/templates/widgets/user_navigation.html
@@ -5,8 +5,10 @@
{{ macros.moderation_items_link(request.user, moderation_items) }}
({{ macros.user_long_score_and_badge_summary(user) }})
</span>
- <a href="{{ settings.LOGOUT_URL }}?next={{ settings.LOGOUT_REDIRECT_URL }}">{% trans %}logout{% endtrans %}</a>
-{% else %}
+ {% if settings.USE_ASKBOT_LOGIN_SYSTEM %}
+ <a href="{{ settings.LOGOUT_URL }}?next={{ settings.LOGOUT_REDIRECT_URL }}">{% trans %}logout{% endtrans %}</a>
+ {% endif %}
+{% elif settings.USE_ASKBOT_LOGIN_SYSTEM %}
<a href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url}}">{% trans %}login{% endtrans %}</a>
{% endif %}