Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Password Protecting the Catalog

    Hi

    A little problem that is driving me nuts!

    The main website index file calls a password protection system in PHP and allows registered members to log in and sets a cookie fpr the entire domain. Ince logged in then the user can select the Zen-cart program link.

    I dropped a bit of code into catalog/index.php to check for the cookie's existence and if it didn't find it then it redirects the user to front page. That worked fine ... until I then selected a manufacturer in the sidebox and zen-cart redirected me back to the front page ...BUT I was still logged in because it displayed the front page rather than asking me to log in again. So the cookies was obviously still there.

    This has foxed me completely ... any ideas, please?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Password Protecting the Catalog

    Couple of things, first, why is ZC not your home page where you can set it up to require login.
    Second) does the same issue occur for any other link selected that takes one to the ZC site, or only manufacturers? ( Ez pages, contact us, login, product info, etc...)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Password Protecting the Catalog

    Quote Originally Posted by mc12345678 View Post
    Couple of things, first, why is ZC not your home page where you can set it up to require login.
    Second) does the same issue occur for any other link selected that takes one to the ZC site, or only manufacturers? ( Ez pages, contact us, login, product info, etc...)
    In reverse order:

    It's happening on all links

    ZC is not the home page as the site is a strictly controlled membership. The front (HTML/PHP) pages have links to software that can upload contributions to an area of our site for us to process and put online as well as a Wishlist program to request products they require - along with guides and info which can of course be put into EZ-Pages.

    So a user/PW to enter main site and in ZC a customer account to actually download products

  4. #4
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Password Protecting the Catalog

    Quote Originally Posted by DigiBooks View Post
    In reverse order:

    It's happening on all links

    ZC is not the home page as the site is a strictly controlled membership. The front (HTML/PHP) pages have links to software that can upload contributions to an area of our site for us to process and put online as well as a Wishlist program to request products they require - along with guides and info which can of course be put into EZ-Pages.

    So a user/PW to enter main site and in ZC a customer account to actually download products
    So, unless imissed something, everything described there is possible with ZC alone... So goes back to the first question...

    Next would be to identify where in the index.php the additional code was added inparticular in relationship to other calling work.

    Zc, offers the ability to upload information, to require login/membership, etc.... Which is why the first question was asked.

    Any code provided here should be bounded with CODE tags generated by clicking the # key in the toolbar of the message box.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Password Protecting the Catalog

    Quote Originally Posted by mc12345678 View Post
    So, unless imissed something, everything described there is possible with ZC alone... So goes back to the first question...

    Next would be to identify where in the index.php the additional code was added inparticular in relationship to other calling work.

    Zc, offers the ability to upload information, to require login/membership, etc.... Which is why the first question was asked.

    Any code provided here should be bounded with CODE tags generated by clicking the # key in the toolbar of the message box.
    Ok you're losing me a little here lol!

    I transported from the "OTHER" site (OSC) where this actually worked.

    So I added the additional code here:
    -------------------------------------------------------------------------------------------------------------------------------

    <?php
    /**
    * index.php represents the hub of the Zen Cart MVC system
    *
    * Overview of flow
    * <ul>
    * <li>Load application_top.php - see {@tutorial initsystem}</li>
    * <li>Set main language directory based on $_SESSION['language']</li>
    * <li>Load all *header_php.php files from includes/modules/pages/PAGE_NAME/</li>
    * <li>Load html_header.php (this is a common template file)</li>
    * <li>Load main_template_vars.php (this is a common template file)</li>
    * <li>Load on_load scripts (page based and site wide)</li>
    * <li>Load tpl_main_page.php (this is a common template file)</li>
    * <li>Load application_bottom.php</li>
    * </ul>
    *
    * @package general
    * @copyright Copyright 2003-2005 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: index.php 2942 2006-02-02 04:41:23Z drbyte $
    *
    * Digi-Books Amendment History
    *
    * 10th May 2014: DB#1 - Display total live books and total pending
    *
    */
    /**
    * Load common library stuff
    */

    /* kick user out if they came here direct */


    if (!isset($_COOKIE['DBverify']))
    {
    header('Location: http://www.digibooks.org.uk/DB_2015_root/index.php');
    exit;
    }

    require('includes/application_top.php');

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

    Cleared the browser cookies and the first attempt to go direct to the ZC library took me back to my html/php entry page at root level.

    After that any link click takes me back to the entry page but logged in using the cookie that was set.

    If ZC can deal with everything I require that would be great ... but I really don't know how to integrate all the other PHP I use ... hence the reason I went down this route.

    I'll PM you the site and login info

  6. #6
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Password Protecting the Catalog

    I don't get it how you are going about making your store a 'Membership Only' site.

    There are simpler and more effective alternatives. As an example see this site sunnsand(dot)com(dot)au which is one of my client's wholesale sites. To keep the competition guessing what she designs, manufacturers and sells, anyone needs to register and must be manually approved before they can view full details and buy wholesale from this site. This has been achieved by standard settings in the admin and installation of CSAR (see link in my signature).

    Frank

  7. #7
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Password Protecting the Catalog

    Quote Originally Posted by DigiBooks View Post
    Ok you're losing me a little here lol!

    I transported from the "OTHER" site (OSC) where this actually worked.

    So I added the additional code here:
    -------------------------------------------------------------------------------------------------------------------------------

    <?php
    /**
    * index.php represents the hub of the Zen Cart MVC system
    *
    * Overview of flow
    * <ul>
    * <li>Load application_top.php - see {@tutorial initsystem}</li>
    * <li>Set main language directory based on $_SESSION['language']</li>
    * <li>Load all *header_php.php files from includes/modules/pages/PAGE_NAME/</li>
    * <li>Load html_header.php (this is a common template file)</li>
    * <li>Load main_template_vars.php (this is a common template file)</li>
    * <li>Load on_load scripts (page based and site wide)</li>
    * <li>Load tpl_main_page.php (this is a common template file)</li>
    * <li>Load application_bottom.php</li>
    * </ul>
    *
    * @package general
    * @copyright Copyright 2003-2005 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: index.php 2942 2006-02-02 04:41:23Z drbyte $
    *
    * Digi-Books Amendment History
    *
    * 10th May 2014: DB#1 - Display total live books and total pending
    *
    */
    /**
    * Load common library stuff
    */

    /* kick user out if they came here direct */


    if (!isset($_COOKIE['DBverify']))
    {
    header('Location: http://www.digibooks.org.uk/DB_2015_root/index.php');
    exit;
    }

    require('includes/application_top.php');

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

    Cleared the browser cookies and the first attempt to go direct to the ZC library took me back to my html/php entry page at root level.

    After that any link click takes me back to the entry page but logged in using the cookie that was set.

    If ZC can deal with everything I require that would be great ... but I really don't know how to integrate all the other PHP I use ... hence the reason I went down this route.

    I'll PM you the site and login info
    I thought there was something somewhere that did some cookie cleanup, but haven't located it specifically yet. Having had an opportunity to review the site (I'm guessing the current "old" site), I did not see anything that would be too much for ZC. Frank18's contribution might help narrow the items/choices available to your customers on an as needed basis (like those things viewable by everyone, and those things viewable by members that meet a specific category and the software may open a range of options for the site, but I guess I would wonder what this "other php" is that would need to be considered. I mean if there is something unique on a "different" page, it could always be it's own ez page or some other unique page of it's own...

    The attempt to merge so many "other" options into ZC which already does, I think from my own viewing, everything that is currently there seems like a step backwards... You have options about how to present the content and those features, to where only certain things are presented on thescreen based on certain previous selections, like while viewing the third menu option, may not want to be presented with everything that is in the second, or something like that.

    Just some thoughts. I haven't gone to look at franks work to compare, but as I said, his contribution may fit into your overall business or be an improvement.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Password Protecting the Catalog

    Quote Originally Posted by DigiBooks View Post
    Ok you're losing me a little here lol!

    I transported from the "OTHER" site (OSC) where this actually worked.

    So I added the additional code here:
    -------------------------------------------------------------------------------------------------------------------------------

    <?php
    /**
    * index.php represents the hub of the Zen Cart MVC system
    *
    * Overview of flow
    * <ul>
    * <li>Load application_top.php - see {@tutorial initsystem}</li>
    * <li>Set main language directory based on $_SESSION['language']</li>
    * <li>Load all *header_php.php files from includes/modules/pages/PAGE_NAME/</li>
    * <li>Load html_header.php (this is a common template file)</li>
    * <li>Load main_template_vars.php (this is a common template file)</li>
    * <li>Load on_load scripts (page based and site wide)</li>
    * <li>Load tpl_main_page.php (this is a common template file)</li>
    * <li>Load application_bottom.php</li>
    * </ul>
    *
    * @package general
    * @copyright Copyright 2003-2005 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: index.php 2942 2006-02-02 04:41:23Z drbyte $
    *
    * Digi-Books Amendment History
    *
    * 10th May 2014: DB#1 - Display total live books and total pending
    *
    */
    /**
    * Load common library stuff
    */

    /* kick user out if they came here direct */


    if (!isset($_COOKIE['DBverify']))
    {
    header('Location: http://www.digibooks.org.uk/DB_2015_root/index.php');
    exit;
    }

    require('includes/application_top.php');

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

    Cleared the browser cookies and the first attempt to go direct to the ZC library took me back to my html/php entry page at root level.

    After that any link click takes me back to the entry page but logged in using the cookie that was set.

    If ZC can deal with everything I require that would be great ... but I really don't know how to integrate all the other PHP I use ... hence the reason I went down this route.

    I'll PM you the site and login info
    I thought there was something somewhere that did some cookie cleanup, but haven't located it specifically yet. Having had an opportunity to review the site (I'm guessing the current "old" site), I did not see anything that would be too much for ZC. Frank18's contribution might help narrow the items/choices available to your customers on an as needed basis (like those things viewable by everyone, and those things viewable by members that meet a specific category and the software may open a range of options for the site, but I guess I would wonder what this "other php" is that would need to be considered. I mean if there is something unique on a "different" page, it could always be it's own ez page or some other unique page of it's own...

    The attempt to merge so many "other" options into ZC which already does, I think from my own viewing, everything that is currently there seems like a step backwards... You have options about how to present the content and those features, to where only certain things are presented on thescreen based on certain previous selections, like while viewing the third menu option, may not want to be presented with everything that is in the second, or something like that.

    Just some thoughts. I haven't gone to look at franks work to compare, but as I said, his contribution may fit into your overall business or be an improvement.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Password Protecting the Catalog

    Ok I think I may be getting some sort of grip on this problem. Researching the php cookie set function I see that all browsers share the same cookie jar so you should only have one browser open at a time (I usually have two for testing purposes).

    So closing down Chrome seems to kickstart IE11 to work .... I will keep testing this out.

  10. #10
    Join Date
    May 2014
    Location
    UK
    Posts
    317
    Plugin Contributions
    0

    Default Re: Password Protecting the Catalog

    Thanks for your comments guys.

    Frank ... I'll PM you site details as well

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Password protecting subcategories?
    By forbish07 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 6 Sep 2012, 03:51 AM
  2. Password Protecting my site
    By nic678dog in forum General Questions
    Replies: 3
    Last Post: 31 Mar 2009, 06:02 PM
  3. Password Protecting a subdomain?
    By datatv in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Oct 2008, 12:58 AM
  4. Password protecting a category
    By frank18 in forum General Questions
    Replies: 10
    Last Post: 3 Aug 2008, 10:50 AM
  5. Password Protecting a category
    By jewelsbyjewls in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 27 Nov 2006, 07:52 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