Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW: Anti Robot Registration Validation


Druide

Recommended Posts

  • 2 months later...
Hello,

 

great contrib, it works nearly perfect, except of two things:

 

1) It does not print out any error message when typing in the wrong validation code. it simply returns to for example the create account page. If you enter the right code, it jumps to the success page. Any Idea what to do to get the error messages running? (see also Elvis)

 

2) If I use other lenghts than the default 5 of the code, I won't get any error, but as well no success. It just returns me to the last page. Took me half an hour to realise why I couldn't create new users on a testshop (I've changed it to 6).

 

Any hints, tips, solutions for me?

 

Regards,

 

Hans

 

Hi!

 

For the point 2) I would suggest to stay on that 5.. :-)

For the point 1) I had the same problem, and found that there was a <?php ?> clause missing in create_account.php. So, assuming you have done exactly what the contributor has hinted do something like this:

 

open catalog/create_account.php

 

/======== FIND THIS (in the end of the file)==========/

 

<?php

if ($entry_antirobotreg_error == true) {

?>

<span>

<?php

$validation_images = '';

 

for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++)

{

$validation_images .= tep_image(DIR_WS_IMAGES . 'validation/validation_' . $reg_key{$i} . '.gif') . '';

}

echo $validation_images . ' <br> ';

echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . '<br>' .

 

$text_antirobotreg_error . '</b></font>';

} else {

?>

 

 

/======== REPLACE IT WITH THIS ==========/

 

<?php

if ($entry_antirobotreg_error == true) {

?>

<span>

<?php

$validation_images = '';

for($i = 0; $i < ENTRY_VALIDATION_LENGTH; $i++)

{

$validation_images .= tep_image(DIR_WS_IMAGES . 'validation/validation_' . $reg_key{$i} . '.gif') . '';

}

 

echo $validation_images . ' <br> ';

?>

<?php echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . ' ' .

$text_antirobotreg_error . '</b></font>';

 

} else {

?>

</span>

Link to comment
Share on other sites

  • 2 months later...

Hi everybody,

 

I have a problem with this contribution. When I go to create_account, enter all required fields along with antibot code and hit Submit, I'm back to create_account page. It doesn't matter how many times I enter that validation code, I never leave create_account page? And I'm not getting any error messages. What did I do wrong? Please advise.

And my previous question: How I can integrate this contribution with "Guest Account"?

 

Thanks in advance.

Link to comment
Share on other sites

  • 2 weeks later...
Hi everybody,

 

I have a problem with this contribution. When I go to create_account, enter all required fields along with antibot code and hit Submit, I'm back to create_account page. It doesn't matter how many times I enter that validation code, I never leave create_account page? And I'm not getting any error messages. What did I do wrong? Please advise.

And my previous question: How I can integrate this contribution with "Guest Account"?

 

Thanks in advance.

Does anybody can help me with this contribution? Any help would be greatly appreciated.

 

Thanks,

Irina.

Link to comment
Share on other sites

  • 4 months later...

Hi,

 

Very good contribution!

 

In create_account.php, is it possible to add a JavaScript message when:

1) the verification field is empty

2) the letters entered are wrong

 

I believe this would make this contribution even more better, but I don't know what files to edit and what to add inside these files :blush:

 

Sincerely,

Link to comment
Share on other sites

Hello People,

 

It is been a while since I posted something. Well I was wondering if there is a way to put numbers as well with this contribution. Letters is good but numbers would surely help out as well.

 

I am also interested in adding this contribution to the contacts page and tell a friend because these pages are also target with bot registration.

 

I got to give props to the maker of this contribution. I was looking for something like this and I feel like this is the best one ;). Thanks

 

I also notice a minor detail on the spanish side of the contribution.

 

In the catalog/includes/languages/espanol/account_validation.php

 

This is what it should say:

 

