Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

No flood/duplicate post control...

Quote Reply
No flood/duplicate post control...
Just noticed you can post repeatedly with the same text. Or reply to a post with the same text. Or just hit back and have fun! Wink I think that feature is pretty important for the public release.


Muhammad
Quote Reply
Re: [Muhammad] No flood/duplicate post control... In reply to
It can easily be implemented by checking the title and description/post/message and UserID via querying the Post table. If there is an exact match, then serve up an error message or redirect to the forum where the user was at when he/she posted a topic.

I have this in my forum software built on LINKS SQL.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
Unfortunately it's not so easy - you can't do = with a TEXT/BLOB field on Oracle or MS SQL (not sure about postgres).

I think I'll have to use some sort of random ID that generates when you start to write a new post. Then if you attempted to post with the same ID, you would get an error message.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Or you could simply pull the ID of the post, and then check for that ID.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
The problem is that the ID doesn't exist until after you have posted, so there is no way to pass the ID as form input since it doesn't exist yet... Hence a unique post id other than the primary post_id column. Actually, there already _is_ a temporary ID used for identifying which attachments go with which post, so it shouldn't be too big a modification - just a matter of storing it with the post.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Really?

Pugdog wrote a MOD for Links SQL v.1.X that pulls the ID of the record and sends it as part of the email confirmation.

Couldn't that same logic be applied for this issue?
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
The post_id isn't known until after the post has been inserted into the database, and is figured out when the post is inserted. To put the protection there, we would have to know the post_id BEFORE inserting it, which can't be done... After inserting, we can do whatever we want with the post ID, but there is no way to adjust the information that will be sent when the user pressed "reload" on their browser and resubmits the form data. Hence the need for a independant random post ID that is generated as soon as you start writing a post (or reply).

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Muhammad] No flood/duplicate post control... In reply to
You can always do it with some javascript. Well this would prevent multiple posts of the same post, but not different posts in a small interval of time...

Adrian
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Okay...then why does the mod that Alex provides works for Link SQL v.1.X:

http://gossamer-threads.com/...mp;ubb=000547:Forum9

?????
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
It gets the ID after the link is inserted. To know what the ID is going to be before even MySQL knows it is impossible.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Okay...still seems like if you pull the ID like the codes that Alex provided, you can add codes to query the POSTS table in the "process_form" sub that checks the ID.

I understand what you saying, but it still seems like an easy fix to check the ID added.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
Check it for what, though?

I make a post, and let's say it gets post_id '123'.

Then, I hit refresh on my browser, and that post gets '124'. Or maybe someone has posted in the meantime and it gets '125' - there's not really any way to know. No matter how many times you hit refresh, you are never going to get post_id '123' again, so there's no way it can be used.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
I didn' read the whole post cause I am lazy, but if I was going to implement something to stop flooding the same message I would have a "Post Session" table, and store the MD5 hash of the message in there.

When you submit the post it does an MD5 of the message and compares it to posts in the "Post Session" table, and if the same message has been posted in the last 5 mins, don't let it go through...

Anyway - Thats an easy way to do it cause you are dealing with strings that are 32 characters long, rather then a huge post.

Cheers,

Michael Bray
Quote Reply
Re: [Michael_Bray] No flood/duplicate post control... In reply to
That's already exactly what I've done, and it's working just fine Wink

(Locally, of course, not here yet)

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Yea...but you neglected to implement this for REPLIES...

See the below link:

http://www.gossamer-threads.com/...?post=163523;#163523
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Yea...but you neglected to implement this for REPLIES...

See the below link:

http://www.gossamer-threads.com/...?post=163523;#163523

OR look below at all the duplicate replies I submitted...Wink

========================================
Buh Bye!

Cheers,
Me

Last edited by:

AnthroRules: Oct 14, 2001, 9:32 AM
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Yea...but you neglected to implement this for REPLIES...

See the below link:

http://www.gossamer-threads.com/...?post=163523;#163523
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Yea...but you neglected to implement this for REPLIES...

See the below link:

http://www.gossamer-threads.com/...?post=163523;#163523
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
When someone tries to submit a duplicate post, you should put an error message like "You have already submitted your post" or redirect the user to the Post that they submitted.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
Quote:
That's already exactly what I've done, and it's working just fine

