Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to requirie log in to access everything


  • allenweiss
    Participant

    @allenweiss

    I’ve seen code that allow you to keep people from accessing the members list if they aren’t logged in, but I’m looking for something will will keep people out of the entire site (except the home page) unless they are logged in. Anybody know of how I can do this? Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • So you want to just redirect anyone who’s not logged in to a static homepage with only static content?


    allenweiss
    Participant

    @allenweiss

    just to the home page of buddypress, like here:

    http://alumnidev.com/


    chewbaker
    Participant

    @chewbaker

    Hey, I have been having the same problem! I found a partial solution to this in a previous post, but it only makes certain specified ‘slugs’ private, and not the entire site. Is there anyway we can modify this code to make it privatize the whole site?

    the code is located in bp-custom.php in the mu-plugins folder.

    //this makes directories private

    function oci_restrict_access(){
    global $bp, $bp_unfiltered_uri;

    if (!is_user_logged_in() &&
    (BP_MEMBERS_SLUG == $bp_unfiltered_uri[0] ||
    BP_FORUMS_SLUG == $bp->current_component ||
    BP_GROUPS_SLUG == $bp->current_component ||
    BP_HOME_BLOG_SLUG == $bp->current_component)){

    bp_core_redirect( get_option('home') . "/wp-login.php" );
    }
    }
    add_action( 'wp', 'oci_restrict_access', 3 );

    any help would be great!


    allenweiss
    Participant

    @allenweiss

    Thanks..I’ll try this (and hope it works in BP 1.1. Without being able to protect the site, as much as I like BuddyPress, its essentially worthless for use in private communities…I sure hope someone comes up with plugin for 1.1.


    bobin1983
    Participant

    @bobin1983

    Hi there,

    I tried login-configurator as this redirects the whole site to login page, and then you can allow whitelist URLs to pass through like /register and /activate.

    I did have this working last night, but now it is not working and redirects the whitelist URLs to login.

    If anybody else gives this a go I’d be interested how you get on?

    Robin


    bobin1983
    Participant

    @bobin1983


    danbpfr
    Participant

    @chouf1


    Tore
    Participant

    @toregus

    Registered users only 2 doesn’t work currently with BP 1.2. It cannot handle the new way of registration from BP.


    Jehy
    Participant

    @jehy


    disbas
    Participant

    @disbas

    Well, I solved this by putting bp on a subblog that can only be visited by registered users. That’s one way of doing it. Thing is though, that all info can be seen if you know the exact address of the page you want to visit

    @jehi: does your pligin cover this?


    Tore
    Participant

    @toregus

    @ Disbas: Yes, it does.

    Also google or others may search and document all of your website if not protected.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to requirie log in to access everything’ is closed to new replies.
Skip to toolbar