Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'logout redirect'

Viewing 25 results - 101 through 125 (of 127 total)
  • Author
    Search Results
  • #63376
    Bowe
    Participant

    Sorry for the tripple post.. the correct logout redirection is:

    <?php echo wp_logout_url(site_url() ); ?>

    #63369
    Bowe
    Participant

    Ow and you can solve the logout redirect like this:

    http://themysite.com/wp-login.php?action=logout&redirect_to=http://mysite.com

    :)

    #51775
    peterverkooijen
    Participant

    I’ve copied all code from wp-login.php to a custom wp page in my template called memberlogin.php at mywebsite.com/login. I had to make this edit to make the login form show up at that address:

    require( '././wp-load.php' );

    Unfortunately, the form is broken, so there must be other addresses in the file that require editing…

    EDIT 1: There’s an obvious culprit:

    <form name="lostpasswordform" id="lostpasswordform" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" method="post">

    Replaced all instances of ‘wp-login.php’ with ‘login’. Will all the code work without the php?

    Yes! Logging in via this form works.

    Unfortunately logging out does NOT work… :-(

    When I try /login?action=logout directly in the browser address bar I get this:

    You are attempting to log out of Your Site

    Do you really want to log out?

    After confirming the message bar says ‘failure noticed’ and I’m redirected to the homepage, still logged-in.

    Apparently those ?actions don’t get taken along with the redirect. The redirect is just a blunt redirect to the /login and there it ends. :-(

    #51043
    Korhan Ekinci
    Participant

    Ok Kunal replace this part:

    <?php
    if ( function_exists('wp_logout_url') ) {
    $logout_link = '/ <a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
    } else {
    $logout_link = '/ <a href="' . $bp->root_domain . '/wp-login.php?action=logout&redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
    }

    echo apply_filters( 'bp_logout_link', $logout_link );
    ?>

    With This:

    <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout</a>

    And that should solve the logout issue.

    #51039
    Kunal17
    Participant

    I was trying to figure out why the log in form was not showing up at all.

    Replacing

    <?php elseif ( get_option(‘users_can_register’) ) : ?>

    with

    <?php else ://if ( get_option(‘users_can_register’) ) : ?>

    seems to do the trick. Not sure why the get_option code does not work. Do I need to have that check?

    Still trying to figure out how to redirect to the same page on logout.

    #51037
    Kunal17
    Participant

    Korhan,

    I tried the code you provided:

    If I browse to my p2 user blog while logged out, it does not show me anything in the userbar. I would like to provide the user the option to log in from the user blog itself. Is the code supposed to show the BP log in/signup links in the userbar?

    If I browse to my p2 user blog while logged in, it shows the user avatar, member profile link and logout link. If I click the logout link, it takes me to the standard WP login page with the message ‘you are logged out’. Can you suggest a way to have it redirect to the same page on the userblog frontend except with the user logged out?

    I hope I am being clear about my questions. I am a novice at programming so only have a basic understanding of what the code is doing.

    Thanks again for your help.

    #50973
    Korhan Ekinci
    Participant

    For some how the code above did not go through correcty, I will paste the first part again:

    <div id="search-login-bar">

    <?php if ( is_user_logged_in() ) : ?>

    <div id="logout-link">
    <?php bp_loggedinuser_avatar_thumbnail( 20, 20 ) ?> &nbsp;
    <?php bp_loggedinuser_link() ?>
    <?php
    if ( function_exists('wp_logout_url') ) {
    $logout_link = '/ <a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
    } else {
    $logout_link = '/ <a href="' . $bp->root_domain . '/wp-login.php?action=logout&redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
    }

    echo apply_filters( 'bp_logout_link', $logout_link );
    ?>

    <?php do_action( 'bp_login_bar_logged_in' ) ?>
    </div>

    <?php elseif ( get_option('users_can_register') ) : ?>

    <form name="login-form" id="login-form" action="<?php echo $bp->root_domain . '/wp-login.php' ?>" method="post">
    <input type="text" name="log" id="user_login" value="<?php _e( 'Username', 'buddypress' ) ?>" onfocus="if (this.value == '<?php _e( 'Username', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Username', 'buddypress' ) ?>';}" />
    <input type="password" name="pwd" id="user_pass" class="input" value="" />

    <input type="checkbox" name="rememberme" id="rememberme" value="forever" title="<?php _e( 'Remember Me', 'buddypress' ) ?>" />

    <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e( 'Log In', 'buddypress' ) ?>"/>
    <input type="button" name="signup-submit" id="signup-submit" value="<?php _e( 'Sign Up', 'buddypress' ) ?>" onclick="location.href='<?php echo bp_signup_page() ?>'" />

    <input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" />
    <input type="hidden" name="testcookie" value="1" />

    <?php do_action( 'bp_login_bar_logged_out' ) ?>
    </form>
    <?php endif // get_option('users_can_register') ?>

    <div class="clear"></div>
    </div>

    #50972
    Korhan Ekinci
    Participant

    Hi Kunal17, I use prologue theme as default user theme and I also wanted to keep the login form on top, so I added this to the header of the prologue theme:

    <div id=”search-login-bar”>

    <?php if ( is_user_logged_in() ) : ?>

    <div id=”logout-link”>

    <?php bp_loggedinuser_avatar_thumbnail( 20, 20 ) ?>  

    <?php bp_loggedinuser_link() ?>

    <?php

    if ( function_exists(‘wp_logout_url’) ) {

    $logout_link = ‘/ root_domain ) . ‘”>’ . __( ‘Log Out’, ‘buddypress’ ) . ‘‘;

    } else {

    $logout_link = ‘/ root_domain . ‘/wp-login.php?action=logout&redirect_to=’ . $bp->root_domain . ‘”>’ . __( ‘Log Out’, ‘buddypress’ ) . ‘‘;

    }

    echo apply_filters( ‘bp_logout_link’, $logout_link );

    ?>

    <?php do_action( ‘bp_login_bar_logged_in’ ) ?>

    </div>

    <?php elseif ( get_option(‘users_can_register’) ) : ?>

    <form name=”login-form” id=”login-form” action=”<?php echo $bp->root_domain . ‘/wp-login.php’ ?>” method=”post”>

    <input type=”text” name=”log” id=”user_login” value=”<?php _e( ‘Username’, ‘buddypress’ ) ?>” onfocus=”if (this.value == ‘<?php _e( ‘Username’, ‘buddypress’ ) ?>’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘<?php _e( ‘Username’, ‘buddypress’ ) ?>’;}” />

    <input type=”password” name=”pwd” id=”user_pass” class=”input” value=”” />

    <input type=”checkbox” name=”rememberme” id=”rememberme” value=”forever” title=”<?php _e( ‘Remember Me’, ‘buddypress’ ) ?>” />

    <input type=”submit” name=”wp-submit” id=”wp-submit” value=”<?php _e( ‘Log In’, ‘buddypress’ ) ?>”/>

    <input type=”button” name=”signup-submit” id=”signup-submit” value=”<?php _e( ‘Sign Up’, ‘buddypress’ ) ?>” onclick=”location.href='<?php echo bp_signup_page() ?>'” />

    <input type=”hidden” name=”redirect_to” value=”http://&lt;?php echo $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’] ?>” />

    <input type=”hidden” name=”testcookie” value=”1″ />

    <?php do_action( ‘bp_login_bar_logged_out’ ) ?>

    </form>

    <?php endif // get_option(‘users_can_register’) ?>

    <div class=”clear”></div>

    </div>

    You can maybe replace the

    <div id=”search-login-bar”>

    <?php bp_login_bar() ?>

    <div class=”clear”></div>

    </div>

    part of your header.php file with the first code and I hope it will work for you.

    #42589
    vito687
    Participant

    Im having this same logout problem, logout redirects right back to the page where you were and you stay logged in? im on the latest branch of WPMU and latest TRUNK of BP

    #39526

    In reply to: BP-FBConnect Plugin

    clompers
    Member

    The test site is acting a bit odd when I login with my Facebook account. It thinks my profile is http://testbp.org/members/facebookuser/ which belongs to a Trent Adams. Trying to view settings redirects back to http://testbp.org/members/facebookuser/, as does trying to logout through the top grey toolbar.

    I’ve restricted my facebook profile quite a bit so maybe its relying on information facebook isn’t providing.

    #37473
    Sgrunt
    Participant

    i’ve re uploaded just now all bp. Nothing change…i’d like to understand where to modify the logout url, removing the redirect.

    I’ve tried changing the templatetags in bpcore but it sorts no changes.

    note: every time i try to paste the link url here in the forum, the post don’t go published

    #37421
    Sgrunt
    Participant

    no…i don’t understand where to change the redirect url. I’m using the beta 2 version with no trunk mixed in

    #37420
    MartinNr5
    Participant

    I’m sorry but I have to disagree. I have MartinNr5 as a user name but I still want to use my full name in the rest of the site. It makes it a lot more personal in my opinion.

    Have you solved the redirect problems?

    #37418
    MartinNr5
    Participant

    Hi.

    As for nr 1 I don’t follow. The WPMU user name field is for logging in to the site. The bp full name field is used everywhere else in bp whenever a user is referenced. So they shouldn’t ever “overwrite” eachother.

    At least this is how it works for me.

    2) Are you using the latest beta build (or trunk)? If you mix and match releases these redirect errors can and will occur. I had them myslef until I installed the latest version of the bp theme.

    Adam W. Warner
    Participant

    I have installed and been testing this login plugin, and it’s working great so far…even allows me to configure login and logout redirects, among other things.

    https://wordpress.org/extend/plugins/sidebar-login/

    #36035

    In reply to: Log Out Redirect Error

    Burt Adsit
    Participant

    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.

    #36028

    In reply to: Log Out Redirect Error

    elishahong
    Member

    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.

    #36009

    In reply to: Log Out Redirect Error

    elishahong
    Member

    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

    #36004

    In reply to: Log Out Redirect Error

    Burt Adsit
    Participant

    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?

    #36001

    In reply to: Log Out Redirect Error

    Burt Adsit
    Participant

    @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.

    #35992

    In reply to: Log Out Redirect Error

    elishahong
    Member

    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.

    #35955

    In reply to: Log Out Redirect Error

    Burt Adsit
    Participant

    @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?

    #35946

    In reply to: Log Out Redirect Error

    yu
    Participant

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

    #35944

    In reply to: Log Out Redirect Error

    elishahong
    Member

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

    #34541

    In reply to: Log Out Redirect Error

    Burt Adsit
    Participant

    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.

Viewing 25 results - 101 through 125 (of 127 total)
Skip to toolbar