Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'logout redirect'

Viewing 25 results - 51 through 75 (of 174 total)
  • Author
    Search Results
  • #182968
    David Cavins
    Keymaster

    Does the logout redirect work if BuddyPress is deactivated (i.e. if you’re just running a typical WordPress site)?

    #182954
    Leonson
    Participant

    Hello People.

    When i activate buddypress 2.0.1 on wordpress version 3.8.3 i rechieve a Internal Server Error on the logout (redirection) page on my site. (/wp-login.php?action=logout&_wpnonce=b13eb0c456&redirect_to=http%3A%2F%2Frusrobgames.leonson.nl%2F%3Floggedout%3Dtrue). my site is http://rusrobgames.leonson.nl/

    I hope you can help me!
    Btw sorry for my bad english, i am dutch 😛

    Greetings from Holland!

    #176907
    #176319
    Gunjesh Gaurav
    Participant

    I have already rewrite the login and logout rules.i am trying to restrict homepage only for logedin users (not admin) and redirect them to another bp page when they try to go on homepage like facebook style homepage.

    q.corkal
    Participant

    I have the WP logout redirect working great throughout the site, and I have it set to redirect to the current page.

    However, when a user is on a page that involves the editing of their profile, the logout redirect goes to the wp-admin page.

    Any ideas on how I can fix this?

    Thanks everyone!

    #173932
    YvonneTaylor
    Participant

    WP 3.7.1 and BP 1.8.1 also
    theme my login and BP redirect login plugins

    http://www.thedogsclub.com/testing/

    If someone clicks out of my community (ie) does not logout but just clicks on one of the other navigation pages, then decides to re enter the community, they cannot do it.
    Where I have a page called Community from my normal WP menu at the moment it has info on the community with a link to login, is it possible that if someone is already logged into the site, this page would take the person back to their members activity page.
    I would need 2 sets of code, one to handle the action if user not logged and another to deal with a user previously logged in and wanting to return.

    My only other option that I can see is that if they click on the login again in the header the next screen shows the avatar and the option to log out, is there some way to add a link to the avatar that would redirect back to the members profile again.

    What I have in my testing mode at the moment is the second option but I added Return to Community but it takes me to an overall members page and I still cannot get a user back to their own activity page.

    I have a blue site navigation bar at the moment for testing purposes but I intend to remove that once I have everything working.

    Any help would be much appreciated.

    kvschwartz
    Participant

    In my widget menu, I added a log out link, but it just goes to username/logout – Any way to redirect this to the home or login page?

    #167296

    In reply to: too many redirects

    mewrd
    Participant

    the problem is that , well , i can’t see the problem ,i can login and logout from two different computers with no problems at all ,it is just that client that seems to have login issues . i don’t know how to fix a problem that i can’t see?
    i have tried to switch themes and deactivate plugins .is it something in the htaccess file?

    #166696
    yaakhi
    Participant

    Sorrry but could not find the line you mentioned 🙁 here is the whole bp_profile_as_homepage_fork.php file `<?php
    /*
    Plugin Name: BP Profile as Homepage Fork
    Description: Sets the user BP Profile as homepage on the site for logged in users. This emulates Facebook.
    Author: Mort3n
    Version: 1.0
    License: GPL2
    */

    /* Copyright 2013 Mort3n

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    */

    /**
    * Redirect logged-in user from site Homepage to Profile
    * @since 1.0
    */
    function bp_profile_as_homepage_fork_homepage(){

    global $bp;

    $selected_role = get_option( ‘bpahpf_role_choice’ );

    //redirection to profile applied to all roles
    if( ” == $selected_role ){
    if( is_user_logged_in() && is_front_page() ){

    wp_redirect( $bp->loggedin_user->domain, 302 );
    exit;
    }
    }
    //redirection to profile applied to all roles EXCEPT selected_role
    else{
    if( !bp_profile_as_homepage_fork_check_user_role( $selected_role ) && is_front_page() ){
    wp_redirect( $bp->loggedin_user->domain, 302 );
    exit;
    }
    }
    }

    /**
    * Redirect after logout
    * @since 1.0
    */
    function bp_profile_as_homepage_fork_logout_redirection(){

    global $bp;

    $redirect = $bp->root_domain;

    wp_logout_url( $redirect );
    }

    /**
    * Checks if a particular user has a role.
    * Returns true if a match was found.
    * Code for this function modified from http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/
    *
    * @param string $role Role name.
    * @param int $user_id (Optional) The ID of a user. Defaults to the current user.
    * @return bool
    */
    function bp_profile_as_homepage_fork_check_user_role( $role, $user_id = null ) {

    if ( is_numeric( $user_id ) )
    $user = get_userdata( $user_id );
    else
    $user = wp_get_current_user();

    if ( empty( $user ) )
    return false;

    return in_array( $role, (array) $user->roles );
    }

    /**
    * Add the admin page to the dashboard menu
    * @since 1.0
    */
    function bp_profile_as_homepage_fork_menu(){

    load_plugin_textdomain( ‘bpahpf-menu’, false, basename( dirname( __FILE__ ) ) . ‘/languages’ );
    add_options_page( __(‘BP Profile as Homepage Fork Settings’, ‘bpahpf-menu’ ), __( ‘BP Profile as Homepage Fork Settings’,’bpahpf-menu’), ‘manage_options’, ‘bpahpfmenu’, ‘bpahpf_settings_page’);
    }

    /**
    * Outputs the settings screen and saves data when submitted
    * @since 1.0
    */
    function bpahpf_settings_page(){

    //check for capability to manage options
    if ( !current_user_can( ‘manage_options’ ) ){

    wp_die( __(‘You do not have sufficient permissions to access this page.’, ‘bpahpf-menu’ ) );

    }

    $opt_name = ‘bpahpf_role_choice’;
    $data_field_name = ‘bpahpf_role_choice’;

    $opt_val = get_option( $opt_name );

    //if nonce checks out then save submitted data
    $nonce=$_REQUEST[‘_wpnonce’];
    if( wp_verify_nonce( $nonce, ‘bpahpf’ ) )
    {
    $opt_val = $_POST[ $data_field_name ];
    update_option( $opt_name, $opt_val );
    ?>
    <div class=”updated”><p><?php _e( ‘Settings saved.’, ‘bpahpf-menu’ ); ?></p></div>
    <?php

    }

    echo ‘<div class=”wrap”>’;
    echo “<h2>” . __( ‘BP Profile as Homepage Fork Settings’, ‘bpahpf-menu’ ) . “</h2>”;
    ?>
    <p>
    <?php _e( ‘Disable Profile as Homepage for a particular user role.’, ‘bpahpf-menu’ ); ?>
    </p>
    <form name=”bpahpf-settings-form” method=”post” action=””>
    <?php wp_nonce_field( ‘bpahpf’ ); ?>
    <p><b>
    <?php _e( ‘You have selected:’, ‘bpahpf-menu’ ); ?>
    </b>
    <?php
    if ( ” == $opt_val )
    _e( ‘No One’, ‘bpahpf-menu’ );
    else
    echo $opt_val;
    ?>
    <hr />
    <?php _e( ‘Who can view Homepage:’, ‘bpahpf-menu’ ); ?>
    <select name=”<?php echo $data_field_name; ?>”>
    <option value=””>
    <?php _e( ‘No One’, ‘bpahpf-menu’ ); ?>
    </option>
    <?php wp_dropdown_roles( );?>
    </select>
    </p>
    <p class=”submit”>
    <input type=”submit” name=”Submit” class=”button-primary” value=”<?php esc_attr_e( ‘Save Changes’, ‘bpahpf-menu’ ) ?>” />
    </p>
    </form>
    </div>
    <?php
    }

    add_action(‘admin_menu’,’bp_profile_as_homepage_fork_menu’);
    add_action(‘wp’,’bp_profile_as_homepage_fork_homepage’);
    add_action(‘wp_logout’,’bp_profile_as_homepage_fork_logout_redirection’);
    ?>

    #166344
    bp-help
    Participant

    @famous
    Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :

    
    /* Redirects to profile upon login, and upon logout redirects to activity page unless changed */
    function bp_help_redirect_to_profile(){
     global $bp_unfiltered_uri;
    
     $bphelp_my_front_page = 'activity';  // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to.
    
     if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_front_page ) ) 
      bp_core_redirect( get_option('home') );
    
     elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == $bphelp_my_front_page ) )
    	bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' );
    
    }
    	
    add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
    
    #166341
    bp-help
    Participant

    @famous
    Try this just make sure you follow the instructions in the commented code. Place it in bp-custom.php :

    
    /* Redirects to profile upon login, and upon logout redirects to activity page unless changed in line 6 */
    function bp_help_redirect_to_profile(){
     global $bp_unfiltered_uri;
    
     $bphelp_my_home_page = 'activity';  // WARNING: make sure you replace 'activity' in this line to the same thing you set dashboard/settings/reading front page to.
    
     if ( !is_user_logged_in() && ( $bp_unfiltered_uri[0] != $bphelp_my_home_page ) ) 
      bp_core_redirect( get_option('home') );
    
     elseif( is_user_logged_in() && ( $bp_unfiltered_uri[0] == 'activity') )
    	bp_core_redirect( get_option('home') . '/members/' . bp_core_get_username( bp_loggedin_user_id() ) . '/profile' );
    
    }
    	
    add_action( 'wp', 'bp_help_redirect_to_profile', 3 );
    
    #165810
    bp-help
    Participant

    @famous
    That is a little strange. Are using mutisite? On a single site BP install the login/logout shows in the sidebar with the Meta Widget. Are you using a full width template? If so you can use this plugin to provide a login in the toolbar which I use with a full page template with WP 3.5.1 and BP 1.7.2 and it works, get it here:
    https://wordpress.org/plugins/admin-bar-login/
    Please provide as much info as you can on your install. If I can’t help, it will help others to help you. Thanks!

    #165746
    bp-help
    Participant

    @famous
    To redirect to profile add the following code courtesy of @sbrajesh at BuddyDev to your bp-custom.php :

    
    /*Make sure profile is default component*/
    define('BP_DEFAULT_COMPONENT','profile');
    
    /*let us filter where to redirect */
    add_filter("login_redirect","bpdev_redirect_to_profile",10,3);
     
    function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user)
    {
    if(empty($redirect_to_calculated))
    $redirect_to_calculated=admin_url();
     
    /*if the user is not site admin,redirect to his/her profile*/
    if(!is_site_admin($user->user_login))
    return bp_core_get_user_domain($user->ID );
    else
    return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/
     
    }
    

    For logout use the following code also courtesy of @sbrajesh to redirect back to your home url:

    
    add_filter('logout_url',"bpdev_logout_url",100,2);
    function bpdev_logout_url( $logout_url, $redirect) {
    //simply ignore the redirect and set it to the main domain
    //let us check for buddyopress,if yes,let us get the bp root domain right ?
    if(function_exists("bp_core_get_root_domain"))
    $redirect=bp_core_get_root_domain();
    else
    $redirect = get_blog_option( SITE_ID_CURRENT_SITE, 'siteurl' );
    
    $args = array( 'action' => 'logout' );
    if ( !empty($redirect) ) {
    $args['redirect_to'] = $redirect;
    }
    
    $logout_url = add_query_arg($args, site_url('wp-login.php', 'login'));
    $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    
    return $logout_url;
    }
    
    #163795
    mariahdee
    Participant

    I added the “Register” button to the main navigational menu to my http://www.subletcircle.com/sub website, however, upon clicking “Register” after I logout of my admin account, it redirects to my homepage (subletcircle.com/sub)

    I am using version 1.7.1 of BP and version 3.5.1 of WP.

    #162379
    pfrey
    Participant

    Yeah, I ran across that webpage and I did try using home_url() and still had the same redirection after logging out.

    I found the Peter’s Login Redirect plugin today, and it worked for me. It’s a little overkill for what I need it for, but it’s the only thing I could do to make it work!

    So if you have any other ideas, I’m open to them, otherwise I suppose I will be using the extra plugin.

    Thanks!

    #162366
    David Cavins
    Keymaster

    Still didn’t work. Available here: http://pastebin.com/ZtFWhqyg

    #162365
    David Cavins
    Keymaster

    Well that code bit got mixed up, let’s try that again:

    `<a href="” title=”Log out”>`

    #162364
    David Cavins
    Keymaster

    Hi Patty-

    Have you tried using `home_url()` instead of `site_url()` like the example on the Codex: https://codex.wordpress.org/Function_Reference/wp_logout_url#Logout_and_Redirect_to_Homepage

    I use this on my site and it redirects to the home page:
    `<a href="” title=”Log out”>`

    -David

    #162338
    pfrey
    Participant

    I’ve seen some other tickets from a long time ago, but didn’t want to re-open a dead ticket. But none of them seemed to be resolved. If anyone can help me I’d really appreciate it.

    #161993
    boiy
    Participant

    i want a log out redirect function, whr i can redirect my logout to any page… better still with a page that can set logout value to true

    example… buddypress/wp-login?logout = true

    same page but different content.. would like to do that for me index.php

    #153668
    modemlooper
    Moderator
    #153667
    Yeshourun
    Participant

    @modemlooper that didnt work… It said I had an error.

    #153666
    modemlooper
    Moderator

    replace text URL-after-logout with a url

Viewing 25 results - 51 through 75 (of 174 total)
Skip to toolbar