diff options
author | bai | 2020-07-21 07:06:15 -0400 |
---|---|---|
committer | bai | 2020-07-21 07:06:15 -0400 |
commit | 8b7427763f8ec4cf76e69d26d4ff3d105a42dd41 (patch) | |
tree | 939586a5a32522b2c61779dd4fd8feeeda1595e0 | |
parent | da20a9f6bc08d959aaa8c06cf0d7d1675f122559 (diff) | |
download | weabot-8b7427763f8ec4cf76e69d26d4ff3d105a42dd41.tar.gz weabot-8b7427763f8ec4cf76e69d26d4ff3d105a42dd41.tar.xz weabot-8b7427763f8ec4cf76e69d26d4ff3d105a42dd41.zip |
Arreglados reportes con IPv6
-rw-r--r-- | cgi/manage.py | 4 | ||||
-rw-r--r-- | cgi/templates/manage/reports.html | 2 | ||||
-rwxr-xr-x | cgi/weabot.py | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/cgi/manage.py b/cgi/manage.py index 2aa8a5e..4ece445 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -1871,10 +1871,10 @@ def manage(self, path_split): # Tabla if 'board' in self.formdata.keys() and self.formdata['board'] != 'all': - reports = FetchAll("SELECT id, timestamp, timestamp_formatted, postid, parentid, link, board, INET6_NTOA(ip) AS ip, reason, reporterip FROM `reports` WHERE `board` = '%s' ORDER BY `timestamp` DESC LIMIT %d, %d" % ( + reports = FetchAll("SELECT id, timestamp, timestamp_formatted, postid, parentid, link, board, INET6_NTOA(ip) AS ip, reason, INET6_NTOA(repip) AS repip FROM `reports` WHERE `board` = '%s' ORDER BY `timestamp` DESC LIMIT %d, %d" % ( _mysql.escape_string(self.formdata['board']), currentpage*pagesize, pagesize)) else: - reports = FetchAll("SELECT id, timestamp, timestamp_formatted, postid, parentid, link, board, INET6_NTOA(ip) AS ip, reason, reporterip FROM `reports` ORDER BY `timestamp` DESC LIMIT %d, %d" % ( + reports = FetchAll("SELECT id, timestamp, timestamp_formatted, postid, parentid, link, board, INET6_NTOA(ip) AS ip, reason, INET6_NTOA(repip) AS repip FROM `reports` ORDER BY `timestamp` DESC LIMIT %d, %d" % ( currentpage*pagesize, pagesize)) if 'board' in self.formdata.keys(): diff --git a/cgi/templates/manage/reports.html b/cgi/templates/manage/reports.html index f47ec38..6095d50 100644 --- a/cgi/templates/manage/reports.html +++ b/cgi/templates/manage/reports.html @@ -45,7 +45,7 @@ ${message} <td><a href="#{report['link']}">${report['link']}</a></td> <td><a href="#{cgi_url}manage/ipshow?ip=${report['ip']}">${report['ip']}</a></td> <td>${report['reason']}</td> - <td><a href="#{cgi_url}manage/ipshow?ip=${report['reporterip']}">${report['reporterip']}</a></td> + <td><a href="#{cgi_url}manage/ipshow?ip=${report['repip']}">${report['repip']}</a></td> </tr> <?py #endfor ?> <tr> diff --git a/cgi/weabot.py b/cgi/weabot.py index 664fa02..c91570c 100755 --- a/cgi/weabot.py +++ b/cgi/weabot.py @@ -975,8 +975,10 @@ class weabot(object): message = cgi.escape(self.formdata["reason"]).strip()[0:8000] message = message.replace("\n", "<br />") - UpdateDb("INSERT INTO `reports` (board, postid, parentid, link, ip, reason, reporterip, timestamp, timestamp_formatted) VALUES ('%s', '%s', '%s', '%s', INET6_ATON('%s'), '%s', INET6_ATON('%s'), '%s', '%s')" % ( - board["dir"], post['id'], post['parentid'], link, post['ip'], _mysql.escape_string(message), _mysql.escape_string(self.environ["REMOTE_ADDR"]), str(t), formatTimestamp(t))) + UpdateDb("INSERT INTO `reports` (board, postid, parentid, link, ip, reason, repip, timestamp, timestamp_formatted) " + + "VALUES ('%s', '%s', '%s', '%s', '%s', '%s', INET6_ATON('%s'), '%s', '%s')" % ( + board["dir"], post['id'], post['parentid'], link, post['ip'], _mysql.escape_string(message), + _mysql.escape_string(self.environ["REMOTE_ADDR"]), str(t), formatTimestamp(t))) self.output = renderTemplate("report.html", {'finished': True}) def stats(self): |