Ticket #1050: diff.txt

File diff.txt, 1.7 KB (added by feanor13, 14 years ago)

Diff to authmanager to accept more than one local user

Line 
1diff deluge-1.2.0_rc2\ \(2\)/deluge/core/authmanager.py deluge-1.2.0_rc2/deluge/core/authmanager.py
259a60
3>       self.__local_auth = []
465a67
5>       self.__local_auth = []
683c85,89
7<         if username not in self.__auth:
8---
9>         if username == "localclient":
10>             for (saved_pwd, level) in self.__local_auth:
11>                 if saved_pwd == password:
12>                      return int(level)
13>             
1486,92c92,95
15<             if username not in self.__auth:
16<                 raise BadLoginError("Username does not exist")
17<
18<         if self.__auth[username][0] == password:
19<             # Return the users auth level
20<             return int(self.__auth[username][1])
21<         else:
22---
23>             for (saved_pwd, level) in self.__local_auth:
24>                 if saved_pwd == password:
25>                      return int(level)
26>             
2793a97,108
28>         else:
29>             if username not in self.__auth:
30>                 # Let's try to re-load the file.. Maybe it's been updated
31>                 self.__load_auth_file()
32>                 if username not in self.__auth:
33>                     raise BadLoginError("Username does not exist")
34>     
35>             if self.__auth[username][0] == password:
36>                 # Return the users auth level
37>                 return int(self.__auth[username][1])
38>             else:
39>                 raise BadLoginError("Password does not match")
40142,143c157,161
41<
42<             self.__auth[username.strip()] = (password.strip(), level)
43---
44>           
45>             if username.strip() == "localclient":
46>                 self.__local_auth.append((password.strip(), level))
47>             else:
48>                 self.__auth[username.strip()] = (password.strip(), level)