aboutsummaryrefslogtreecommitdiff
path: root/cgi/weabot.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/weabot.py')
-rwxr-xr-xcgi/weabot.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cgi/weabot.py b/cgi/weabot.py
index ec88cac..2597ac3 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -323,9 +323,7 @@ class weabot(object):
self.output += '<html xmlns="http://www.w3.org/1999/xhtml"><meta http-equiv="refresh" content="0;url=%s" /><body><p>...</p></body></html>' % url
elif path_split[1] == "banned":
OpenDb()
- packed_ip = self.environ["REMOTE_ADDR"]
- bans = FetchAll(
- "SELECT * FROM `bans` WHERE `ip` = INET6_ATON('"+str(packed_ip)+"')")
+ bans = FetchAll("SELECT * FROM `bans` WHERE INET6_ATON('"+self.environ["REMOTE_ADDR"]+"') BETWEEN `ipstart` AND `ipend`")
if bans:
for ban in bans:
if ban["boards"] != "":
@@ -335,7 +333,7 @@ class weabot(object):
if ban["boards"]:
boards_str = '/' + '/, /'.join(boards) + '/'
else:
- boards_str = _("all boards")
+ boards_str = 'todas'
if ban["until"] != "0":
expire = formatTimestamp(ban["until"])
else:
@@ -348,6 +346,7 @@ class weabot(object):
'added': formatTimestamp(ban["added"]),
'expire': expire,
'ip': self.environ["REMOTE_ADDR"],
+ 'ipstr': ban['ipstr'],
}
self.output = renderTemplate(
'banned.html', template_values)