1

Topic: had a problem with the time on the server, punbb is broken...

Post errors
The following errors need to be corrected before the message can be posted:
At least 0 seconds have to pass between posts. Please wait a little while and try posting again.

the time on the server was wrong (7 hours in the future) and around 10 messages where posted in that time,
i tried to change the timecodes in de database, and that worked, until the error while trying to post.

so i've deleted the 10 posts, but still no luck,

does anyone have a clue?

2 (edited by Smartys 2006-08-11 02:10)

Re: had a problem with the time on the server, punbb is broken...

OK, the issue is as follows:
When you post, you have a last_post value set as the current timestamp. When you go to post, the current timestamp is subtracted from your stored timestamp and that value is compared to the flood timeout you have.
So, in your case, you posted. Lets say that gives you a timestamp of 5. You go to post, the timestamp is currently 6.  So 1 second has passed since you posted. Since 1 > 0, you can post.
However, instead of posting you set the clock back. The timestamp becomes 2.
It returns false, since you've technically posted in the future and -3 seconds have passed.

The fix for this (which is probably somewhere on Rickard's to-do list) is to change this line in post.php

        // Flood protection
        if (!$pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'])
                $errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];

to

        // Flood protection
        if (!$pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood'] && (time() - $pun_user['last_post']) >= 0)
                $errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];

The >= 0 bit simply makes sure that flood checking isn't triggered when time() is messed with

3

Re: had a problem with the time on the server, punbb is broken...

thx! that solved it!