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.

26 lines
712 B
Python

import main
class PassCommand:
def __init__(self, *args):
self.password(*args)
def password(
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
):
if authed:
info("You are already authenticated")
return
else:
if length == 2:
if spl[1] == main.config["Password"]:
success("Authenticated successfully")
obj.authed = True
return
else:
failure("Password incorrect")
obj.transport.loseConnection()
return
else:
incUsage("pass")