define('ENTRY_ANTIROBOTREG', 'Introduzca las letras seg?n lo mostrado en la caja.<BR><i>Esta ayuda y previene registros automatizados</i>.');

 

It is missing an "y" which is "and" in English. For those interested it will make more sense.

 

Sincerely,

 

DarkAngel

Link to comment
Share on other sites

Hi,

define('ENTRY_ANTIROBOTREG', 'Introduzca las letras seg?n lo mostrado en la caja.<BR><i>Esta ayuda y previene registros automatizados</i>.');

 

It is missing an "y" which is "and" in English. For those interested it will make more sense.

Sorry, I believe you're mistaken the verb 'ayudar'= to help for the word 'ayuda' = help. There is no need for an 'y'. Otherwise you need to change the first word in the sentence too: 'Esto ayuda y previene...'.

 

Sincerely,

 

Amar

Link to comment
Share on other sites

You see this? "Introduzca las letras seg?n lo mostrado en la caja.<br><i>Esta ayuda y previene registros automatizados"

 

Esta is referring to the box. The box is in female gender. For that reason it stays esta. But it is also correct to say "Esto" as you are refing to what the box does. Either way it would be fine.

 

Just don't forget to add the "y".

 

Good Day!

Edited by darkangel
Link to comment
Share on other sites

Hi David,

 

It would be true if 'Esta' was referring to the box. I'm not quite sure 'Esta' refers to the box because, IMHO, 'Esta' is the demonstrative adjective for 'ayuda/help'.

 

Is Spanish your mother's tongue? In my case, even if I live in France and speak mainly French, it is.

 

Have a nice day,

 

Amar

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

I just uploaded a new package - Anti Robot Registration Validation 2.4

 

Based on v2.3.1 Full language by D-Flxz 14 Sep 2006

----------------------------------------------------

- Changed to use png validation images generated by code. The original gif images have been removed.

- BugFixed in catalog/create_account.php & account_edit.php & account_password.php

there is a bad 'if statement' in v2.3 code. When customers type-in the wrong validation

code, they be sent back to the same page without any error message. It is really confusing.

 

contains the following 4 languages:

English

German

Dutch

Spanish

------------------------------------------------------

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

And now your have numbers in the validation code.

 

in v2.3.1 no matter how many words you set in admin, only 5 will be shown. Now you can set 1-10 words, and the png image size will adjust automatically.

 

I can only read/write in English, can someone help to check other 3 languages files for error?

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

This is a screen shot of the new validation.

AntiRobot.png

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

hi

i just made the update of your contribution from 2.3 to 2.4.

 

i think all is ok but i have not image when i make a new account.

 

how can i do? can you help me?

 

regards

 

angel

Try this:

 

login to phpMyAdmin and look for the session_id in anti_robotreg table, copy one of the session_id value, then use your broswer to run catalog/validation_png.php?rsid=the seesion_id youjust copied

 

Let me know what you get.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Great update AlexStudio, this works perfectly!

 

One question:

 

Its possible modify the aspect of the "Validation Code"?

(Size, color, align, ...)

 

Its to adapt better the contrib with my shop.

 

Thnks a lot, and sorry for my bad english (i'm spanish) ;)

Link to comment
Share on other sites

hi

i just made the update of your contribution from 2.3 to 2.4.

 

i think all is ok but i have not image when i make a new account.

 

how can i do? can you help me?

 

regards

 

angel

 

Same problem for me, using a heavily modified creload 6.15

 

i've done the test http://shop/validation_png.php?rsid=XXXXXXXXXX and seen that the image was correctly generated

 

The problem for me was in the tep_image function, that you can find in catalog/include/functions/html_output.php.

 

That function was previously modified foroption of image size, that modification was not correct with this contribution.

 

my code was :

 

// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;

}

 

// alt is added to the img tag even if it is null to prevent browsers from outputting

// the image filename as default

