From 6acb1067610ba5972e23cad7db4971a68b1950e7 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 28 Oct 2020 22:30:04 +0000 Subject: [PATCH] Provision users with lowercase names --- modules/provision.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/provision.py b/modules/provision.py index 2e0fab5..b00b592 100644 --- a/modules/provision.py +++ b/modules/provision.py @@ -8,28 +8,30 @@ def provisionUserNetworkData(num, nick, altnick, ident, realname, network, host, stage2commands = {} stage2commands["status"] = [] commands["controlpanel"] = [] - commands["controlpanel"].append("AddUser %s %s" % (nick, main.config["Relay"]["Password"])) - commands["controlpanel"].append("AddNetwork %s %s" % (nick, network)) - commands["controlpanel"].append("Set Nick %s %s" % (nick, nick)) - commands["controlpanel"].append("Set Altnick %s %s" % (nick, altnick)) - commands["controlpanel"].append("Set Ident %s %s" % (nick, ident)) - commands["controlpanel"].append("Set RealName %s %s" % (nick, realname)) + user = nick.lower() + commands["controlpanel"].append("AddUser %s %s" % (user, main.config["Relay"]["Password"])) + commands["controlpanel"].append("AddNetwork %s %s" % (user, network)) + commands["controlpanel"].append("Set Nick %s %s" % (user, nick)) + commands["controlpanel"].append("Set Altnick %s %s" % (user, altnick)) + commands["controlpanel"].append("Set Ident %s %s" % (user, ident)) + commands["controlpanel"].append("Set RealName %s %s" % (user, realname)) if security == "ssl": - commands["controlpanel"].append("SetNetwork TrustAllCerts %s %s true" % (nick, network)) # Don't judge me - commands["controlpanel"].append("AddServer %s %s %s +%s" % (nick, network, host, port)) + commands["controlpanel"].append("SetNetwork TrustAllCerts %s %s true" % (user, network)) # Don't judge me + commands["controlpanel"].append("AddServer %s %s %s +%s" % (user, network, host, port)) 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"]: stage2commands["status"].append("Disconnect") if main.config["Toggles"]["CycleChans"]: stage2commands["status"].append("LoadMod disconkick") stage2commands["status"].append("LoadMod chansaver") deliverRelayCommands(num, commands, - stage2=[[nick+"/"+network, stage2commands]]) + stage2=[[user+"/"+network, stage2commands]]) def provisionAuthenticationData(num, nick, network, security, auth, password): commands = {} commands["status"] = [] + user = nick.lower() if auth == "sasl": commands["sasl"] = [] commands["status"].append("LoadMod sasl") @@ -39,7 +41,7 @@ def provisionAuthenticationData(num, nick, network, security, auth, password): commands["nickserv"] = [] commands["status"].append("LoadMod nickserv") 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