Community Add-Ons

Add file to this package
Top » Features

Visual Verify Code (VVC) security
for osCommerce Online Merchant v2.2

The Visual Verify Code (VVC) contribution is an answer to harmful automated scripts that create large numbers of user accounts, or repeatedly send emails via “Tell-A-Friend” and “Contact Us” . The system works by displaying some random characters in an image and asking the user to enter the text that they see displayed. The image is dynamically generated, the characters are of differing sizes and placements, and the number of characters displayed is random. The pool of characters that serve as fodder for the resulting image is user definable. In addition, this contribution leverages the
database to keep the visual code characters out of the HTML stream (to avoid
interception by automated systems) and to enable the possibility of distributed
image rendering and generation.

This contribution is based on osCommerce 2.2m2 and has not been tested against other versions. It works on both my Windows and Linux environments, but I cannot guarantee it will in yours so you use this at your own risk.

The functionality can be seen on www.onlyvotives.com. Simply go to the ‘create a profile’ or ‘contact us’ page and you will see it in action.

-William (“Bill”) L. Peer, Jr.
p.s. I’m into PHP and osCommerce two weeks now ... and they are both amazing! This is my gift back to the project ... thanks all

Legend:  Download   Report
Expand All / Collapse All
FIX for VVC on Contact Us page ssnb 28 Jul 2008  

This works great on create account, but didn't work on contact us, however, I believe this is the answer (it works for me)

The contribution below must be installed first (up to and including marcinmf's "Better Image" file.


BACK UP BACK UP BACK UP your files & db

in catalogue > contact_us.php find (about line 31):

//VISUAL VERIFY CODE start
require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');

$code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . tep_session_id($HTTP_GET_VARS[tep_session_name()]) . "'");
$code_array = tep_db_fetch_array($code_query);
$code = $code_array['code'];

tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); //remove the visual verify code associated with this session to clean database and ensure new results

$user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
if (!(strcasecmp($user_entered_code, $code) == 0)) { //make the check case insensitive
$error = true;
$messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR);
}
//VISUAL VERIFY CODE stop


REPLACE with:


//VISUAL VERIFY CODE start
require(DIR_WS_FUNCTIONS . 'visual_verify_code.php');

$code_query = tep_db_query("select code from visual_verify_code where oscsid = '" . $HTTP_GET_VARS['osCsid'] . "'");
$code_array = tep_db_fetch_array($code_query);
$code = $code_array['code'];

tep_db_query("DELETE FROM " . TABLE_VISUAL_VERIFY_CODE . " WHERE oscsid='" . $vvcode_oscsid . "'"); //remove the visual verify code associated with this session to clean database and ensure new results

$user_entered_code = $HTTP_POST_VARS['visual_verify_code'];
if (!(strcasecmp($user_entered_code, $code) == 0)) { //make the check case insensitive
$error = true;
$messageStack->add('contact', VISUAL_VERIFY_CODE_ENTRY_ERROR);
}
//VISUAL VERIFY CODE stop


Hope it works for you
Good Luck


NB file attached is just the above

Better Image marcinmf 18 Jun 2008  
Minor update: add noise & PNG free format tequyla 26 Dec 2007  
Visual Verify Code(VVC) 2.2 kgrinsteiner 23 Sep 2007  
Correct SQL Code JABarrett 28 Jul 2007  
VVC with Garbage Collection lukec 3 Dec 2006  
SQL BUG robreis 12 Jun 2006  
vvcode2.1_with_german rubo77 17 May 2006  
SQL error #1067 jszeto 19 Mar 2006  
BUG fix for vvc2.1 chuckh2d 15 Mar 2006  
VVC 2.1 FunKingShirts.com 25 Feb 2006  
Cookie fix for VVC lukec 1 Feb 2006  
Visual Verify Code (VVC) security (added files) snuff 1 Dec 2004  
Visual Verify Code (VVC) security William L Peer, Jr. 27 Sep 2003