2020-10-31 16:49:37 +00:00
|
|
|
import main
|
|
|
|
|
2022-07-21 12:39:41 +00:00
|
|
|
|
2020-10-31 16:49:37 +00:00
|
|
|
class RecheckauthCommand:
|
|
|
|
def __init__(self, *args):
|
|
|
|
self.recheckauth(*args)
|
|
|
|
|
2022-09-05 06:20:30 +00:00
|
|
|
def recheckauth(
|
|
|
|
self, addr, authed, data, obj, spl, success, failure, info, incUsage, length
|
|
|
|
):
|
2020-10-31 16:49:37 +00:00
|
|
|
if authed:
|
|
|
|
if length == 1:
|
|
|
|
for i in main.IRCPool.keys():
|
|
|
|
net = main.IRCPool[i].net
|
|
|
|
main.IRCPool[i].authenticated = False
|
|
|
|
main.IRCPool[i].regPing()
|
|
|
|
success("Successfully reset authentication status")
|
|
|
|
return
|
|
|
|
elif length == 2:
|
|
|
|
if not spl[1] in main.network.keys():
|
|
|
|
failure("No such network: %s" % spl[1])
|
|
|
|
return
|
|
|
|
for i in main.IRCPool.keys():
|
2022-07-21 12:40:05 +00:00
|
|
|
# num = main.IRCPool[i].num
|
2020-10-31 16:49:37 +00:00
|
|
|
net = main.IRCPool[i].net
|
|
|
|
if not net == spl[1]:
|
|
|
|
continue
|
|
|
|
main.IRCPool[i].authenticated = False
|
|
|
|
main.IRCPool[i].regPing()
|
|
|
|
success("Successfully reset authentication status on %s" % spl[1])
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage("recheckauth")
|
|
|
|
return
|
|
|
|
else:
|
|
|
|
incUsage(None)
|