(Locally, of course, not here yet)


Quote Reply
Re: [RedRum] No flood/duplicate post control... In reply to
Uh...REDRUM ( I mean PAUL WILSON)...it is working for POSTING but NOT REPLIES...TRY IT YOURSELF!

And I do mean here in the GT Support Forums, not in the released version of GT Forums, GOT IT?

========================================
Buh Bye!

Cheers,
Me

Last edited by:

AnthroRules: Oct 14, 2001, 9:38 AM
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
Right now I can post duplicates and reply with the same message multiple times, just as I could yesterday. So, I don't see any change made here yet.


Muhammad
Quote Reply
Re: [Muhammad] No flood/duplicate post control... In reply to
Welp, I guess not...I thought that when I posted a post and tried submitting it again, it didn't appear, but after refreshing the forum page, the duplicate post appeared...

Oh well...may be Jason will add it soon.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [AnthroRules] No flood/duplicate post control... In reply to
Yes, that would be nice. Wink


Muhammad
Quote Reply
Re: [Michael_Bray] No flood/duplicate post control... In reply to
Quote:
When you submit the post it does an MD5 of the message and compares it to posts in the "Post Session" table, and if the same message has been posted in the last 5 mins, don't let it go through...

What about a flood of 'me too' posts. ;) Guess include a check by the same user. Not sure I like the idea of having to md5 the entire message.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] No flood/duplicate post control... In reply to
Alex,

Doing the MD5 of the message + a check by the username would the best approach. To eliminate the flooding, you would really only need to limit the session to about 60-90 seconds.

The chances of two messages having the same MD5 hash is about 10000000000000000000000000 : 1 - so it is definately a better idea then checking against the entire message.

That way no one user can post the same message within the alloted time frame.
Cheers,
Michael Bray
Quote Reply
Re: [Alex] No flood/duplicate post control... In reply to
Have you guys found a way of doing it without MD5ing the whole message yet? Curious as to how you are going to do it.
Cheers,
Michael Bray
Quote Reply
Re: [no one in paticular!] No flood/duplicate post control... In reply to
Hmm. Just picked up on this thread. Has anyone got their heads around the logic needed for this yet? Seems like quite a headache. Easily implemented, but who's got the logic right?

The only true way to avoid flooding would be to moderate the forum and approve/dissaprove posts, right?

- wil
Quote Reply
Re: [no one in paticular!] No flood/duplicate post control... In reply to
I take it you're using an AUTO_INCREMENT field in your database, and leaving it blank, so the database fills it in automaticlaly when the record is added? I've done this with my database too, and it is quite annoying that the ID isn't actually stored or even created until the record has been added.

There is no way to query the next available ID in an AUTO_INCREMENT field, is there? Maybe this would be a work around? Not for this problem maybe, but it would be well useful for my program ;-)

- wil
Quote Reply
Re: [Wil] No flood/duplicate post control... In reply to
Quote:
There is no way to query the next available ID in an AUTO_INCREMENT field,

Clearly not as it doesn't exist yet.....I suppose you could always grab the last ID and add 1 Angelic

Last edited by:

RedRum: Oct 17, 2001, 5:05 AM
Quote Reply
Re: [RedRum] No flood/duplicate post control... In reply to
No. What happens when you delete an record, it happens to be the last record. You're then querying the database for the last ID, which is going to be 2 less than the current ID as you deleted a record.

So that wouldn't work.

- wil
Post deleted by RedRum In reply to

Last edited by:

RedRum: Oct 17, 2001, 7:24 AM
Quote Reply
Re: [Wil] No flood/duplicate post control... In reply to
GForum has been generating a temporary ID all along to keep track of attachments (due to that fact that there isn't a post to attach attachments to yet when you upload one). The only change needed was to store this unique post ID in the post table along with the post, and then prevent a post if that ID already exists. The ID is made up of 35 random characters - I think 64 ^ 35 ought to yield enough different results to not hit duplicates accidentally :)

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

Last edited by:

jagerman: Oct 20, 2001, 9:20 PM
Quote Reply
Re: [jagerman] No flood/duplicate post control... In reply to
Yep! Good idea.

- wil