Example #1
0
 def authenticate(self,socket):
     
     data = self.database
     user = common.recvData(socket,1024)
     
     if user is not None:
         name,pswd = user
 
         if name in data:
             if data[name] == pswd:
 
                 self.addConnection()
                 common.sendData(socket,1)
  
             else:
                 common.sendData(socket,0)
         else:
             common.sendData(socket,0)
     else:
         common.sendData(socket,0)
Example #2
0
 def authenticate(self):
     common.sendData(self.socket,(self.data.username,self.data.password))
     self.data.status = common.recvData(self.socket,1024)