Fix wrong login by setting _USER to None instead of root for issue1702

(transplanted from b5d732315dcd772077b68e7a07f56f4db01c53a1)
This commit is contained in:
Cédric Krier committed 2010-09-26 18:28:31 +02:00
1 parent e463511edf
commit bfc5ee3e4c
1 file changed
+4 -4
+4 -4
View File
@@ -6,7 +6,7 @@ import socket
from threading import Semaphore
_SOCK = None
_USER = 0
_USER = None
_USERNAME = ''
_SESSION = ''
_DATABASE = ''
@@ -133,11 +133,11 @@ def login(username, password, host, port, database):
_SOCK.reconnect()
except (socket.error, RuntimeError):
pass
_USER = 0
_USER = None
_SESSION = ''
return -1
if not res:
_USER = 0
_USER = None
_SESSION = ''
return -2
_USER = res[0]
@@ -166,7 +166,7 @@ def logout():
pass
_SOCK.disconnect()
_SOCK = None
_USER = 0
_USER = None
_USERNAME = ''
_SESSION = ''
_DATABASE = ''