From 51377098013bb562d478f24e965bbff2e71593fb Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sun, 21 Aug 2011 14:59:43 +0200 Subject: [PATCH] Don't redirect good but unauthorized users (fixes #571) --- radicale/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index d2a7f38..27a5588 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -219,17 +219,18 @@ class Application(object): last_allowed = False if calendars: + # Calendars found status, headers, answer = function( environ, calendars, content, user) - elif user and self.acl.has_right(user, user, password): - # Check if the user/password couple matches, - # redirect user to his principal home in this case + elif user and last_allowed: + # Good user and no calendars found, redirect user to home location = "/%s/" % str(quote(user)) log.LOGGER.info("redirecting to %s" % location) status = client.FOUND headers = {"Location": location} answer = "Redirecting to %s" % location else: + # Unknown or unauthorized user status = client.UNAUTHORIZED headers = { "WWW-Authenticate":