Zen Cart Logo
Forums / Managing Customers and Orders / Extra User Displayed on Create An Account - Success Page

Extra User Displayed on Create An Account - Success Page

Locked

Views: 1,002

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 May 2010, 7:26 AM
#1
gaterohnn avatar

gaterohnn

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Extra User Displayed on Create An Account - Success Page

Haven't been able to find any other thread about this, so here goes...

Zen Cart seems to be working perfectly well except for the Create Account - Success page which shows two primary addresses for the new account. One is for the user just created and one is for someone else plucked seemingly at random from the database. This is of concern due to confidentiality, etc and we need to prevent it as soon as we can.

Details of Install:

New install with old database. Only one plugin: Reward Point Full Suite
Zen Cart 1.3.8a
Patch: 1::
Database Patch Level: 1.3.8

Server OS: Linux 2.6.18-164.11.1.el5
Database: MySQL 5.0.89-community-log
HTTP Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14
PHP Version: 5.2.12 (Zend: 2.2.0)

I have attempted to track it down, and all I can find is that the error is probably due to a loop somewhere calling an extra address from the database (/includes/templates/mostlygrey/templates/tpl_create_account_success_default.php).

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=create-account_success.<br />
 * Displays confirmation that a new account has been created.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_create_account_success_default.php 4886 2006-11-05 09:01:18Z drbyte $
 */
?>
<div class="centerColumn" id="createAcctSuccess">
<h1 id="createAcctSuccessHeading"><?php echo HEADING_TITLE; ?></h1>

<div id="createAcctSuccessMainContent" class="content"><?php echo TEXT_ACCOUNT_CREATED; ?></div>

<?php
if(REWARD_POINTS_NEW_ACCOUNT_REWARD!=0 && isset($RewardPoints))
 if(REWARD_POINTS_NEW_ACCOUNT_REWARD>0 && GetCustomersRewardPoints($_SESSION['customer_id'])==0)
  $RewardPoints->AddRewardPoints($_SESSION['customer_id'],REWARD_POINTS_NEW_ACCOUNT_REWARD);
 else
  if(REWARD_POINTS_NEW_ACCOUNT_REWARD<0 && GetCustomersPendingPoints($_SESSION['customer_id'])==0)
   $RewardPoints->AddPendingPoints($_SESSION['customer_id'],abs(REWARD_POINTS_NEW_ACCOUNT_REWARD));
?>

<fieldset>
<legend><?php echo PRIMARY_ADDRESS_TITLE; ?></legend>
<?php
/**
 * Used to loop thru and display address book entries
 */
  foreach ($addressArray as $addresses) {
?>
<h3 class="addressBookDefaultName"><?php echo zen_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></h3>

<address><?php echo zen_address_format($addresses['format_id'], $addresses['address'], true, ' ', '<br />'); ?></address>

<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a> <a href="' . zen_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_DELETE, BUTTON_DELETE_ALT) . '</a>'; ?></div>
<br class="clearBoth">
<?php
  }
?>
</fieldset>


<div class="buttonRow forward"><?php echo '<a href="' . $origin_href . '">' . zen_image_button(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT) . '</a>'; ?></div>
</div>

Might be wrong but it looks like the mod is probably at fault here? Or maybe the template itself?

I would have posted a screenshot, but as it contains a customer's info, I have refrained from doing so. Registering as a new user will duplicate the problem, though, as it seems to happen with alarming regularity. For the same reason I haven't posted the store URL, I assume this will be a problem but maybe there is another way to check this problem out, perhaps via PM?

I'm not much of a programmer so not sure what steps to take next, or even if I am on the right track... :blink:

17 May 2010, 8:02 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Extra User Displayed on Create An Account - Success Page

It's almost certainly a result of bad data in your database. The symptoms sound like you "selectively" imported customer data from an old database, or you "selectively" deleted certain customer data from your database, but neglected to delete all related data. It seems like someone assumed that purging data from the "customers" table would suffice, when in fact there's also the "address_book" and "customers_info" tables to be considered, amongst others.

So, it's very likely that a "new" customer is getting a customer ID assigned to them for which there is already an address_book entry for that customer ID, and then the "new" customer's "real" address is also being added to the address_book as part of the create-account process ... and now you're seeing both addresses shown on the create-account-success screen.

You'll need to go into your database and clean up whatever mess you left behind from whatever data purging/importing was done that's caused this problem.

I doubt it's the fault of any addon.

17 May 2010, 8:21 AM
#3
gaterohnn avatar

gaterohnn

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Extra User Displayed on Create An Account - Success Page

So, it isn't likely to be a programming thing. That's a relief.

It's almost certainly a result of bad data in your database. The symptoms sound like you "selectively" imported customer data from an old database, or you "selectively" deleted certain customer data from your database, but neglected to delete all related data. It seems like someone assumed that purging data from the "customers" table would suffice, when in fact there's also the "address_book" and "customers_info" tables to be considered, amongst others.

The only problem with this theory is that nothing has ever been selectively deleted from the database as described, nor purged. Everything has been done with "ALL", and only as backups and imports. The database has only ever been manipulated through Zen Cart, and never directly except for the above.

Is this kind of error possible with simple backup and wholesale import of an entire database?

17 May 2010, 8:31 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Extra User Displayed on Create An Account - Success Page

Gaterohnn:

Is this kind of error possible with simple backup and wholesale import of an entire database?
Marginally possible, but largely unlikely.

17 May 2010, 8:32 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Extra User Displayed on Create An Account - Success Page

You'll need to start by analyzing your address_book table for customer_id records that don't already exist in your customers table.

17 May 2010, 8:49 AM
#6
gaterohnn avatar

gaterohnn

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Extra User Displayed on Create An Account - Success Page

Thanks, I'll try that tomorrow.

Cheers. :smile:

19 May 2010, 2:05 AM
#7
gaterohnn avatar

gaterohnn

New Zenner

Join Date:
Apr 2010
Posts:
4
Plugin Contributions:
0

Re: Extra User Displayed on Create An Account - Success Page

Thanks, there were duplicates in the DB and the problem is resolved. Many thanks! :D