Implement authentication detection
* pending command to see which instances have never authenticated * authcheck command to see which instances are not currently authenticatedmaster
parent
586a337ea4
commit
097f100ec5
@ -0,0 +1,36 @@
|
||||
import main
|
||||
|
||||
class AuthcheckCommand:
|
||||
def __init__(self, *args):
|
||||
self.authcheck(*args)
|
||||
|
||||
def authcheck(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||
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:
|
||||
results.append("%s - %s: %s" % (net, num, main.alias[num]["nick"]))
|
||||
info("\n".join(results))
|
||||
return
|
||||
elif length == 2:
|
||||
if not spl[1] in main.IRCPool.keys():
|
||||
failure("No such instance: %s" % spl[1])
|
||||
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:
|
||||
results.append("%s - %s: %s" % (net, num, main.alias[num]["nick"]))
|
||||
info("\n".join(results))
|
||||
return
|
||||
else:
|
||||
incUsage("authcheck")
|
||||
return
|
||||
else:
|
||||
incUsage(None)
|
Loading…
Reference in New Issue