mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 01:48:40 +00:00
[WebUI] Fix errors from rearranging code in 2294670
This commit is contained in:
parent
22946700dd
commit
8d74c3f22a
1 changed files with 12 additions and 9 deletions
|
@ -42,11 +42,11 @@ from email.utils import formatdate
|
||||||
from twisted.internet.task import LoopingCall
|
from twisted.internet.task import LoopingCall
|
||||||
|
|
||||||
from deluge import component
|
from deluge import component
|
||||||
from deluge.ui.web.json_api import JSONComponent, export
|
|
||||||
from deluge.common import utf8_encoded
|
from deluge.common import utf8_encoded
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
AUTH_LEVEL_NONE = 0
|
AUTH_LEVEL_NONE = 0
|
||||||
AUTH_LEVEL_READONLY = 1
|
AUTH_LEVEL_READONLY = 1
|
||||||
AUTH_LEVEL_NORMAL = 5
|
AUTH_LEVEL_NORMAL = 5
|
||||||
|
@ -55,6 +55,17 @@ AUTH_LEVEL_ADMIN = 10
|
||||||
AUTH_LEVEL_DEFAULT = AUTH_LEVEL_NORMAL
|
AUTH_LEVEL_DEFAULT = AUTH_LEVEL_NORMAL
|
||||||
|
|
||||||
|
|
||||||
|
class AuthError(Exception):
|
||||||
|
"""
|
||||||
|
An exception that might be raised when checking a request for
|
||||||
|
authentication.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Import after as json_api imports the above AuthError and AUTH_LEVEL_DEFAULT
|
||||||
|
from deluge.ui.web.json_api import JSONComponent, export
|
||||||
|
|
||||||
|
|
||||||
def make_checksum(session_id):
|
def make_checksum(session_id):
|
||||||
return reduce(lambda x, y: x+y, map(ord, session_id))
|
return reduce(lambda x, y: x+y, map(ord, session_id))
|
||||||
|
|
||||||
|
@ -318,11 +329,3 @@ class Auth(JSONComponent):
|
||||||
else:
|
else:
|
||||||
log.error('Login failed (ClientIP %s)', __request__.getClientIP())
|
log.error('Login failed (ClientIP %s)', __request__.getClientIP())
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class AuthError(Exception):
|
|
||||||
"""
|
|
||||||
An exception that might be raised when checking a request for
|
|
||||||
authentication.
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue