Issue regarding Am_Lite::FREE constant

Discussion in 'aMember Pro v.4' started by crault, Dec 27, 2011.

  1. crault

    crault New Member

    Joined:
    Sep 17, 2011
    Messages:
    10
    Hello everyone,

    I am creating my own scripts to protect my webpages, following indications available via:
    http://v4.amember.com/docs/Content/PHPScripts

    When in the very beginning of my webpage's code, I put the following, it works fine:

    <?php
    include("/var/www/amember4/library/Am/Lite.php");
    Am_Lite::getInstance()->checkAccess(array(1,2), 'this subscription-only page');
    ?>

    However, when I try to make the page accessible for Free using:

    <?php
    include("/var/www/amember4/library/Am/Lite.php");
    Am_Lite::getInstance()->checkAccess(Am_Lite::FREE, 'this subscription-only page');
    ?>

    It still asks me for a login and a password.

    Thanks in advance for your help.
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    It will allow access only if customer has subscription to "free" product.

    If you want to make subscription accessible for free, use
    PHP:
    Am_Lite::getInstance()->checkAccess(Am_Lite::ONLY_LOGIN'this subscription-only page');
  3. crault

    crault New Member

    Joined:
    Sep 17, 2011
    Messages:
    10
    OK, my mistake: tought Am_Lite::FREE was to let anyone access the page, without any subscription to "free" product.

    Now, I understand, thanks very much.

Share This Page