aboutsummaryrefslogtreecommitdiff
path: root/cgi/post.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/post.py')
-rw-r--r--cgi/post.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/cgi/post.py b/cgi/post.py
index f40537d..e9fe083 100644
--- a/cgi/post.py
+++ b/cgi/post.py
@@ -953,15 +953,14 @@ def flood_check(t,post,boardid):
board = Settings._.BOARD
if not post["parentid"]:
- maxtime = t - int(board['threadsecs'])
- #lastpost = FetchOne("SELECT COUNT(*) FROM `posts` WHERE `ip` = '%s' and `parentid` = 0 and `boardid` = '%s' and IS_DELETED = 0 AND timestamp > %d" % (str(post["ip"]), boardid, maxtime), 0)
+ maxtime = round(t - int(board['threadsecs']))
+ #lastpost = FetchOne("SELECT COUNT(*) FROM `posts` WHERE `ip` = INET6_ATON('%s') and `parentid` = 0 and `boardid` = '%s' and IS_DELETED = 0 AND timestamp > %d" % (str(post["ip"]), boardid, int(maxtime)), 0)
# NO MATTER THE IP
- lastpost = FetchOne("SELECT COUNT(*) FROM `posts` WHERE `parentid` = 0 and `boardid` = '%s' and IS_DELETED = 0 AND timestamp > %d" % (boardid, maxtime), 0)
- pass
+ lastpost = FetchOne("SELECT COUNT(*) FROM `posts` WHERE `parentid` = 0 and `boardid` = '%s' and IS_DELETED = 0 AND timestamp > %d" % (boardid, int(maxtime)), 0)
else:
- maxtime = t - int(board['postsecs'])
- lastpost = FetchOne("SELECT COUNT(*) FROM `posts` WHERE `ip` = '%s' and `parentid` != 0 and `boardid` = '%s' and IS_DELETED = 0 AND timestamp > %d" % (str(post["ip"]), boardid, maxtime), 0)
+ maxtime = round(t - int(board['postsecs']))
+ lastpost = FetchOne("SELECT COUNT(*) FROM `posts` WHERE `ip` = INET6_ATON('%s') and `parentid` != 0 and `boardid` = '%s' and IS_DELETED = 0 AND timestamp > %d" % (str(post["ip"]), boardid, int(maxtime)), 0)
if int(lastpost[0]):
if post["parentid"]:
@@ -969,7 +968,7 @@ def flood_check(t,post,boardid):
else:
lastpost = FetchOne("SELECT `timestamp` FROM `posts` WHERE `parentid`=0 and `boardid`='%s' and IS_DELETED = 0 ORDER BY `timestamp` DESC" % (boardid), 0)
wait = int(int(board['threadsecs']) - (t - int(lastpost[0])))
- raise UserError, "Por favor espera " + str(wait) + " segundos antes de crear otro hilo."
+ raise UserError, "Espera " + str(wait) + " segundos antes de crear otro hilo."
def cut_home_msg(message, boardlength=0):
short_message = message.replace("<br />", " ")