From d136e6a1e296703e1d3f7dec1baeb35a2934ee26 Mon Sep 17 00:00:00 2001 From: delizin Date: Sat, 1 Feb 2014 19:59:34 -0500 Subject: [PATCH] Fixed bans not being recognized --- contrib/menu_login.py | 4 ++-- src/commands/default/unloggedin.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/menu_login.py b/contrib/menu_login.py index d6ba94e0b1..6f7400690c 100644 --- a/contrib/menu_login.py +++ b/contrib/menu_login.py @@ -126,9 +126,9 @@ class CmdPasswordSelect(Command): # before going on, check eventual bans bans = ServerConfig.objects.conf("server_bans") - if bans and (any(tup[0]==player.name for tup in bans) + if bans and (any(tup[0]==player.name.lower() for tup in bans) or - any(tup[2].match(self.caller.address[0]) for tup in bans if tup[2])): + any(tup[2].match(self.caller.address) for tup in bans if tup[2])): # this is a banned IP or name! string = "{rYou have been banned and cannot continue from here." string += "\nIf you feel this ban is in error, please email an admin.{x" diff --git a/src/commands/default/unloggedin.py b/src/commands/default/unloggedin.py index aef0eea7be..0db44d09bf 100644 --- a/src/commands/default/unloggedin.py +++ b/src/commands/default/unloggedin.py @@ -82,9 +82,9 @@ class CmdUnconnectedConnect(MuxCommand): # Check IP and/or name bans bans = ServerConfig.objects.conf("server_bans") - if bans and (any(tup[0]==player.name for tup in bans) + if bans and (any(tup[0]==player.name.lower() for tup in bans) or - any(tup[2].match(session.address[0]) for tup in bans if tup[2])): + any(tup[2].match(session.address) for tup in bans if tup[2])): # this is a banned IP or name! string = "{rYou have been banned and cannot continue from here." string += "\nIf you feel this ban is in error, please email an admin.{x"