Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2010
    Posts
    4
    Plugin Contributions
    0

    red flag 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).

    Code:
    <?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...

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Apr 2010
    Posts
    4
    Plugin Contributions
    0

    Default 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?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

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

    Quote Originally Posted by Gaterohnn View Post
    Is this kind of error possible with simple backup and wholesale import of an entire database?
    Marginally possible, but largely unlikely.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Apr 2010
    Posts
    4
    Plugin Contributions
    0

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

    Thanks, I'll try that tomorrow.

    Cheers.

  7. #7
    Join Date
    Apr 2010
    Posts
    4
    Plugin Contributions
    0

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

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

 

 

Similar Threads

  1. Blank Page on Create Account Success
    By RAM1001 in forum General Questions
    Replies: 5
    Last Post: 31 Aug 2009, 11:44 AM
  2. Create Account Success Page being Skipp
    By frankbslim in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2008, 10:45 PM
  3. Bypass create account success page and go to My Account instead?
    By dealbyethan.com in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Dec 2007, 01:50 PM
  4. Replies: 59
    Last Post: 30 Dec 2006, 05:24 PM
  5. By-pass Account Create Success Page
    By s_mack in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 22 Dec 2006, 02:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg