Results 1 to 6 of 6
  1. #1
    Join Date
    May 2006
    Location
    Texas
    Posts
    565
    Plugin Contributions
    4

    Default Require Login for Certain Pages

    I'm looking to require login on certain define pages - I have the "about us" contribution installed (and cloned for 4 other pages).. and need one of them to be logged into to view. How would I go about doing this?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Require Login for Certain Pages

    Look in the files of pages that already do this, such as account;
    /includes/modules/pages/account/header_php.php

    PHP Code:
    if (!$_SESSION['customer_id']) {
      
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));

    This code requires the customer be logged in or taken to login then returned after to where the customer was headed ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    May 2006
    Location
    Texas
    Posts
    565
    Plugin Contributions
    4

    Default Re: Require Login for Certain Pages

    Thank you for the help! Works like a charm :)

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Require Login for Certain Pages

    Thanks for the update that this was able to work the way you needed it to ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    May 2006
    Posts
    46
    Plugin Contributions
    0

    Default Re: Require Login for Certain Pages

    Quote Originally Posted by Ajeh View Post

    PHP Code:
    if (!$_SESSION['customer_id']) {
      
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));

    Does this work with EZ pages? if not, is it possible to do the same thing (only let registered people view a certain and/or all ez pages)

    And if it does work were would i have to put it?

    thanks in advance

  6. #6
    Join Date
    May 2006
    Posts
    46
    Plugin Contributions
    0

    Default Re: Require Login for Certain Pages

    http://www.zen-cart.com/forum/showth...t=pages+logged

    everything explained for restricting ez pages to registered users only. did it and works too

 

 

Similar Threads

  1. v151 Require Login for Certain Categories or Products
    By clausont in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 6 Jun 2013, 01:41 PM
  2. Replies: 1
    Last Post: 11 Feb 2010, 11:40 AM
  3. Replies: 0
    Last Post: 5 Nov 2009, 04:49 PM
  4. How do I disable certain columns in for certain pages?
    By francocauter in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 13 Feb 2008, 05:32 PM
  5. forcing customers to login for only certain pages
    By mmorpgwarehouse in forum Managing Customers and Orders
    Replies: 2
    Last Post: 21 Mar 2007, 01:07 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