From 32be4ed4ad139173a1ffdf619b2133cd7bfc740c Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 16 Jan 2009 20:11:05 +0000 Subject: [PATCH] Fix being able to connect to a local daemon from another user account --- deluge/ui/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/deluge/ui/common.py b/deluge/ui/common.py index 33cdc6bad..ccd89264a 100644 --- a/deluge/ui/common.py +++ b/deluge/ui/common.py @@ -131,9 +131,15 @@ def get_localhost_auth_uri(uri): :param uri: the uri to add the authentication info to :returns: a localhost uri containing authentication information or None if the information is not available """ + u = urlparse.urlsplit(uri) + # If there is already a username in this URI, let's just return it since + # the user has provided credentials. + if u.username: + return uri + auth_file = deluge.configmanager.get_config_dir("auth") if os.path.exists(auth_file): - u = urlparse.urlsplit(uri) + for line in open(auth_file): try: username, password = line.strip().split(":")