diff options
author | Ismael Carnales <icarnales@gmail.com> | 2009-10-30 17:00:30 -0200 |
---|---|---|
committer | Ismael Carnales <icarnales@gmail.com> | 2009-11-09 22:24:38 -0200 |
commit | 69404ac120f00afe2981bd28ee8f0ecf593d646e (patch) | |
tree | d40a19bb24aa33402a86fbc3bb4a17e03640ef76 /main | |
parent | 79f00ef686e0597cb197ed67ba1462aa60a530bb (diff) |
removed RequireLoginMiddleware
Diffstat (limited to 'main')
-rw-r--r-- | main/middleware.py | 19 |
1 files changed, 0 insertions, 19 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''' |