Provision users with lowercase names

This commit is contained in:
Mark Veidemanis 2020-10-28 22:30:04 +00:00
parent 3bc65f8456
commit f848b5afd6
1 changed files with 13 additions and 11 deletions

View File

@ -8,28 +8,30 @@ def provisionUserNetworkData(num, nick, altnick, ident, realname, network, host,
stage2commands = {} stage2commands = {}
stage2commands["status"] = [] stage2commands["status"] = []
commands["controlpanel"] = [] commands["controlpanel"] = []
commands["controlpanel"].append("AddUser %s %s" % (nick, main.config["Relay"]["Password"])) user = nick.lower()
commands["controlpanel"].append("AddNetwork %s %s" % (nick, network)) commands["controlpanel"].append("AddUser %s %s" % (user, main.config["Relay"]["Password"]))
commands["controlpanel"].append("Set Nick %s %s" % (nick, nick)) commands["controlpanel"].append("AddNetwork %s %s" % (user, network))
commands["controlpanel"].append("Set Altnick %s %s" % (nick, altnick)) commands["controlpanel"].append("Set Nick %s %s" % (user, nick))
commands["controlpanel"].append("Set Ident %s %s" % (nick, ident)) commands["controlpanel"].append("Set Altnick %s %s" % (user, altnick))
commands["controlpanel"].append("Set RealName %s %s" % (nick, realname)) commands["controlpanel"].append("Set Ident %s %s" % (user, ident))
commands["controlpanel"].append("Set RealName %s %s" % (user, realname))
if security == "ssl": if security == "ssl":
commands["controlpanel"].append("SetNetwork TrustAllCerts %s %s true" % (nick, network)) # Don't judge me commands["controlpanel"].append("SetNetwork TrustAllCerts %s %s true" % (user, network)) # Don't judge me
commands["controlpanel"].append("AddServer %s %s %s +%s" % (nick, network, host, port)) commands["controlpanel"].append("AddServer %s %s %s +%s" % (user, network, host, port))
elif security == "plain": elif security == "plain":
commands["controlpanel"].append("AddServer %s %s %s %s" % (nick, network, host, port)) commands["controlpanel"].append("AddServer %s %s %s %s" % (user, network, host, port))
if not main.config["ConnectOnCreate"]: if not main.config["ConnectOnCreate"]:
stage2commands["status"].append("Disconnect") stage2commands["status"].append("Disconnect")
if main.config["Toggles"]["CycleChans"]: if main.config["Toggles"]["CycleChans"]:
stage2commands["status"].append("LoadMod disconkick") stage2commands["status"].append("LoadMod disconkick")
stage2commands["status"].append("LoadMod chansaver") stage2commands["status"].append("LoadMod chansaver")
deliverRelayCommands(num, commands, deliverRelayCommands(num, commands,
stage2=[[nick+"/"+network, stage2commands]]) stage2=[[user+"/"+network, stage2commands]])
def provisionAuthenticationData(num, nick, network, security, auth, password): def provisionAuthenticationData(num, nick, network, security, auth, password):
commands = {} commands = {}
commands["status"] = [] commands["status"] = []
user = nick.lower()
if auth == "sasl": if auth == "sasl":
commands["sasl"] = [] commands["sasl"] = []
commands["status"].append("LoadMod sasl") commands["status"].append("LoadMod sasl")
@ -39,7 +41,7 @@ def provisionAuthenticationData(num, nick, network, security, auth, password):
commands["nickserv"] = [] commands["nickserv"] = []
commands["status"].append("LoadMod nickserv") commands["status"].append("LoadMod nickserv")
commands["nickserv"].append("Set %s" % password) commands["nickserv"].append("Set %s" % password)
deliverRelayCommands(num, commands, user=nick+"/"+network) deliverRelayCommands(num, commands, user=user+"/"+network)
def provisionRelay(num, network): # provision user and network data def provisionRelay(num, network): # provision user and network data