Jump to content
Sign in to follow this  
Druide

NEW: Anti Robot Registration Validation

Recommended Posts

I am using v 2.2 MS2 as of 7/12/2003.

 

And am using the

Anti Robot Registration Validation 1.0.1a

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

Created on tep_snapshot-20030508 2.2 MS2 CVS

 

I do not have the following files:

catalog/create_account_process.php

catalog/account_edit_process.php

catalog/includes/modules/account_details.php

 

Also the file: catalog/includes/form_check.js.php does not have the following code:

var telephone = document.account_edit.telephone.value;

or

if (document.account_edit.elements['telephone'].type != "hidden") {

? ?if (telephone == '' || telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {

? ? ?error_message = error_message + "<?php echo JS_TELEPHONE; ?>";

? ? ?error = 1;

? ?}

?}

 

I did not check the rest of the code. Either I'm going completely nuts, and have a brain fart or I have the incorrect stuff. (I can't imagine how?)

 

I would appreciate any help on this.

Ray :(

 

I have the exact same problem. Any luck on getting this to work properly yet??

Edited by craigey

Share this post


Link to post
Share on other sites
I am using v 2.2 MS2 as of 7/12/2003.

 

And am using the

Anti Robot Registration Validation 1.0.1a

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

Created on tep_snapshot-20030508 2.2 MS2 CVS

 

I do not have the following files:

catalog/create_account_process.php

catalog/account_edit_process.php

catalog/includes/modules/account_details.php

 

Also the file: catalog/includes/form_check.js.php does not have the following code:

var telephone = document.account_edit.telephone.value;

or

if (document.account_edit.elements['telephone'].type != "hidden") {

? ?if (telephone == '' || telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {

? ? ?error_message = error_message + "<?php echo JS_TELEPHONE; ?>";

? ? ?error = 1;

? ?}

?}

 

I did not check the rest of the code. Either I'm going completely nuts, and have a brain fart or I have the incorrect stuff. (I can't imagine how?)

 

I would appreciate any help on this.

Ray :(

 

I have the exact same problem. Any luck on getting this to work properly yet??

I got the same problem :(

Share this post


Link to post
Share on other sites

Im a little confused.

 

In the directions it says if you have these 2 files

catalog/includes/database_tables.php

catalog/includes/filenames.php

 

follow STEP 1 and STEP 2

 

Which I have them. SO I make changes to:

 

open catalog/includes/database_tables.php

 

adding define('TABLE_ANTI_ROBOT_REGISTRATION', 'anti_robotreg');

 

 

open catalog/includes/filenames.php

 

define('FILENAME_ACCOUNT_VALIDATION', 'account_validation.php');

 

 

I get to step 3 and it says to edit the Form_check.js.php

 

When I try to find var telephone = document.account_edit.telephone.value;

Its not there. So I paste the add code where I think it applies with respect to the placement of the code.

 

Still in step 3 it says to edit form_check.js.php adding

<?php

if (ACCOUNT_VALIDATION == 'true' && ( ACCOUNT_CREATE_VALIDATION == 'true' || ACCOUNT_EDIT_VALIDATION == 'true' ) ) {

?>

if (document.account_edit.elements['antirobotreg'].type != "hidden") {

if (document.account_edit.antirobotreg.value == '' || document.account_edit.antirobotreg.value.length < <?php echo ENTRY_VALIDATION_LENGTH; ?> ) {

error_message = error_message + "<?php echo JS_VALIDATION; ?>";

error = 1;

}

}

<?php

}

?>

 

 

On to step 4. I find the password_funcs.php file, edit with the code. No problem everything as its stated.

 

On to step 5. open catalog/includes/modules/account_details.php

 

I dont have an account_details.php file in that directory.

 

So im wondering does the direction to use STEP 1 and STEP 2 above mean only those 2 files need to be changed? And if so then why all of the other steps?

Share this post


Link to post
Share on other sites

I believe the contribution is not for osC 2.2 MS2......look at the form_check.js.php version, it's mentioned as v1.8 while my osC 2.2 MS2 installation has v1.9

 

Anyone got it working yet?

 

This contribution has caused my site to be broken now.

Anyone got idea on how to completely remove it.

 

Like everyone, I am struck at Step 3.

 

I think Step 3 is necessary cause it will check the graphical input validation, else it's as good as not having this anti-robot validation mod.

Share this post


Link to post
Share on other sites
Anyone got idea on how to completely remove it.

 

To uninstall, read and follow the installation instruction backwards and delete what you have added, or use your backup files, which I hope for you you have somewhere!!

 

:unsure:


Antonios

 

olympicslogo_en.gif

Share this post


Link to post
Share on other sites
Anyone got idea on how to completely remove it.

 

To uninstall, read and follow the installation instruction backwards and delete what you have added, or use your backup files, which I hope for you you have somewhere!!

 

:unsure:

I have....and all the files are reversible.

 

However, can advise on how to reverse the SQL portion?

 

I have tried to re-write the codes for 2.2 MS2, but appears to be too tough for me. I am not good wif the coding.....I was struck at Step 5 onwards....

Share this post


Link to post
Share on other sites

you may as well leave it in the db. It's not going to make much difference to page load times etc.

 

but that's why you should always backup your db / shop files, before making any changes.

Share this post


Link to post
Share on other sites

Anyone going to re-write this contribution for osC 2.2 MS2?

 

I believe alot of pple will find this useful for security, to secure creation of accounts.

Share this post


Link to post
Share on other sites
Anyone going to re-write this contribution for osC 2.2 MS2?

 

Well, why not .... anyone else interested or already gone through it??


Antonios

 

olympicslogo_en.gif

Share this post


Link to post
Share on other sites

Add me to the list of those who would like someone to tackle the problems in the Anti Robot Registration contribution. It would be a great contribution if it would only work.

 

I've read the other posts and wouldn't install this contribution due to others saying it broke their site.

 

I have read through the install procedures prior to starting the install of the contribution and found that I have the same problem as others report here in this forum.

 

Just to be clear, I also do not have the following file in my OSC 2.2 MS2:

catalog/create_account_process.php

 

Can somebody please take up the challenge to fix this contribution. You would make a lot of people happy. :)

Share this post


Link to post
Share on other sites

I got the same problem :blink:

 

bill


My English is unfortunately bad. Excused ask.

Share this post


Link to post
Share on other sites

Fixes in v2.1a (based on v2.0 and v2.1):

 

1. Original install.txt from v2.0 is incomplete, whereby the final portion of the code for account_edit.php is missing, thus will not display the validation portion when user edit account.

 

2. Reduce redundant codes for both create_account.php and account_edit.php changes which starts with the following line:

 

<!-- BOF ANTI ROBOT REG-->

 

___________________________________________________________________

 

Original v2.0/2.1 Code for create_account.php

<!-- BOF ANTI ROBOT REG-->
<?php
 if ( (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') &&  ACCOUNT_CREATE_VALIDATION == 'true' ) ||

(ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'account_edit') &&  ACCOUNT_EDIT_VALIDATION == 'true' )) {
?>
   <tr>
       <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table align="center" border="0" cellspacing="2" cellpadding="2">
            <tr>
<?php
 if ( (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') &&  ACCOUNT_CREATE_VALIDATION == 'true' ) ||

(ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'account_edit') &&  ACCOUNT_EDIT_VALIDATION == 'true' )) {
 if ($is_read_only == false || (strstr($PHP_SELF,'create_account'))  || (strstr($PHP_SELF,'account_edit')) ) {
$sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id =

'" . tep_session_id() . "'";
    if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); }
$reg_key = gen_reg_key();
$sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" .

time() . "')";
    if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); }
?>
   <tr>
   <td class="main"><table align="center" border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
     <tr>
       <td class="main"><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main" width="50%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td>
           <td class="main" width="50%" align="left">
<?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 {
?>
<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', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT; ?>
</span>
<?php
  }
?>
</td>
         </tr>
       </table></td>
     </tr>
   </table></td>
 </tr>
<?php
 }
