SimpleMath AntiSpam Module

pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Thu, 2008-07-03 19:23

Hello, I was getting angry with captcha module in G2, because it didn't work as I expected - it still let bots pass the verification.

So I've made a really simple anti spam module - it just displays simple math question (like "how much is two and one?") and it expects getting correct result from the POST.

The very first version is just static - the question and the answer is hardcoded in the template and validation class, but if somebody wants to make it "randomized", feel free. I plan to add more "simple stupid questions" which should prevent bots from abusing my comments.

Enjoy it...

_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

AttachmentSize
commentantispam.zip7.42 KB
 
naim

Joined: 2008-08-25
Posts: 5
Posted: Mon, 2008-08-25 15:00

I tested the above plugin in my Gallery 2.3-RC-1, and now after login and answering the simple math prob, I get a blank http://gallery.example.com/main.php page.

Unable to login properly, so I can't disable the plugin. Tried manual removal via phpmyadmin, but unsuccesful - still getting the same math question and then blank page like above.

Tried this: http://codex.gallery2.org/Gallery2:FAQ#How_can_I_deactivate_a_module_when_I_am_unable_to_login.3F
- also unsuccessful.

Would appreciate help to disable this plugin properly, so that can login normally. Thanks.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2008-08-25 15:39

@blank page: usually a php error

see: http://codex.gallery2.org/Gallery2:FAQ#I_get_only_a_blank_screen_when_trying_to_view_my_Gallery.2C_what.27s_wrong.3F

@disable plugin:

are you sure you did *both* edits to the db tables, with the correct module name?

 
naim

Joined: 2008-08-25
Posts: 5
Posted: Mon, 2008-08-25 15:50

You mean these lines (plugin is called 'commentantispam').

UPDATE g2_PluginMap SET g_active=0 WHERE g_pluginId='commentantispam';
DELETE FROM g2_FactoryMap WHERE g_implModuleId='commentantispam';

Yes, I did. And did manual flushing of the cache too.

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Mon, 2008-08-25 20:27

This plugin isn't tested nor tried on 2.3 Gallery. Could you please send me a php error you are getting? Maybe something has changed in module interface but I'm not going to install pre-release versions of Gallery.

_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
naim

Joined: 2008-08-25
Posts: 5
Posted: Tue, 2008-08-26 02:31

Hi Pavel,

I found the error msg on the server log:

[Tue Aug 26 10:26:21 2008] [error] [client 218.111.211.81] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/nuraacom/public_html/album/modules/commentantispam/classes/SimpleMathValidationPlugin.inc:67) in /home/nuraacom/public_html/album/modules/core/classes/GalleryPhpVm.class on line 142, referer: http://album.nuraina.com/main.php?g2_view=core.UserAdmin&g2_subView=core.UserLogin&g2_return=%2Fmain.php%3F

 
naim

Joined: 2008-08-25
Posts: 5
Posted: Tue, 2008-08-26 15:44

Actually I had the same problem in 2.2.5. Anyway the server error msg is attached above. Hope you can help solve this prob. Thanks.

 
pavel.pola

Joined: 2007-05-19
Posts: 30
Posted: Fri, 2008-08-29 21:06

I'm using this plugin on 2.2.5 version of Gallery Core - as you can test on my site. I don't know why it happened but did you disable the old captcha plugin? What other plugins are you using? Naybe the problem is when both captcha plugins are allowed to modify the page. If you look into the source code - there is no line 67 in SimpleMathValidationPlugin.inc, so I hope the problem is somewere else - maybe some collision with another plugins you are using.

_________________________________
Please visit my personal gallery: http://www.pavelpola.cz (mostly B&W pictures, Prague, nature, people)

 
naim

Joined: 2008-08-25
Posts: 5
Posted: Tue, 2008-09-02 06:40

Thanks, Pavel. Will take a look at this possibility.

 
sloops

Joined: 2008-09-23
Posts: 1
Posted: Tue, 2008-09-23 20:23

Hi, I have the same problem Naim.
I have installed commentantispam and after login i have blank page.
Would appreciate help to disable this plugin properly, so that can login normally.

I have tested and not work :(
UPDATE g2_PluginMap SET g_active=0 WHERE g_pluginId='commentantispam';
DELETE FROM g2_FactoryMap WHERE g_implModuleId='commentantispam';
and flush cache.

Thank you for your help

 
anarchyinc666

Joined: 2009-08-01
Posts: 1
Posted: Sat, 2009-08-01 04:55

Has anyone figured out how to resolve this. It just happened to me as well, and the steps listed do not seem to work for me either.