Skip to:
Content
Pages
Categories
Search
Top
Bottom

Log Out Redirect Error

  • I am running bleeding edge BP, and my log out redirect doesn’t take me to the homepage as it does on testbp.org, it does not log me out and takes me to whole address that including the logout section of the url. This has been the case since I started somewhere in the 500′s. I think that this is probably one of the bugs from being on a shared server, but figured I would ask if a solution was in the works?

    Of course I can also work around this, but it was intriguing to me that it didn’t work.

Viewing 16 replies - 1 through 16 (of 16 total)
  • I have a similar (the same) issue – generic error message states:

    You are attempting to log out of [blog name]

    Please try again.

    Avatar of Wardeh
    Wardee
    Participant

    @wardeh

    Here’s the solution: http://trac.buddypress.org/ticket/229

    Looks like it is in the works…

    Avatar of Mdsports
    mdsports
    Participant

    @mdsports

    This solution lands me back at the standard wordpress branded logged out screen. How do I make it redirect the user to a logged out version of the bp homepage. Also, does this same solution apply for the username/logout area directly below the adming bar on the right side of the page?

    Avatar of Mdsports
    mdsports
    Participant

    @mdsports

    Here’s the code which can be found in the BP home theme header:

    <?php if ( function_exists(‘wp_logout_url’) ) : ?>

    / ” alt=”<?php _e( ‘Log Out’, ‘buddypress’ ) ?>”><?php _e( ‘Log Out’, ‘buddypress’ ) ?>

    <?php else : ?>

    / “><?php _e( ‘Log Out’, ‘buddypress’ ) ?>

    <?php endif; ?>

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Both the member adminbar and the home theme logout options take you back to the originating url. Upgrade to the latest trunk or the beta download.

    Avatar of Elishahong
    elishahong
    Member

    @elishahong

    This header logout link bug isn’t fixed yet. I downloaded the latest trunk. Any solution to this problem?

    Avatar of yu
    yu
    Participant

    @gerbilo

    hm.. i have and my logout header link is working good oO

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    @elishahong Can you explain where this logout link is? Home theme, member theme, admin bar… Exactly where does it take you and what version of mu are you running?

    Avatar of Elishahong
    elishahong
    Member

    @elishahong

    Home theme, where the root of my blog is located, in fact the admin bar(drop down list [log out]) is also affected.

    I got this result for both the log out links for the home theme and the admin bar:

    You don’t have permission to access /blog/wp-login.php on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I attempted to replace the code for the admin bar and got the same result as how mdsports had. It didn’t redirect to my home blog page.

    I downloaded the latest WordPressMU and BuddyPress(I used the beta link that was given)

    Here’s the admin bar code which I identified:

    // **** “Log In” and “Sign Up” links (Visible when not logged in) ********

    function bp_adminbar_login_menu() {

    if ( !is_user_logged_in() ) {

    echo ‘<li class=”bp-login no-arrow”>‘ . __( ‘Log In’, ‘buddypress’ ) . ‘‘;

    // Show “Sign Up” link if registrations are allowed

    if ( get_site_option( ‘registration’ ) != ‘none’ ) {

    echo ‘<li class=”bp-signup no-arrow”>‘ . __( ‘Sign Up’, ‘buddypress’ ) . ‘‘;

    The Home theme header logout link(the one to the right) is also similar but I have no idea how PHP really works and I spent a few hours figuring out what the problem was but I’m interested to learn how these stuff works and I hope you guys can enlighten me.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    @elishahong The logout redirects the user to the blog they are on when they logout, not the home blog. This is not a bug. It’s normal behavior.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    The 404s when logging out indicate some kind of configuration problem. How do you have mu installed? Can you do all the normal things like create a new blog and access it? Post articles on your non-home blogs? View them again?

    Is everything working ok except the logout?

    Avatar of Elishahong
    elishahong
    Member

    @elishahong

    Everything works perfectly but the Logout option. I can create blogs and all that.

    I installed WordPressMU on a subdirectory.

    Now I’m getting more errors for some reason maybe you might know what’s this:

    Warning: ksort() expects parameter 1 to be array, null given in /blog/wp-content/mu-plugins/bp-core.php on line 1072

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /blog/wp-content/mu-plugins/bp-core.php on line 1075

    # My Account

    Warning: Invalid argument supplied for foreach() in /blog/wp-content/mu-plugins/bp-core/bp-core-adminbar.php on line 58

    * Log Out

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    elishahong, this forum is running with a cache operating. You have to refresh your browser to see your post. Sending your post and returning to the original page doesn’t do that. You had about half a dozen messages saying the same thing. :) Sometimes you see your post and sometimes you don’t. Gotta mention that to the powers that be.

    Let me go look at the source of those errors you are getting.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    All these errors seem to be related to the fact that the various components in bp aren’t initializing properly. Your setup is like:

    ../<document root>/<wpmu subdirectory>/wp-content/mu-plugins/<bp installed here>

    ../<document root>/<wpmu subdirectory>/wp-content/member-themes/buddypress-member

    ../<document root>/<wpmu subdirectory>/wp-content/themes/buddypress-home

    ?

    Avatar of Elishahong
    elishahong
    Member

    @elishahong

    Hey I apologize for that, I thought something went wrong with my browser.

    Well I installed BuddyPress using the Combo Zip and I got all that problem. When I reinstalled using the trunk version, everything became alright but the login issue remains a problem.

    It seems that the redirect code is not redirecting to the main blog and as I mentioned earlier. I am referring to the “Header” section of the “Home Theme”

    I identified the code from the header. Here’s the code:

    <?php if ( function_exists(‘wp_logout_url’) ) : ?>

    / ” alt=”<?php _e( ‘Log Out’, ‘buddypress’ ) ?>”><?php _e( ‘Log Out’, ‘buddypress’ ) ?>

    <?php else : ?>

    / “><?php _e( ‘Log Out’, ‘buddypress’ ) ?>

    <?php endif; ?>

    Is it possible for someone to help me adjust this script so as to make it log out to the login page instead of a redirect? Although I wish that it would redirect to my main blog but I’ll settle for less. Help me look at a bigger picture here, I’ve installed everything and followed every possible instruction that I can find but help me understand what’s going on with this code and I’ll learn from it.

    Thank you for your patience and understanding.

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    I have a signature running on other forums that reads: “You’re not doing anything wrong. Stop trying to do it right.”

    In this case that’s appropriate. The stock behavior for mu and bp is to redirect back to the original url. But we don’t have to live with stock behavior. We got code.

    The offending hunk we’re talking about is the various places that bp allows a user to logout. In all cases it has ‘redirect_to=’ site_url(). This takes the user back to where the logged out from. site_url() is what you want to change.

    You need to say get_blog_option(1, ‘siteurl’) instead of that. That gets the url for the root/home blog in mu, blog id 1.

    You’ll see two logout lines wherever bp allows a logout option. One is for mu 2.7 and it reads: wp_logout_url(site_url()). The other just reads ‘redirect_to=’ site_url()

    The mu 2.7 version adds some security stuff to the mix and needs that wp_logout_url() call. In both cases and in all spots change ‘site_url()’ to get_blog_option(1, ‘siteurl’) and things will work as you want them to work.

    I see the header in the home theme, two places in the member theme and the admin bar as spots to change.

    header.php - www/wp-content/themes/buddypress-home line 48 <?php if ( function_exists('wp_logout_url') ) : ?>

    header.php - www/wp-content/member-themes/buddypress-member line 46 <?php if ( function_exists('wp_logout_url') ) : ?>

    bp-core-adminbar.php - www/wp-content/mu-plugins/bp-core line 81 if ( function_exists('wp_logout_url') ) {

    bp-core-templatetags.php - www/wp-content/mu-plugins/bp-core line 55 if ( function_exists( 'wp_logout_url' ) ) {

    Those line numbers may not be exact in all cases but it’ll be in the general vicinity.

    The problem that you have to be aware of is that you are modifying stuff that will get overwritten when you update your bp installation. You’ll have to make sure that if you use SVN things get merged in properly and if you’re not using SVN then you’ll manually have to go around and put the mods back in each time.

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

You must be logged in to reply to this topic.