소스 검색

added a protected method

advaced criterias are now implemented
master
DragonSkills99 5 년 전
부모
커밋
bf69f182f1
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8
    1
      chap-server.py

+ 8
- 1
chap-server.py 파일 보기

@@ -22,7 +22,7 @@ class CHAP:
# initializes class-instance and instance variables
def __init__(self):
self.key = '';
self.authenticated = 0;
self.authenticated = False;

# tells the server to start the autentification process
# and send the generated random salt
@@ -40,6 +40,13 @@ class CHAP:
self.authenticated = passhash == password_hash
return self.authenticated

# a little method that refuses to say hi, if you
# are not authenticated
def hello(self):
if ( self.authenticated ):
return 'Hi, you are authenticated'
else:
return 'Sorry, please authenticate first'
server.register_instance(CHAP())
# Run the server's main loop
server.serve_forever()

Loading…
취소
저장