?>
<?php
 }
?>
           </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
}
?>
<!-- EOF ANTI ROBOT REG-->

 

New v2.1a Code for create_account.php

<!-- BOF ANTI ROBOT REG-->
<?php
 if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
?>
   <tr>
       <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table align="center" border="0" cellspacing="2" cellpadding="2">
            <tr>
<?php
 if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
 if ($is_read_only == false || (strstr($PHP_SELF,'create_account')) ) {
$sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id =

'" . tep_session_id() . "'";
    if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); }
$reg_key = gen_reg_key();
$sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" .

time() . "')";
    if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); }
?>
   <tr>
   <td class="main"><table align="center" border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
     <tr>
       <td class="main"><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main" width="50%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td>
           <td class="main" width="50%" align="left">
<?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 {
?>
<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', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT; ?>
</span>
<?php
  }
?>
</td>
         </tr>
       </table></td>
     </tr>
   </table></td>
 </tr>
<?php
 }
?>
<?php
 }
?>
           </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
}
?>
<!-- EOF ANTI ROBOT REG-->

 

Original v2.0/2.1 Code for account_edit.php is wrong

/======== FIND ==========/
 $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);



/======== ADD AFTER ==========/
 if (ACCOUNT_VALIDATION == 'true' && ACCOUNT_EDIT_VALIDATION == 'true') {
 $antirobotreg = tep_db_prepare_input($HTTP_POST_VARS['antirobotreg']);
 }
 
