WordPress.org

Ready to get started?Download WordPress

Forums

BulletProof Security
[resolved] Logout Redirection from WordPress 3.4.2 Admin Bar (16 posts)

  1. sweetmelody
    Member
    Posted 1 year ago #

    After upgraded to WP 3.4.2, logging out from WP top admin bar will not redirect users to homepage.

    How to troubleshoot that this is related to BPS or not?

    Thank you!

    http://wordpress.org/extend/plugins/bulletproof-security/

  2. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    You asked this question in this thread and you got it working before so follow the same steps. I am assuming this is actually a BuddyPress issue and not a BPS issue.
    http://wordpress.org/support/topic/plugin-bulletproof-security-bps-and-buddypress-logout-redirection?replies=5

  3. sweetmelody
    Member
    Posted 1 year ago #

    I have followed the steps of the link above before I posted this thread. What can I do now? Many thanks.

  4. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    When i log out of Buddypress i am redirected to the standard WordPress logout - example.com/wp-login.php?loggedout=true - BPS is not installed at all on the site i tested BuddyPress on. This is standard BuddyPress logout behavior and has nothing at all to do with BPS. So you will need to contact the BuddyPress folks about this.

  5. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    Oops i forgot to configure my XAMPP vhosts file for the BuddyPress test site. the BuddyPress logout does redirect by default to the homepage with BulletProof Modes activated and without BulletProof Modes activated so BPS is not interfering with this on my test site. there must be something else going on with your particular website. in the other comment you posted add your website URL so i can take a look at your website and see if there is anything obviously wrong on the frontend. Thanks.

  6. sweetmelody
    Member
    Posted 1 year ago #

    You are so right, the logout redirection has nothing to do with BPS. Here's a link explains that by default, logging out from WP admin bar located above the header redirects users to the login page >>> http://patrick.bloggles.info/2012/01/24/automatically-redirect-to-current-page-after-logout-wordpress/ .

    Somehow, I wonder how it can redirect to the homepage instead to the current page.

    /*
     * Automatically redirect to current page after user logout WordPress.
     */
    function get_current_logout( $logout_url ){
      if ( !is_admin() ) {
        $logout_url = add_query_arg('redirect_to', urlencode(( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), $logout_url);
      }
    
      return $logout_url;
    }
    
    add_filter('logout_url', 'get_current_logout');
    //add_filter('login_url', 'get_current_logout');

    I have tried to contact the author about the code but it seems that my comment can't be sent. Do not why? :(

    Tried to DIY by changing 'get_current_logout' to 'get_home_url', 'get_home_url_logout' and 'get_home_logout' but none of them work.

    The question is out of your plugin scope, you don't have to answer if you are unwilling.

    Thank you!

  7. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    Well since you have BuddyPress installed then this changes how you would do the redirect. i came across a plugin that will take care of this for you. it is specifically designed for BuddyPress logout redirection. If you want to do a DIY solution instead, then in your Google search term you should include "buddypress" example - "buddpress logout redirect"

    http://buddydev.com/plugins/bpdev-logout-redirect/

  8. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    hmm interesting your logout by clicking the logout on the page works perfectly fine and redirects to your homepage, but yes i see that the wp-admin bar logout redirects to the default WP logout page. Ok so i think you actually need to do some custom DIY coding, but try the plugin above out and see if it will do this for you. if you decide to do a DIY then you need to also find a coding solution that is specific to the wp admin bar, since logouts from the page are redirecting normally. so the search term you would want to use is something like this - "buddypress admin bar redirect logout"

  9. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    What is the status of this BuddyPress logout issue? Did you try the plugin above or find a DIY solution for BuddyPress?

  10. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    Any luck with the bpdev plugin or did you find a DIY solution?

  11. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    Since this issue/problem is not related to BPS then i am resolving this thread, but I will continue to assist you any way i can. You can continue to post new status updates or other info and i will continue to receive email notifications when you post. Thanks.

  12. sweetmelody
    Member
    Posted 1 year ago #

    The bpdev plugin did help to redirect to the homepage but a black bar with redirect logout url would appear once the mouse pointer was hovered over the site background. Hence, decided to uninstall it.

    I believe that if I could find the DIV code to replace 'get_current_logout' then it's a hurray but until now no successful case yet.

    /*
     * Automatically redirect to current page after user logout WordPress.
     */
    function get_current_logout( $logout_url ){
      if ( !is_admin() ) {
        $logout_url = add_query_arg('redirect_to', urlencode(( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), $logout_url);
      }
    
      return $logout_url;
    }
    
    add_filter('logout_url', 'get_current_logout');
    //add_filter('login_url', 'get_current_logout');
  13. AITpro
    Member
    Plugin Author

    Posted 1 year ago #

    I just did a Google search and i think i found the problem.

    OK.
    I have it running.

    I had to enable ‘Show adminbar on the homepage’ in GenesisConnect Settings.
    This displayed the BuddyPress admin bar at the top of my homepage where I was being redirected on logging in. *Then* I was able to use the BuddyPress admin bar to log in to WordPress.

    This was very confusing.

    I kept expecting to go straight to the old WordPress admin area after logging in.

    http://buddypress.org/community/groups/installing-buddypress/forum/topic/cant-access-wordpress-admin-panel-after-bp-installation/

    If this is not the exact problem then what this post tells you is that yes there is a known problem with Genesis Connect and BuddyPress regarding the wp admin bar.

  14. sweetmelody
    Member
    Posted 1 year ago #

    GOOD NEWS!!!

    Found this code and voila!

    add_filter('logout_url', 'logout_home', 10, 2);
    
    function logout_home($logouturl, $redir)
    {
    $redir = get_option('siteurl');
    return $logouturl . '&redirect_to=' . urlencode($redir);
    }

    Before the successful adventure, learnt from GC forum that the plugin had no interference on the logout redirection.

    Thank you so much for your light! Happy new week! :)

  15. Biswadip
    Member
    Posted 11 months ago #

    Thank you @sweetmelody! :-)

  16. sweetmelody
    Member
    Posted 11 months ago #

    Glad it helped! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags