virtual directory protection

Discussion in 'Setting-up protection' started by cmireles, Feb 23, 2013.

  1. cmireles

    cmireles New Member

    Joined:
    Jul 5, 2012
    Messages:
    22
    Howdy all, can you tell me what is the method for protecting a virtual directory? In general is fine, but I'm using WordPress with aMember installed, and would like to protect the entire virtual directory /members/ I thought maybe I could include the php script and check the $_SERVER url to then include the script if needed. Am I on the right path or is there a better way?

    Thanks, Jon
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
  3. cmireles

    cmireles New Member

    Joined:
    Jul 5, 2012
    Messages:
    22
    Alexander, thanks but when I do this I can only protect that particular page. I have a whole bunch of pages (driven by buddypress) underneath that virtual directory within WordPress.. am I missing something here?

    e.g. urls:

    /members/ (everything under here should be accessible only to members with a certain product)
    /members/forum
    /members/forum/page/etc/
    /members/member-directory
    /members/etc...

    Thanks, Jon
  4. cmireles

    cmireles New Member

    Joined:
    Jul 5, 2012
    Messages:
    22
    Howdy, I don't know if this will help anyone else, but I ended up just doing this manually via the header, and it seems to work well for me running aMember & WordPress with virtual directory /members-area/ that contains a bunch of pages and BuddyPress install. If this is not good, please let me know.

    Thanks! Jon

    PHP:
        //aMember
        
    $lite Am_Lite::getInstance();
     
        
    //add check for access if we're on /members-area/
        
    if (strpos($_SERVER['REQUEST_URI'], "/members-area") === 0) { $lite->checkAccess(array(1)); }

Share This Page