Improve authentication detection
Add a negative check in the event we are authenticated and registered, but not confirmed, as this fools other checks.pull/1/head
parent
bdb3d059e3
commit
45f02c323b
@ -0,0 +1,36 @@
|
||||
import main
|
||||
|
||||
class RecheckauthCommand:
|
||||
def __init__(self, *args):
|
||||
self.recheckauth(*args)
|
||||
|
||||
def recheckauth(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
|
||||
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
|
||||
results = []
|
||||
for i in main.IRCPool.keys():
|
||||
num = main.IRCPool[i].num
|
||||
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)
|
Loading…
Reference in New Issue