Zen Cart Logo
Forums / General Questions / Password Protecting the Catalog

Password Protecting the Catalog

Views: 1,113

Results 1 to 12 of 12
27 Apr 2015, 3:40 PM
#1
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

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?

27 Apr 2015, 4:44 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

27 Apr 2015, 5:07 PM
#3
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Password Protecting the Catalog

mc12345678:

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

27 Apr 2015, 5:14 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Password Protecting the Catalog

DigiBooks:

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.

27 Apr 2015, 8:03 PM
#5
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Password Protecting the Catalog

mc12345678:

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'%29;> 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
27 Apr 2015, 10:32 PM
#6
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

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

28 Apr 2015, 12:29 AM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Password Protecting the Catalog

DigiBooks:

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'%29;> 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.

28 Apr 2015, 12:30 AM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Password Protecting the Catalog

DigiBooks:

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'%29;> 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.

28 Apr 2015, 7:02 AM
#9
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Password Protecting the Catalog

Thanks for your comments guys.

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

28 Apr 2015, 11:31 AM
#10
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Password Protecting the Catalog

mc12345678:

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.

The odd thing is, is if there is a cookie cleanup somewhere, then I cannot see why it would return the user to the site front page yet still be 'logged' in via the site-wide cookie set at the beginning. If a user bookmarks the Library and goes direct without the cookie being set they are returned correctly to the front page to log in. Once logged in every click takes them back to the front page yet they are still logged in!

The other php software - well one is a simple php upload which enables users to send us files in zip format where it is stored in an online repository and admin can download and process the files (the program is eXtplorer). The other is Maiain Guestbook which we have amended to act as a wishlist posting system.

28 Apr 2015, 11:38 AM
#11
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

Re: Password Protecting the Catalog

Just carried out some more tests. This problem is happening in IE11 ..... Chrome is working fine

28 Apr 2015, 12:07 PM
#12
digibooks avatar

digibooks

Zen Follower

Join Date:
May 2014
Location:
UK
Posts:
317
Plugin Contributions:
0

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.