Separate provisioning into user and auth info
This commit is contained in:
parent
376d1bd911
commit
bc4d5cba8e
|
@ -13,7 +13,19 @@ def provisionUserData(num, nick, altnick, ident, realname, unused): # last field
|
|||
commands["controlpanel"].append("Set Ident %s %s" % (nick, ident))
|
||||
commands["controlpanel"].append("Set RealName %s %s" % (nick, realname))
|
||||
deliverRelayCommands(num, commands)
|
||||
return
|
||||
|
||||
def provisionAuthenticationData(num, nick, network, security, auth, password):
|
||||
commands = {}
|
||||
if auth == "sasl":
|
||||
commands["sasl"] = []
|
||||
commands["status"].append("LoadMod sasl")
|
||||
commands["sasl"].append("Mechanism plain")
|
||||
commands["sasl"].append("Set %s %s" % (nick, password))
|
||||
elif auth == "ns":
|
||||
commands["nickserv"] = []
|
||||
commands["status"].append("LoadMod nickserv")
|
||||
commands["nickserv"].append("Set %s" % password)
|
||||
deliverRelayCommands(num, commands, user=nick+"/"+network)
|
||||
|
||||
def provisionNetworkData(num, nick, network, host, port, security, auth, password):
|
||||
commands = {}
|
||||
|
@ -26,6 +38,7 @@ def provisionNetworkData(num, nick, network, host, port, security, auth, passwor
|
|||
commands["controlpanel"].append("AddServer %s %s %s +%s" % (nick, network, host, port))
|
||||
elif security == "plain":
|
||||
commands["controlpanel"].append("AddServer %s %s %s %s" % (nick, network, host, port))
|
||||
# Remove below and use provisionAuthenticationData() when registration implemented
|
||||
if auth == "sasl":
|
||||
stage2commands["sasl"] = []
|
||||
stage2commands["status"].append("LoadMod sasl")
|
||||
|
@ -35,6 +48,7 @@ def provisionNetworkData(num, nick, network, host, port, security, auth, passwor
|
|||
stage2commands["nickserv"] = []
|
||||
stage2commands["status"].append("LoadMod nickserv")
|
||||
stage2commands["nickserv"].append("Set %s" % password)
|
||||
# End
|
||||
if not main.config["ConnectOnCreate"]:
|
||||
stage2commands["status"].append("Disconnect")
|
||||
if main.config["Toggles"]["CycleChans"]:
|
||||
|
@ -42,7 +56,6 @@ def provisionNetworkData(num, nick, network, host, port, security, auth, passwor
|
|||
stage2commands["status"].append("LoadMod chansaver")
|
||||
deliverRelayCommands(num, commands,
|
||||
stage2=[[nick+"/"+network, stage2commands]])
|
||||
return
|
||||
|
||||
def provisionRelayForNetwork(num, alias, network):
|
||||
provisionNetworkData(num, alias, network,
|
||||
|
@ -51,7 +64,6 @@ def provisionRelayForNetwork(num, alias, network):
|
|||
main.network[network].security,
|
||||
main.network[network].auth,
|
||||
main.network[network].aliases[num]["password"])
|
||||
return
|
||||
|
||||
def provisionRelay(num, network):
|
||||
aliasObj = main.alias[num]
|
||||
|
@ -60,7 +72,6 @@ def provisionRelay(num, network):
|
|||
reactor.callLater(5, provisionRelayForNetwork, num, alias, network)
|
||||
if main.config["ConnectOnCreate"]:
|
||||
reactor.callLater(10, main.network[network].start_bot, num)
|
||||
return
|
||||
|
||||
def provisionMultipleRelays(net, relaysNeeded):
|
||||
numsProvisioned = []
|
||||
|
|
Loading…
Reference in New Issue