From de1e57081b08294325cf2df502bd9077f8d0132e Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 28 Jun 2013 16:39:09 +0200 Subject: [PATCH] Put the realm in the configuration file (fix #37) --- config | 2 ++ radicale/__init__.py | 2 +- radicale/config.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config b/config index bf0c85d..453a45e 100644 --- a/config +++ b/config @@ -29,6 +29,8 @@ key = /etc/apache2/ssl/server.key dns_lookup = True # Root URL of Radicale (starting and ending with a slash) base_prefix = / +# Message displayed in the client when a password is needed +realm = Radicale - Password Required lol [encoding] diff --git a/radicale/__init__.py b/radicale/__init__.py index f022f95..75cab63 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -59,7 +59,7 @@ NOT_ALLOWED = (client.FORBIDDEN, {}, None) # non-public information w/o submitting proper authentication credentials WRONG_CREDENTIALS = ( client.UNAUTHORIZED, - {"WWW-Authenticate": "Basic realm=\"Radicale - Password Required\""}, + {"WWW-Authenticate": "Basic realm=\"%s\"" % config.get("server", "realm")}, None) diff --git a/radicale/config.py b/radicale/config.py index 0fff237..45b758f 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -46,7 +46,8 @@ INITIAL_CONFIG = { "certificate": "/etc/apache2/ssl/server.crt", "key": "/etc/apache2/ssl/server.key", "dns_lookup": "True", - "base_prefix": "/"}, + "base_prefix": "/", + "realm": "Radicale - Password Required"}, "encoding": { "request": "utf-8", "stock": "utf-8"},