Authentication: configure availability of account login (default True)
This commit is contained in:
parent
8f5b59604e
commit
5f63943458
4 changed files with 12 additions and 1 deletions
|
@ -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
|
||||||
|
}
|
||||||
|
|
|
@ -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 += (
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue