Big problem with the antispam extension

Author Message

Sébastien Antoniotti

Sunday 18 March 2007 11:02:49 am

Hi,

I use the datatype extension for 2 months ago, and it always works fine, but since yesterday, I systematically get the validation error message, enven if I tape the write antispam code.

In order to "debug", I changed this in at the line 158 of the sckantispamtype.php

 if( $answer != $objectAttribute->content() )
                {
                    $objectAttribute->setValidationError( "Antispam code is incorrect_[\$answer:]_".$answer."_[\$objectAttribute->content:]_".$objectAttribute->content());
                    return EZ_INPUT_VALIDATOR_STATE_INVALID;
                }

So the error message is like this when the code displayed in the captcha is 00483 :

Antispam code is incorrect_[$answer:]_00483_[$objectAttribute->content:]_12482

It seems that $objectAttribute->content() doesn't contains the value that is used to make the captcha that is displayed at the end of the form, but I don't know why...

You can see this
at http://88.191.51.31/index.php/fr/articles/chansons_corses_et_versions_originales by trying to add a comment (button at the bottom of the page)

thanks in advance for your help !

eZ Publish Freelance
web : http://www.webaxis.fr

Sébastien Antoniotti

Wednesday 21 March 2007 6:50:47 am

please, did someone can try to help me a little ?

eZ Publish Freelance
web : http://www.webaxis.fr

Wednesday 21 March 2007 7:18:33 am

No one can see your install, you have http acl authentication on the url,
<i>http://88.191.51.31/index.php/fr/articles/chansons_corses_et_versions_originales</i>

Why not output the expected value and the submitted value to debug this statement ... many people use this extension with success.

//darken

Kristof Coomans

Wednesday 21 March 2007 7:20:04 am

Hi Sébastien

The URL you are referring too seems to be password protected.

Did you recently upgrade to another version of eZ publish, or did you modify some templates which could be related to the issue?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sébastien Antoniotti

Wednesday 21 March 2007 10:26:36 am

Hi,

Sorry for the htaccess protection, login is "dev" and password is "dev".

I don't made any upgrade or modification into related templates, moreother this bug is present in all classes that uses this datatype.

I have also replaced the extension/antispam folder, with the version avalaible on ez.no to avoid all doubt of file modification, but the bug is still here, and the code is too complex for me.

I know that this extention abitually works very well, I use it on many sites... I don't understand !

eZ Publish Freelance
web : http://www.webaxis.fr

Hans Melis

Wednesday 21 March 2007 3:31:54 pm

Hi Sébastien

I used the link you provided in your original post and I was able to submit a comment without a problem. Do you do anything special when it fails (submitting even though it won't validate, eg not filling out required information)?

Feel free to delete the comment I added :)

Hans
http://blog.hansmelis.be

Sébastien Antoniotti

Wednesday 21 March 2007 10:47:27 pm

Hi Hans,

Yesterday I have tried to install the ezcaptcha extension in order to replace the antispam datatype, just to test.

So I have copied the files, activate the extension, and edited the comment class to replace the antispam datatype by the ezcaptcha datatype, but the edition doesn't save my modifications, I have tried many times, cleared all caches, the antispam datatype is still here, I can't delete it, and I can't add another attribute on my comment class.
Perhaps this is because she has many objects, but why don't I get an ezpublish error message when trying to edit this class ?

So to conclude, since this manipulations, all is ok, comments can be nicely added...

Today I have to check all the parameters (the comment class, extensions, templates, etc.) in order to understand the origin of this bug.

Thanks for your help ! (and for your contrib !)

eZ Publish Freelance
web : http://www.webaxis.fr

Eugene Svirskyy

Wednesday 24 September 2008 6:55:52 am

2 Sébastien Antoniotti

There occurred an error in code of sckantispamtype.php v.1.1. To solve it:

1. Add including file at the top of the script
include_once( 'lib/ezutils/classes/ezinputvalidator.php' );

2. Change the original lines ## 161 and 166 so they look like
return eZInputValidator::STATE_INVALID;
return eZInputValidator::STATE_ACCEPTED;
instead of
return EZ_INPUT_VALIDATOR_STATE_INVALID;
return EZ_INPUT_VALIDATOR_STATE_ACCEPTED;

Hope this fix will help someone who uses eZ Publish 4 + antispam extension :-)

Serhey Dolgushev

Monday 16 March 2009 5:29:04 am

Hi!
http://ez.no/developer/contribs/datatypes/ib_captcha is good alternative for antispam

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:28:10
Script start
Timing: Jan 18 2025 11:28:10
Module start 'layout'
Timing: Jan 18 2025 11:28:10
Module start 'content'
Timing: Jan 18 2025 11:28:11
Module end 'content'
Timing: Jan 18 2025 11:28:11
Script end

Main resources:

Total runtime0.8784 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.1484153.4766
Module start 'layout' 0.00640.0024 742.625039.4219
Module start 'content' 0.00880.8681 782.0469785.9219
Module end 'content' 0.87690.0014 1,567.968824.1406
Script end 0.8783  1,592.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3522160.0002
Check MTime0.00130.1508160.0001
Mysql Total
Database connection0.00120.132510.0012
Mysqli_queries0.788289.7342830.0095
Looping result0.00090.1078810.0000
Template Total0.843596.020.4218
Template load0.00210.237620.0010
Template processing0.841495.794120.4207
Template load and register function0.00010.011610.0001
states
state_id_array0.00110.129010.0011
state_identifier_array0.00100.109720.0005
Override
Cache load0.00220.2498660.0000
Sytem overhead
Fetch class attribute can translate value0.00080.086560.0001
Fetch class attribute name0.00170.1988150.0001
XML
Image XML parsing0.00490.559560.0008
class_abstraction
Instantiating content class attribute0.00000.0037180.0000
General
dbfile0.00340.3857430.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 43
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs