1 | diff deluge-1.2.0_rc2\ \(2\)/deluge/core/authmanager.py deluge-1.2.0_rc2/deluge/core/authmanager.py |
---|
2 | 59a60 |
---|
3 | > self.__local_auth = [] |
---|
4 | 65a67 |
---|
5 | > self.__local_auth = [] |
---|
6 | 83c85,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 | > |
---|
14 | 86,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 | > |
---|
27 | 93a97,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") |
---|
40 | 142,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) |
---|