Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Redirect to Home Page When Previewing Products in Admin

    A couple of our clients using Zen Cart 1.5.1 have reported that occasionally, when editing products, they will go to click the "Preview" button and end up getting redirected to their admin index page and all of the work they did on that product will be lost.

    The only code I can find is related to the securityToken which could be an issue related to handling of sessions. Has anyone else noticed this bug?

    Code from /YOUR_ADMIN/includes/init_includes/init_sessions.php:
    PHP Code:
    // lets start our session
      
    zen_session_start();
      
    $session_started true;

    if (! isset ( 
    $_SESSION ['securityToken'] ))
    {
      
    $_SESSION ['securityToken'] = md5 uniqid rand (), true ) );
    }
    if ((isset ( 
    $_GET ['action'] ) || isset($_POST['action']) ) && $_SERVER['REQUEST_METHOD'] == 'POST')
    {
      if ((! isset ( 
    $_SESSION ['securityToken'] ) || ! isset ( $_POST ['securityToken'] )) || ($_SESSION ['securityToken'] !== $_POST ['securityToken']))
      {
        
    zen_redirect zen_href_link FILENAME_DEFAULT'''SSL' ) );
      }


  2. #2
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Redirect to Home Page When Previewing Products in Admin

    BTW, the product page form does have the securityToken and the page has no HTML nesting errors and most of the time there is no issue.

  3. #3
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    5
    Plugin Contributions
    7

    Default Re: Redirect to Home Page When Previewing Products in Admin

    My users have the very same problem. It's rare but it's happening (as they claim)...
    Has anyone ever found out what was wrong? I'd love to hear it!
    Many thanks

  4. #4
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    5
    Plugin Contributions
    7

    Default Re: Redirect to Home Page When Previewing Products in Admin

    The redirect to the admin homepage can be caused by a missing securityToken in the form which had been POSTed as described here:
    http://www.zen-cart.com/showthread.p...-Contributions

    However, there's a second reason for this to be happening... One of my users kept complaining about it and it took me ages to find out what it was. He was simply using the admin from a few different browser tabs at once. If you open a (post) form in one browser tab and then browse the admin pages from a second tab then the new security code can be generated on the server from the new tab and when you submit the form in the original tab it will fail the validation (maybe you need to logout/timeout and log back in in the second tab to achieve the error).

    Hopefully it will save some time for someone with creative admin-users. It took me ages to find out :-/

  5. #5
    Join Date
    Sep 2008
    Posts
    95
    Plugin Contributions
    0

    Default Re: Redirect to Home Page When Previewing Products in Admin

    Quote Originally Posted by numinix View Post
    A couple of our clients using Zen Cart 1.5.1 have reported that occasionally, when editing products, they will go to click the "Preview" button and end up getting redirected to their admin index page and all of the work they did on that product will be lost.

    The only code I can find is related to the securityToken which could be an issue related to handling of sessions. Has anyone else noticed this bug?
    I noticed this same thing with my client, however to save data, dont go back to category and then open the product, in place of that just press back button on browser and you will see all data intact on product page, then you can press preview and update and it will work.

    ~Time

  6. #6
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Redirect to Home Page When Previewing Products in Admin

    If you check the web console in Firefox, you may notice a 500 Internal Server Error when the home page loads. Often the culprit is invalid post data that PHP wasn't able to handle. If you are creating product descriptions in another program, it could be adding invalid characters or formatting that is causing the error.

    The best way to avoid this is to use either plain text and create your HTML code directly in the textarea, or use a WYSIWYG editor that is integrated into Zen Cart such as CK Editor.

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,691
    Plugin Contributions
    9

    Default Re: Redirect to Home Page When Previewing Products in Admin

    with this new security addition as documented here:

    http://www.zen-cart.com/showthread.php?130410

    no logging gets done. basically this patch says there is a problem with the security, and we are just going to redirect you to the admin home page. why the maintainers of zen chose to not log this security breach is a mystery to me.

 

 

Similar Threads

  1. v139h Bumped to admin home page when using value manager
    By robbin21973 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 16 Jul 2012, 04:39 AM
  2. Redirect deleted, moved and discontinued products to the home page.
    By Podgeminster in forum General Questions
    Replies: 1
    Last Post: 15 Mar 2011, 02:11 AM
  3. Previewing new products
    By aenea in forum General Questions
    Replies: 3
    Last Post: 19 Jan 2010, 02:48 PM
  4. Auto redirect from home page to zen cart home
    By gizmo_girl in forum Basic Configuration
    Replies: 5
    Last Post: 4 Nov 2008, 03:46 PM
  5. Redirect default home page?
    By thedust2010 in forum General Questions
    Replies: 5
    Last Post: 6 Jun 2007, 06:24 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR