You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
698 B
Python
24 lines
698 B
Python
7 years ago
|
import main
|
||
7 years ago
|
|
||
2 years ago
|
|
||
5 years ago
|
class PassCommand:
|
||
6 years ago
|
def __init__(self, *args):
|
||
|
self.password(*args)
|
||
7 years ago
|
|
||
2 years ago
|
def password(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||
7 years ago
|
if authed:
|
||
|
info("You are already authenticated")
|
||
|
return
|
||
|
else:
|
||
|
if length == 2:
|
||
7 years ago
|
if spl[1] == main.config["Password"]:
|
||
7 years ago
|
success("Authenticated successfully")
|
||
|
obj.authed = True
|
||
|
return
|
||
|
else:
|
||
|
failure("Password incorrect")
|
||
|
obj.transport.loseConnection()
|
||
|
return
|
||
|
else:
|
||
|
incUsage("pass")
|