osCmax v2.5 User Manual
Results 1 to 7 of 7

Blocking acces to the catalog to non-logged users

This is a discussion on Blocking acces to the catalog to non-logged users within the osCMax v2 Features Discussion forums, part of the osCmax v2.0 Forums category; I would like to know if it is possible to only allow registered users to be able to enter the ...

      
  1. #1
    Member dalogar's Avatar
    Join Date
    Dec 2010
    Posts
    64
    Rep Power
    13


    Default Blocking acces to the catalog to non-logged users

    I would like to know if it is possible to only allow registered users to be able to enter the public catalog. I mean, the whole site is blocked if you don't login before, like in the Admin side, if you don't login before in a login box, you are unable to access the admin panel.

    Does anyone of you know if there is any way to do this using any feature of osCmax or any osC add-on?

    Thank you very much.

  2. #2
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    1 out of 1 members found this post helpful.

    Default Re: Blocking acces to the catalog to non-logged users

    Yep there are a few over at the mothership ... it is fairly simple ... it just looks for the session variables being set.

    osCommerce Community Add-Ons

    Regards,
    pgmarshall
    _______________________________

  3. #3
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    1 out of 1 members found this post helpful.

    Default Re: Blocking acces to the catalog to non-logged users

    pgmarshall
    _______________________________

  4. #4
    Member dalogar's Avatar
    Join Date
    Dec 2010
    Posts
    64
    Rep Power
    13


    Default Re: Blocking acces to the catalog to non-logged users

    Thank you very much, that was exactly what I was looking for.

    I will give a try to these contributions.

  5. #5
    Member dalogar's Avatar
    Join Date
    Dec 2010
    Posts
    64
    Rep Power
    13


    Default Re: Blocking acces to the catalog to non-logged users

    Working! Pretty straightforward.

    Thank you for the references.

  6. #6
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: Blocking acces to the catalog to non-logged users

    Which one did you use? From memory the second one is easier ... I am just wondering as it might make a nice addition to v2.6.

    Regards,
    pgmarshall
    _______________________________

  7. #7
    Member dalogar's Avatar
    Join Date
    Dec 2010
    Posts
    64
    Rep Power
    13


    Default Re: Blocking acces to the catalog to non-logged users

    I used a part of the first one.

    I added at the end of my application_top.php file what it is said in the add-on:

    if (DOWN_FOR_MAINTENANCE=='false') { // avoids an infinite loop if DOWN_FOR_MAINTENANCE
    if(stristr($_SERVER["REQUEST_URI"], FILENAME_LOGIN) === FALSE && stristr($_SERVER["REQUEST_URI"], FILENAME_PASSWORD_FORGOTTEN) === FALSE && stristr($_SERVER["REQUEST_URI"], FILENAME_CREATE_ACCOUNT) === FALSE) {
    if (!tep_session_is_registered('customer_id')) {
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    }
    }

    And that's really all. Apart form this, I changed my template for not showing the header, left and right columns if not logged in, to have only the login box showed in the center of the page if you are not logged in.

    This works for me. If you see the above lines should be changed to work properly with 2.5, please tell me.

    It is fairly simple, and I think this could be great to add even to 2.5.

Similar Threads

  1. Prices for Logged-In Users Only
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 08-24-2009, 10:00 AM
  2. Prices for Logged-In Users Only
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 06-10-2009, 04:00 PM
  3. Prices for Logged-In Users Only
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 06-10-2009, 03:13 PM
  4. Prices for Logged-In Users Only
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 06-02-2009, 12:51 AM
  5. Prices for Logged-In Users Only
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 11-08-2008, 09:00 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
  •