$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

 

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {

if ($image_size = @getimagesize($src)) {

if (empty($width) && tep_not_null($height)) {

$ratio = $height / $image_size[1];

$width = $image_size[0] * $ratio;

} elseif (tep_not_null($width) && empty($height)) {

$ratio = $width / $image_size[0];

$height = $image_size[1] * $ratio;

} elseif (empty($width) && empty($height)) {

$width = $image_size[0];

$height = $image_size[1];

}

} elseif (IMAGE_REQUIRED == 'false') {

return false;

}

}

 

if (tep_not_null($width) && tep_not_null($height)) {

$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';

}

 

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

 

$image .= '>';

 

return $image;

}

 

 

and now corrected :

 

// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

return false;

}

 

// alt is added to the img tag even if it is null to prevent browsers from outputting

// the image filename as default

$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

 

if (tep_not_null($alt)) {

$image .= ' title=" ' . tep_output_string($alt) . ' "';

}

// by paul add (substr($src,0,23)!='validation_png.php?rsid') for compatibility with anti_robot_registration_2.4

if ( (substr($src,0,24)!='validation_png.php?rsid=') && (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {

if ($image_size = @getimagesize($src)) {

if (empty($width) && tep_not_null($height)) {

$ratio = $height / $image_size[1];

$width = $image_size[0] * $ratio;

} elseif (tep_not_null($width) && empty($height)) {

$ratio = $width / $image_size[0];

$height = $image_size[1] * $ratio;

} elseif (empty($width) && empty($height)) {

$width = $image_size[0];

$height = $image_size[1];

}

} elseif (IMAGE_REQUIRED == 'false') {

return false;

}

}

 

if (tep_not_null($width) && tep_not_null($height)) {

$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';

}

 

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

 

$image .= '>';

 

return $image;

}

 

 

hope this helps,

Link to comment
Share on other sites

Great update AlexStudio, this works perfectly!

 

One question:

 

Its possible modify the aspect of the "Validation Code"?

(Size, color, align, ...)

 

Its to adapt better the contrib with my shop.

 

Thnks a lot, and sorry for my bad english (i'm spanish) ;)

The code to generate png images uses filtered data which only came with black/white form.

Each single character size is 40x40 pixel.

 

However, you can tweak the total image size in validation_png.php where

$_png = define_filtered_pngs();

$total_width = ENTRY_VALIDATION_LENGTH * 40 + 60;
$total_height = 50;
$img_height = 40;
$img_width = 0;
$l = 0;

If you need a smaller image, try to reduce the spare room for random character placement like this

$_png = define_filtered_pngs();

$total_width = ENTRY_VALIDATION_LENGTH * 40 + 20;
$total_height = 44;

DO NOT modify other definitions, otherwise the code won't work. You can try to minimize the code length in admin page.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

If you modified the function tep_image(); the png images might not shown. To work around this issue, try to find the original function in oscommerce release packages, and rename the original function name to tep_image_original() and add it back into html_output.php in the folder catalog/includes/functions

 

and in the codes of this update, replace tep_image() to tep_image_original()

 

cheers!

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

angle, if you want to test the validation_png.php, you can grab the oscid=xxxxxxxxxx from the URL line in your browser, and run

http://yourstore.com/catalog/validation_png.php?rsid=xxxxxxxxxx

 

if you have SEO installed, and you don't have the session id in the URL, then you need to open your database with phpMyAdmin, and find the stored session_id in anti_robotreg table.

Edited by AlexStudio

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Hello Alex,

 

Thanks for you support with the coding of this contribution. I was wondering if you manage to add the same coding to the contact_us page? I have being trying but with no success.

 

Is it possible?

 

Thank you for the time. :)

 

I usually keep checking here, but often go in long trips where I don't show up... Sorry guys... I will try to be here more often.

 

Thanks again!

Link to comment
Share on other sites

well, I did try that but no luck. I think it's possible to add the validation to contact us page, but must re-write the contact us form first.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...