summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/middleware.py19
-rw-r--r--settings.py1
2 files changed, 0 insertions, 20 deletions
diff --git a/main/middleware.py b/main/middleware.py
index 8f249c6b..1e70b245 100644
--- a/main/middleware.py
+++ b/main/middleware.py
@@ -33,29 +33,10 @@ from django.http import HttpResponseRedirect
import re
import threading
-class RequireLoginMiddleware(object):
- """
- Require Login middleware. If enabled, each Django-powered page will
- require authentication.
-
- If an anonymous user requests a page, he/she is redirected to the login
- page set by LOGIN_URL.
- """
- def __init__(self):
- self.exceptionre = re.compile("(^/media/)|(^/robots.txt)|(^/login/)")
-
- def process_request(self, request):
- if request.user.is_anonymous() and not self.exceptionre.search(request.path):
- if request.POST:
- return login(request)
- else:
- return HttpResponseRedirect('%s?next=%s' % (settings.LOGIN_URL, request.path))
-
user_holder = threading.local()
user_holder.user = None
-# END REQUIRE LOGIN MIDDLEWARE
class AutoUserMiddleware(object):
'''Saves the current user so it can be retrieved by the admin'''
diff --git a/settings.py b/settings.py
index e0ca4d0b..dbc72cd2 100644
--- a/settings.py
+++ b/settings.py
@@ -49,7 +49,6 @@ MIDDLEWARE_CLASSES = (
'django.middleware.http.ConditionalGetMiddleware',
"django.middleware.common.CommonMiddleware",
"django.middleware.doc.XViewMiddleware",
- "archweb.main.middleware.RequireLoginMiddleware",
"archweb.main.middleware.AutoUserMiddleware",
)