Modify

Opened 9 years ago

Closed 8 years ago

#2706 closed enhancement (fixed)

RFE: Spamfilter support!

Reported by: Michael Medin Owned by: Radek Bartoň
Priority: normal Component: DiscussionPlugin
Severity: major Keywords: spam filter discussion forum
Cc: Trac Release: 0.11

Description

Since I got fed up with all the spam I started getting on my forum page I started looking around for a spam thingy without success so I sat down and added one instead.

It is a bit of hack since I don't know much about neither trac nor python but it seems to work :) The plugin adds an extension point for new posts and new topics and then adds an adapter to the "regular" spam filtering so you need to have the trac anti spam thingy installed and setup and working. I think maybe the adapters might have to be moved to their own module to work regardless of if the anti-spam is installed (since AFAIK tracdiscussion imports *) but I have not tested this.

Also I have only made this patch for 0.10 since I don't have any other version.

MickeM

Attachments (3)

tracdiscussion-anti-spam-patch.diff (3.9 KB) - added by Michael Medin 9 years ago.
anti-spam-fiter-path
spam.py (1.3 KB) - added by Michael Medin 9 years ago.
strange, the svn diff disregarded new files... well, here is the spam.py
tracdiscussion-0_11-anti-spam-patch.diff (4.1 KB) - added by Michael Medin 8 years ago.
hacked spam path for 0.11 branch

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by Michael Medin

anti-spam-fiter-path

Changed 9 years ago by Michael Medin

Attachment: spam.py added

strange, the svn diff disregarded new files... well, here is the spam.py

comment:1 Changed 9 years ago by Radek Bartoň

Status: newassigned

By a coencidence I wanted to implement this yesterday, becase spammers on my site really annoys me, but I didn't find a time. Thanks for your patch, I'll try to apply it ASAP.

comment:2 Changed 9 years ago by anonymous

Keywords: discussion added; discussuion removed

Hi.

Thanks for your spamfilter + discussion hack, it seems to be working in our trac (www.tribler.org). However the webadmin pages for tracdiscussion do not work anymore:

Traceback (most recent call last):

File "/data/trac-production/usr/lib/python2.3/site-packages/trac/web/main.py", line 388, in dispatch_request

dispatcher.dispatch(req)

File "/data/trac-production/usr/lib/python2.3/site-packages/trac/web/main.py", line 238, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/webadmin/web_ui.py", line 119, in process_request File "build/bdist.linux-x86_64/egg/tracdiscussion/admin.py", line 37, in process_admin_request File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 38, in init

AttributeError: 'DiscussionWebAdmin' object has no attribute 'discussion_manipulators'

Do you have the same problem, or do you know a solution?

comment:3 Changed 9 years ago by Radek Bartoň

Appending

  discussion_manipulators = ExtensionPoint(IDiscussionManipulator) 

to DiscussionAdmin class in admin.py should fix your problem.

BTW: Commit of this patch will not be so soon, I'm making some internal changes that should be made before and currently I don't have much time to work on Trac's plugins.

comment:4 Changed 9 years ago by Radek Bartoň

Priority: highnormal
Summary: [PATCH] Spamfilter support!RFE: Spamfilter support!

Because I don't care much about 0.10 branch clearness and because it's used more than 0.11 branch, I applied you patch almost without changes. 0.11 must wait for better implementation.

comment:5 Changed 9 years ago by Lachlan Musicman

Are there any plans on updating this soon?

Changed 8 years ago by Michael Medin

hacked spam path for 0.11 branch

comment:6 Changed 8 years ago by Michael Medin

Trac Release: 0.100.11

I just hacked together a quick patch to get spam filtering on 0.11 don't know if this is already "in there somewhere" but I did not find it so I added it (pretty much the same as before).

I tried doing it on trunc but I could not get trunc to work properly so I reverted back to 0.11 "stable" branch.

Please feel free to let me know if it works or not.

Michael Medin

comment:7 Changed 8 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

Implemented in r6309.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.