Protect a Folder Without Requiring an Active Subscription

Discussion in 'Setting-up protection' started by basichip, Dec 20, 2008.

  1. basichip

    basichip New Member

    Joined:
    Mar 25, 2007
    Messages:
    22
    I would like my members to be able to access a page I have created and placed in a protected folder but I am forced to specify an active subscription

    At the bottom it reads:
    Require subscription
    user must have active subscription to one
    from the following products to access
    the protected area
    Or a box to check, JUST ANY ACTIVE SUBSCRIPTION IS ENOUGH.

    I want members to access this protected area with ACTIVE or EXPIRED subscriptions, but there is no option for that. The only visitors I am preventing are non registered users OR registered users that never purchased a subscription.

    Seems simple enough, but I can't figure out how to do this.

    I use htpasswd for protection.

    Thanks for any advice and happy holidays to all.

    ford
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    You cant do it with a standard protection.
    It wont let expired users access the content.

    You may be able to do it using php + session variables to check if the user is expired or active.

    David
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    alternatively you could probably do something like this in an .htaccess file in the directory you are looking to protect:

    Code:
    ########### AMEMBER START #####################
    
    AuthType Basic
    
    AuthName "Members Only"
    
    AuthUserFile /home/{ACCOUNT}/public_html/{ACCOUNT}/amember/data/.htpasswd
    
    AuthGroupFile /home/{ACCOUNT}/public_html/{ACCOUNT}/amember/data/.htgroup
    
    require valid-user
    
    ########### AMEMBER FINISH ####################
    
    ErrorDocument 401 https://mydomain.com/amember/signup.php?price_group=1
    The require valid-user should just check that they are authenticated with a user from aMember..

Share This Page