Results 1 to 10 of 188

Hybrid View

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

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Danielle, can you set category 16 (bath) as a restricted category (even if only temporary) and report back how this category responds. Reason being that this issue has got me puzzled - despite the local time being already midnight and my bed is waiting for me.....

    Thanks / Frank

  2. #2
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Quote Originally Posted by frank18 View Post
    Danielle, can you set category 16 (bath) as a restricted category (even if only temporary) and report back how this category responds. Reason being that this issue has got me puzzled - despite the local time being already midnight and my bed is waiting for me.....

    Thanks / Frank
    It behaves the same way, if I am not logged in, it takes me to the login page. If I am logged in, it takes me to the My Account page, regardless of whether my user account has special privileges or not.

    I have zipped the includes folder and e-mailed it to you.

    Thanks!
    Danielle

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

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Quote Originally Posted by Danielle View Post
    It behaves the same way, if I am not logged in, it takes me to the login page. If I am logged in, it takes me to the My Account page, regardless of whether my user account has special privileges or not.

    I have zipped the includes folder and e-mailed it to you.

    Thanks!
    Danielle,

    I checked your includes folder but can't find anything sinister.

    The file that tests for restrictions and privileges is

    includes/modules/pages/index/header_php.php
    The relevant code at the end of that file is

    PHP Code:
    // ********* bof CATEGORY_RESTRICTION **********
    /**
    * we want product details of certain categories to be accessible by members only so redirect them to the login page
     */
    if (!$_SESSION['customer_id'] && !$_SESSION['customers_privileges'] > && in_array($current_category_id,explode(','CATEGORY_RESTRICTION_LOGIN_CATEGORY)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL')); 
          }

    /**
    * we are testing if a logged in customer has special privileges to view products in this category
     */
    if ($_SESSION['customer_id'] && !$_SESSION['customers_privileges'] > && in_array($current_category_id,explode(','CATEGORY_RESTRICTION_LOGIN_CATEGORY)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
          }
      
    /**
    * we are testing if a logged in customer has special privileges to view products of a restricted manufacturer
     */
    if (!$_SESSION['customers_privileges'] > && in_array($_GET['manufacturers_id'],explode(','CATEGORY_RESTRICTION_LOGIN_MANUFACTURER)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL')); 
          }

    if (
    $_SESSION['customer_id'] && !$_SESSION['customers_privileges'] > && in_array($_GET['manufacturers_id'],explode(','CATEGORY_RESTRICTION_LOGIN_MANUFACTURER)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL')); 
          }

    // ********* eof CATEGORY_RESTRICTION **********


    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_INDEX'); 
    ... and all of that code looks perfectly ok to me in your file

    Can you please double check that your admin/customers.php file has been merged correctly. I am beginning to think that special privileges are not being posted to the DB when editing customer details and the customer remains a *normal" customer (no privileges).

    Thanks / Frank
    Last edited by frank18; 13 Nov 2013 at 08:56 AM.

  4. #4
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Hi Frank,

    I checked in phpMyAdmin and I can see that the privileges are being posted. It does save it in the admin as well and shows in the customer list that the customer has privileges.

    Quote Originally Posted by frank18 View Post
    Danielle,

    I checked your includes folder but can't find anything sinister.

    The file that tests for restrictions and privileges is



    The relevant code at the end of that file is

    PHP Code:
    // ********* bof CATEGORY_RESTRICTION **********
    /**
    * we want product details of certain categories to be accessible by members only so redirect them to the login page
     */
    if (!$_SESSION['customer_id'] && !$_SESSION['customers_privileges'] > && in_array($current_category_id,explode(','CATEGORY_RESTRICTION_LOGIN_CATEGORY)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL')); 
          }

    /**
    * we are testing if a logged in customer has special privileges to view products in this category
     */
    if ($_SESSION['customer_id'] && !$_SESSION['customers_privileges'] > && in_array($current_category_id,explode(','CATEGORY_RESTRICTION_LOGIN_CATEGORY)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
          }
      
    /**
    * we are testing if a logged in customer has special privileges to view products of a restricted manufacturer
     */
    if (!$_SESSION['customers_privileges'] > && in_array($_GET['manufacturers_id'],explode(','CATEGORY_RESTRICTION_LOGIN_MANUFACTURER)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL')); 
          }

    if (
    $_SESSION['customer_id'] && !$_SESSION['customers_privileges'] > && in_array($_GET['manufacturers_id'],explode(','CATEGORY_RESTRICTION_LOGIN_MANUFACTURER)) ) {
        
    $_SESSION['navigation']->set_snapshot();
      
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL')); 
          }

    // ********* eof CATEGORY_RESTRICTION **********


    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_INDEX'); 
    ... and all of that code looks perfectly ok to me in your file

    Can you please double check that your admin/customers.php file has been merged correctly. I am beginning to think that special privileges are not being posted to the DB when editing customer details and the customer remains a *normal" customer (no privileges).

    Thanks / Frank
    Danielle

  5. #5
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Just an update that I also just tried restricting by manufacturer instead of category, and when I do that, I can access everything, with or without privileges. It doesn't restrict anything. So it's the exact opposite of if I try and restrict by category, in which case it restricts everything even if I do have privileges. So strange!
    Danielle

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

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Quote Originally Posted by Danielle View Post
    Just an update that I also just tried restricting by manufacturer instead of category, and when I do that, I can access everything, with or without privileges. It doesn't restrict anything. So it's the exact opposite of if I try and restrict by category, in which case it restricts everything even if I do have privileges. So strange!
    OK I figured it out! It is just the authorization settings in the admin.

    We need Customer Approval Status – Authorization Pending set to 2, because we don’t want retail customers to see an add to cart button, checkout, etc. If I set it to 0, the CSAR mod works perfectly. Setting that value to anything else makes the CSAR mod not function correctly.
    Just tried to replicate this on my CSAR demo site: I set cust auth to '2' then went to the store front, clicked on a restricted cat and was redirected to the login page. Logged in and I had immediate access - just the same as if cust auth was set to '0'. The status of cust auth should have no bearing on the behaviour of CSAR.

    So.... that behaviour is still in contrast to what you are experiencing with your site. There still has to be a clash with one of the other installed mods. As a workaround you may want to set cust auth to '0' AND then enter every single master cat as price restricted (the top line in CSAR admin...). If that works then at least the store can be operational again. It is only a workaround - no permanent solution and tedious if there are lots of categories.....

    Cheers / Frank

  7. #7
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Category Specific Access Restriction (CSAR) - [Support Thread]

    Well that's bizarre, because none of our mods have anything to do with the customer authorization status either. In any case, I did some custom coding and made a workaround that works for our store.

    Thank you for all your help!

    Quote Originally Posted by frank18 View Post
    Just tried to replicate this on my CSAR demo site: I set cust auth to '2' then went to the store front, clicked on a restricted cat and was redirected to the login page. Logged in and I had immediate access - just the same as if cust auth was set to '0'. The status of cust auth should have no bearing on the behaviour of CSAR.

    So.... that behaviour is still in contrast to what you are experiencing with your site. There still has to be a clash with one of the other installed mods. As a workaround you may want to set cust auth to '0' AND then enter every single master cat as price restricted (the top line in CSAR admin...). If that works then at least the store can be operational again. It is only a workaround - no permanent solution and tedious if there are lots of categories.....

    Cheers / Frank
    Danielle

 

 

Similar Threads

  1. Category Specific Restriction of Product Price Display (OLD v1 mod)
    By frank18 in forum All Other Contributions/Addons
    Replies: 40
    Last Post: 26 May 2013, 11:38 PM
  2. v150 [Not a bug] Category Specific Access Restriction‏
    By raf696 in forum Bug Reports
    Replies: 3
    Last Post: 17 Mar 2012, 03:26 AM
  3. v150 Category Specific Access Restriction‏
    By raf696 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 16 Mar 2012, 10:25 PM
  4. v150 Category Specific Access Restriction
    By raf696 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 13 Mar 2012, 07:36 PM
  5. Gallery Category support thread
    By gjh42 in forum All Other Contributions/Addons
    Replies: 26
    Last Post: 26 Sep 2008, 09:38 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