diff options
Diffstat (limited to 'cgi/framework.py')
-rw-r--r-- | cgi/framework.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cgi/framework.py b/cgi/framework.py index dfaff3d..83624a8 100644 --- a/cgi/framework.py +++ b/cgi/framework.py @@ -49,8 +49,11 @@ def cleanDir(path, ext=None): os.remove(os.path.join(path, f)) -def addressIsBanned(ip, board): - bans = FetchAll("SELECT * FROM `bans` WHERE INET6_ATON('"+str(ip)+"') BETWEEN `ipstart` AND `ipend`") +def addressIsBanned(ip, board, blind_only=False): + query = "SELECT * FROM `bans` WHERE INET6_ATON('"+str(ip)+"') BETWEEN `ipstart` AND `ipend`" + if blind_only: + query += " AND `blind` = '1'" + bans = FetchAll(query) for ban in bans: if ban["boards"] != "": boards = pickle.loads(ban["boards"]) |