Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

disable user login until issues on production server are resolved.

  • Loading branch information...
commit 6240cf9cc5605606fe7ad78048dc99a15eb38567 1 parent af4242a
@visiblegovernment authored
Showing with 17 additions and 5 deletions.
  1. +1 −0  settings.py
  2. +7 −0 templates/registration/login.html
  3. +9 −5 urls.py
View
1  settings.py
@@ -125,6 +125,7 @@
LOGIN_ERROR_URL = '/accounts/login/error/'
SOCIAL_AUTH_ERROR_KEY = 'socialauth_error'
LOGIN_REDIRECT_URL = '/accounts/home/'
+LOGIN_DISABLED = True
#################################################################################
# These variables Should be defined in the local settings file
View
7 templates/registration/login.html
@@ -2,6 +2,12 @@
{% load i18n %}
{% block title %}{% trans "Sign In" %}{% endblock %}
{% block content %}
+{% if login_disabled %}
+<div id='account-form'>
+ <h3>{% trans "Sign In" %}</h3>
+ <p>Sorry, user sign-in is temporarily disabled.</p>
+</div>
+{% else %}
<div id='account-form'>
<h3>{% trans "Sign In" %}</h3>
<form action="/accounts/login/" method="POST">{% csrf_token %}
@@ -37,5 +43,6 @@
</ul>
</div>
</div>
+{% endif %}
{% endblock %}
View
14 urls.py
@@ -22,12 +22,16 @@
(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
(r'^reset/(?P<uidb36>[-\w]+)/(?P<token>[-\w]+)/$', 'django.contrib.auth.views.password_reset_confirm'),
(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
- (r'^admin/', admin.site.urls,{'SSL':SSL_ON}),
- (r'^i18n/', include('django.conf.urls.i18n')),
- url(r'^login/(?P<backend>[^/]+)/$', social_auth, name='begin'),
- url(r'^disconnect/(?P<backend>[^/]+)/$', social_disconnect, name='socialdisconnect'),
)
+if not settings.LOGIN_DISABLED:
+ urlpatterns += patterns('',
+ (r'^admin/', admin.site.urls,{'SSL':SSL_ON}),
+ (r'^i18n/', include('django.conf.urls.i18n')),
+ url(r'^login/(?P<backend>[^/]+)/$', social_auth, name='begin'),
+ url(r'^disconnect/(?P<backend>[^/]+)/$', social_disconnect, name='socialdisconnect'),
+ )
+
urlpatterns += patterns('',
(r'^feeds/cities/(\d+)$', CityIdFeed()), # backwards compatibility
(r'^feeds/wards/(\d+)$', WardIdFeed()), # backwards compatibility
@@ -107,7 +111,7 @@
'template_name':'registration/login.html',
'authentication_form':FMSAuthenticationForm,
'extra_context':
- { 'providers': SUPPORTED_SOCIAL_PROVIDERS }}, name='auth_login'),
+ { 'providers': SUPPORTED_SOCIAL_PROVIDERS, 'login_disabled': settings.LOGIN_DISABLED }}, name='auth_login'),
url(r'^accounts/logout/$', auth_views.logout,
{'SSL':SSL_ON,
'next_page': '/'}, name='auth_logout' ),
Please sign in to comment.
Something went wrong with that request. Please try again.