/======== END ==========/

 

New v2.1a Code for account_edit.php

<!-- anti_robot_registration_bof-->
<?php
if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'account_edit') &&  ACCOUNT_EDIT_VALIDATION == 'true') {
?>
     <tr>
       <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table align="center" border="0" cellspacing="2" cellpadding="2">
            <tr>
<?php
if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'account_edit') &&  ACCOUNT_EDIT_VALIDATION == 'true') {
  if ($is_read_only == false || (strstr($PHP_SELF,'create_account')) ) {
 $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'";
   if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); }
	 $reg_key = gen_reg_key();
	 $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')";
   if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); }
?>
  <tr>
 <td class="main"><table align="center" border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
   <tr>
	 <td class="main"><table border="0" cellspacing="0" cellpadding="2">
    <tr>
   <td class="main" width="50%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td>
   <td class="main" width="50%" align="left">
<?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 {
?>
<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', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT; ?>
</span>
<?php
  }
?>
   </td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
<?php
 }
?>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
}
?>
<!-- anti_robot_registration_eof-->

 

Just my little contribution to the community. All credits go to the original creator of v2.0 who help converted the old v1.x code to be compatible with osC 2.2 MS2.

Share this post


Link to post
Share on other sites

Hey!

 

For the install of Anti Robot Registration v2.1a

 

I got a problem when I had edit the "account_edit.php" file.

When I try to check my account. The system will tell me this:

 

Parse error: parse error, unexpected $ in /home/l/ljudkraf/www/catalog/account_edit.php on line 401

 

401 is the last line in this file. So there is only a ?>

 

What is wrong here.

Could anyone give me some help!

Edited by Mr_B_is_Here

Share this post


Link to post
Share on other sites
Hey!

 

For the install of Anti Robot Registration v2.1a

 

I got a problem when I had edit the "account_edit.php" file.

When I try to check my account. The system will tell me this:

 

Parse error: parse error, unexpected $ in /home/l/ljudkraf/www/catalog/account_edit.php on line 401

 

401 is the last line in this file. So there is only a ?>

 

What is wrong here.

Could anyone give me some help!

