updated tupkgs to work with md5 passwords

This commit is contained in:
pjmattal 2005-01-23 21:47:35 +00:00
parent ea51039970
commit 94e2a43574

View file

@ -115,10 +115,13 @@ class ClientSocket(threading.Thread):
authdata = self.readMsg(1) authdata = self.readMsg(1)
print authdata print authdata
q = self.db.cursor() q = self.db.cursor()
m = md5.new()
m.update(authdata['password'][0])
encpw = m.hexdigest()
q.execute("SELECT ID, Suspended, AccountTypeID FROM Users WHERE Username = '"+ q.execute("SELECT ID, Suspended, AccountTypeID FROM Users WHERE Username = '"+
MySQLdb.escape_string(authdata['username'][0])+ MySQLdb.escape_string(authdata['username'][0])+
"' AND Passwd = '"+ "' AND Passwd = '"+
MySQLdb.escape_string(authdata['password'][0])+ MySQLdb.escape_string(encpw)+
"'") "'")
if q.rowcount == 0: if q.rowcount == 0:
self.sendMsg("result=FAIL") self.sendMsg("result=FAIL")