2020-05-31 20:52:56 +00:00
|
|
|
import main
|
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2020-05-31 20:52:56 +00:00
|
|
|
class AuthcheckCommand:
|
|
|
|
def __init__(self, *args):
|
|
|
|
self.authcheck(*args)
|
|
|
|
|
2022-09-05 06:20:30 +00:00
|
|
|
def authcheck(
|
|
|
|
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
|
|
|
|
):
|
2020-05-31 20:52:56 +00:00
|
|
|
if authed:
|
|
|
|
if length == 1:
|
|
|
|
results = []
|
|
|
|
for i in main.IRCPool.keys():
|
|
|
|
num = main.IRCPool[i].num
|
|
|
|
net = main.IRCPool[i].net
|
|
|
|
if not main.IRCPool[i].authenticated:
|
2022-09-05 06:20:30 +00:00
|
|
|
results.append(
|
|
|
|
"%s - %s: %s" % (net, num, main.alias[num]["nick"])
|
|
|
|
)
|
2020-05-31 20:52:56 +00:00
|
|
|
info("\n".join(results))
|
|
|
|
return
|
|
|
|
elif length == 2:
|
2020-10-31 16:49:37 +00:00
|
|
|
if not spl[1] in main.network.keys():
|
|
|
|
failure("No such network: %s" % spl[1])
|
2020-05-31 20:52:56 +00:00
|
|
|
return
|
|
|
|
results = []
|
|
|
|
for i in main.IRCPool.keys():
|
|
|
|
num = main.IRCPool[i].num
|
|
|
|
net = main.IRCPool[i].net
|
|
|
|
if not net == spl[1]:
|
|
|
|
continue
|
|
|
|
if not main.IRCPool[i].authenticated:
|
2022-09-05 06:20:30 +00:00
|
|
|
results.append(
|
|
|
|
"%s - %s: %s" % (net, num, main.alias[num]["nick"])
|
|
|
|
)
|
2020-05-31 20:52:56 +00:00
|
|
|
info("\n".join(results))
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("authcheck")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|