Pardon me. If u use web editor to edit your .php files, most likely you will get problem. I think it got something to do with web editing adding something to the end of the file.

 

Use tools like dreamweaver or others to edit remotely, else, edit it locally and upload to your hosting.

Share this post


Link to post
Share on other sites

Damn.....I found a mistake I made.

 

Look for this line in account_edit.php:

 

if ($is_read_only == false || (strstr($PHP_SELF,'create_account')) ) {

 

 

It should be

 

if ($is_read_only == false || (strstr($PHP_SELF,'account_edit')) ) {

 

 

Hope this close up any minor typo bugs.....anyone wanna re-release it as v2.1b? If not, I will leave it open as it is, and to be updated by the next release or the next person who comes up with new features to add on to it.

Edited by chaicka

Share this post


Link to post
Share on other sites

A big hello from germany.

Seems this contrib is working for me on MS2, exept one thing: 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? Perhaps the reason is the BTS contrib, which i have installed before?

:blink:

Share this post


Link to post
Share on other sites

I have downloaded and am attempting to install this great contribution. However I am having some troubles locating some code. The code I am looking for is:

 

tr>
               <td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
               <td class="main"><?php echo tep_draw_password_field('confirmation') . ' ' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
             </tr>
              </table></td>
              </tr>
     </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

 

Which according to the instructions it should be in "create_account.php" . I have looked though this file and are unable to locate this code. I was able to make the other changes within this file just fine. Please let me know where I can find this code so I can finish the install of this contribution! I have seen it working and think it is SWEET! Good work guys/girls.


Best of luck!

Charles

 

Installed Contributions:

MS2

USPS

UPS

PayPal IPN

2CheckOut

Some other too that I am trying to figure out!

-To all OSC programmers: Thank you for all your hard work put into this application!

Share this post


Link to post
Share on other sites

Good to see that one of my 'old' projects is still alive...

 

Thank you 'users'

 

That's all

 

 

it worked perfect before MS2 and i haven't bothered to look into the code since, i am still waiting on MS3 (like many others)

 

i have lots of new contributions in my queue for MS3 but dont rewrite my code before it's official (stable)


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites
Good to see that one of my 'old' projects is still alive...

 

Thank you 'users'

 

That's all

it worked perfect before MS2 and i haven't bothered to look into the code since, i am still waiting on MS3 (like many others)

 

i have lots of new contributions in my queue for MS3 but dont rewrite my code before it's official (stable)

 

 

Am I at least looking in the write file? I just cann't imagine that I cna not find this information. I am actualy working on a CRELOADED 6.1 site. And I think this would be a really nice contribution. I have a hard time beleaving that no one else is using this...


Best of luck!

Charles

 

Installed Contributions:

MS2

USPS

UPS

PayPal IPN

2CheckOut

Some other too that I am trying to figure out!

-To all OSC programmers: Thank you for all your hard work put into this application!

Share this post


Link to post
Share on other sites
Am I at least looking in the write file?  I just cann't imagine that I cna not find this information.  I am actualy working on a CRELOADED 6.1 site.  And I think this would be a really nice contribution.  I have a hard time beleaving that no one else is using this...

 

For those of you that are using CRELOADED you can find all the "missing" files here

 

Check templates/content/create_account.tpl.php.


Best of luck!

Charles

 

Installed Contributions:

MS2

USPS

UPS

PayPal IPN

2CheckOut

Some other too that I am trying to figure out!

-To all OSC programmers: Thank you for all your hard work put into this application!

Share this post


Link to post
Share on other sites

I've been trying to locate an answer to a simple (and possibly stupid!) question I have about this contrib, but I don't see it anywhere in this thread. I have edited and uploaded all the correct files, but I don't see any "SQL for Dummies" instructions on how to name and create the basic SQL database. I have a CP on my site to install new databases, but before I try something wrong, could someone simply dumb it down for me? What should it be named?

 

Thanks!

 

Steve

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×