Merge branch 'master' of https://git.kmlabz.com/BiztProtoBois/server
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DESKTOP-DPA61F8\Benedek 2021-04-25 15:24:27 +02:00
commit f0c5281697
2 changed files with 15 additions and 3 deletions

View File

@ -104,8 +104,10 @@ class NetWrapper:
return b"LINOK"
else:
self.logout()
return b"LINERROR"
except Exception:
self.logout()
return b"LINERROR"
def recieveMessage(self) -> bytes:
status, msg = self.network.receive_msg(blocking=True)
@ -117,6 +119,7 @@ class NetWrapper:
return self.recieveEncryptedMessage(msg)
def logout(self) -> None:
self.serverInstance.logout()
self.clientAddr = ""
self.cipherkey = "".encode('UTF-8')
self.currentClientPublicKey = "".encode('UTF-8')

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
from server.authentication import Authetication
from executor import Executor
@ -18,10 +18,19 @@ class Server:
self.executor = Executor(homeDirectory)
def login(self, username: str, password: str) -> bool:
pass
auth = Authetication()
self.isAuthenticated = True
home_directory = auth.login(username, password)
if not home_directory:
return False
else:
return True
def logout(self) -> None:
pass
self.isAuthenticated = False
self.availableServer = False
self.homeDirectory = ""
self.currentDirectory = ""
def parseCommand(self, command: str) -> str:
parsedCommand = command.split(" ")