diff --git a/umap/context_processors.py b/umap/context_processors.py index 00d72b7f..3b0944a0 100644 --- a/umap/context_processors.py +++ b/umap/context_processors.py @@ -11,3 +11,8 @@ def version(request): return { 'UMAP_VERSION': __version__ } + +def authentication(request): + return { + 'ENABLE_ACCOUNT_LOGIN': settings.ENABLE_ACCOUNT_LOGIN + } diff --git a/umap/settings/base.py b/umap/settings/base.py index 2bc90cc2..89fc0757 100644 --- a/umap/settings/base.py +++ b/umap/settings/base.py @@ -110,6 +110,7 @@ TEMPLATE_CONTEXT_PROCESSORS += ( 'social.apps.django_app.context_processors.login_redirect', 'umap.context_processors.feedback_link', 'umap.context_processors.version', + 'umap.context_processors.authentication', ) TEMPLATE_LOADERS = ( @@ -134,6 +135,7 @@ MIDDLEWARE_CLASSES = ( # Auth / security # ============================================================================= +ENABLE_ACCOUNT_LOGIN = True AUTHENTICATION_BACKENDS += ( ) diff --git a/umap/settings/local.py.sample b/umap/settings/local.py.sample index 0bc52bdf..24d48fb0 100644 --- a/umap/settings/local.py.sample +++ b/umap/settings/local.py.sample @@ -37,6 +37,10 @@ COMPRESS_OFFLINE = True 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 = ( 'social.backends.github.GithubOAuth2', 'social.backends.bitbucket.BitbucketOAuth', diff --git a/umap/templates/registration/login.html b/umap/templates/registration/login.html index 4281cf38..3fc6dd88 100644 --- a/umap/templates/registration/login.html +++ b/umap/templates/registration/login.html @@ -1,6 +1,6 @@ {% load i18n %} -{% if True %} {# TODO: replace by check, whether local login is enabled #} +{% if ENABLE_ACCOUNT_LOGIN %}