Authentication: configure availability of account login (default True)

This commit is contained in:
Stephan Bösch-Plepelits 2016-02-03 21:58:55 +01:00
parent 8f5b59604e
commit 5f63943458
4 changed files with 12 additions and 1 deletions

View file

@ -11,3 +11,8 @@ def version(request):
return { return {
'UMAP_VERSION': __version__ 'UMAP_VERSION': __version__
} }
def authentication(request):
return {
'ENABLE_ACCOUNT_LOGIN': settings.ENABLE_ACCOUNT_LOGIN
}

View file

@ -110,6 +110,7 @@ TEMPLATE_CONTEXT_PROCESSORS += (
'social.apps.django_app.context_processors.login_redirect', 'social.apps.django_app.context_processors.login_redirect',
'umap.context_processors.feedback_link', 'umap.context_processors.feedback_link',
'umap.context_processors.version', 'umap.context_processors.version',
'umap.context_processors.authentication',
) )
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
@ -134,6 +135,7 @@ MIDDLEWARE_CLASSES = (
# Auth / security # Auth / security
# ============================================================================= # =============================================================================
ENABLE_ACCOUNT_LOGIN = True
AUTHENTICATION_BACKENDS += ( AUTHENTICATION_BACKENDS += (
) )

View file

@ -37,6 +37,10 @@ COMPRESS_OFFLINE = True
LANGUAGE_CODE = 'en' LANGUAGE_CODE = 'en'
# Set to False if login into django account should not be possible. You can
# administer accounts in the admin interface.
ENABLE_ACCOUNT_LOGIN = True
AUTHENTICATION_BACKENDS = ( AUTHENTICATION_BACKENDS = (
'social.backends.github.GithubOAuth2', 'social.backends.github.GithubOAuth2',
'social.backends.bitbucket.BitbucketOAuth', 'social.backends.bitbucket.BitbucketOAuth',

View file

@ -1,6 +1,6 @@
{% load i18n %} {% load i18n %}
{% if True %} {# TODO: replace by check, whether local login is enabled #} {% if ENABLE_ACCOUNT_LOGIN %}
<h5>{% trans "Please log in with your account" %}</h5> <h5>{% trans "Please log in with your account" %}</h5>
<div> <div>