Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to redirect to login and return

  • Avatar of caplain
    caplain
    Member

    @caplain

    If a user is not logged in and tries to access a buddypress path, they’re redirected to the site base url – either by actual redirection or by truncating the path (I don’t know which). This is not an expected behavior on the web. If a user is not logged in, they should be redirected to /wp-login.php?redirect_to=[urlencoded-source-url]. I can’t believe buddypress doesn’t work this way. Am I missing something? If buddypress can’t do this as-is, how do find where it prevents logged-out users from accessing buddypress paths?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of caplain
    caplain
    Member

    @caplain

    It looks like what I want to do could be done in /bp-core/bp-core-catchuri.php:function bp_core_catch_no_access() by starting the function with:

    if ( $bp_no_status_set ) bp_core_redirect($bp->root_domain.”/wp-login.php?redirect_to=”.$bp_unfiltered_uri);

    instead of just returning false, but bp_core_catch_no_access() doesn’t seem to be called anywhere.

    Avatar of caplain
    caplain
    Member

    @caplain

    A related thread, http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/no-must-login-message-or-redirect, had a short life about three weeks ago. It looks like the bp_core_catch_no_access() function is not actually used.

    Avatar of caplain
    caplain
    Member

    @caplain

    I’m really mystified. I added to /members/single/groups/invites.php in my child theme. Then went to http://www.rocketmavericks.com/members/eric/groups/invites, but cc_core_catch_no_access() didn’t seem to be called. I was going to add my function to bp_before_group_invites_content() (see /bp-themes/bp-default/members/single/groups/invites.php:<?php do_action( 'bp_before_group_invites_content' ) for reference), but I grep'd for that function and couldn't find that function defined anywhere. Am I just stumbling upon hooks that haven't been implemented yet?

    Avatar of caplain
    caplain
    Member

    @caplain

    I opened a ticket for the seemingly undeclared bp_before_group_invites() and for bp_core_catch_no_access(), which doesn’t appear to be called anywhere.

    http://trac.buddypress.org/ticket/2537

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.