2018-03-14 20:13:40 +00:00
|
|
|
import main
|
2018-02-23 22:05:40 +00:00
|
|
|
|
|
|
|
class Password:
|
|
|
|
def __init__(self, register):
|
|
|
|
register("pass", self.password)
|
|
|
|
|
|
|
|
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:
|
2018-03-14 20:13:40 +00:00
|
|
|
if spl[1] == main.config["Password"]:
|
2018-02-23 22:05:40 +00:00
|
|
|
success("Authenticated successfully")
|
|
|
|
obj.authed = True
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
failure("Password incorrect")
|
|
|
|
obj.transport.loseConnection()
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("pass")
|