Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'logout redirect'

Viewing 25 results - 26 through 50 (of 127 total)
  • Author
    Search Results
  • #259138
    Brajesh Singh
    Participant

    Hi,
    Looking at the screenshot, it seems you are logged in. Please logout and try viewing register page again. It will take you to register instead of redirecting to the home page.

    Hope that helps.

    #258810
    danbp
    Participant

    Hi,

    the warnings cames probably because the logout function is called twice.
    Check your theme’s functions.php or see for a specific setting.

    Can you test the standard behave with a Twenty theme and BP, and all other plugins deactivated.
    Remove also the custom code while testing.

    If still an issue, consider this plugin. All is in the title, but it redirects to homepage on logout.

    #258802
    Venutius
    Moderator

    This one should be the answer:

    https://buddypress.org/support/topic/error-404-page-not-found-3/

    However it did not work for me, I’ve raised a thread about it here:

    https://buddypress.org/support/topic/redirect-on-logout/

    It may work for you, since it worked for the other chap

    #258799
    Venutius
    Moderator
    #258798
    Venutius
    Moderator

    Yep I’d like to know what to do about that too, it should redirect to the home page on logout as standard really.

    #258752
    ico33
    Participant

    Hi,

    i can’t understand how to solve this 3 questions. I am not expert, i’m not a programmer and I can’t use code.

    1) Logout: when a user logs out from a private page (message, for example) using the Buddypress-Access-Widget, it says “404 error page not found”. It’s obvious. How can i redirect the logout to the Home Page, solving the problem? Is there a solution without using code?

    2) Lost password: in Buddypress Access Widget you can Log-In and Register. No more. If you put a wrong password, the user is redirect to wp-login and this “loses” my site’s look, because it goes to a WordPress branded page. Is there a solution?

    #258630
    danbp
    Participant

    Hi,

    the logout link is redirected to the same page. If you’re on your profile notifications screen, which is only intended for you, it is normal that when you logout from there, you’re redirected to a page not found message. Notifications is even private and not public.

    The solution is to redirect to an always public part of the site on logout.

    Add this snippet to child-theme’s functions.php

    //* Redirect WordPress Logout to Home Page
    add_action( 'wp_logout', create_function( '', 'wp_redirect( home_url() ); exit();' ) );

    Advice 1: use preferably the login widget, so the user stays on the same page where he attempt to login instead to be redirected to that boring wp-login page.

    Advice 2: on the Home (which is the member directory), you have all BP pages listed at the bottom. Remove them ! You certainly don’t need to give access to account activation or register page to your visitors…

    #254899
    sharmavishal
    Participant

    @navyspitfire just tested right now and am able to redirect logins to groups section and logout to main site

    #254763
    #253203
    andy60rm
    Participant

    After installing Buddypress plugin, visual editor does not works correctly.

    Wordpress 4.5.2
    BuddyPress latest version

    Plugins installed
    =================
    BAW Login/Logout menu 1.3.3.
    Contact Form 7 4.4.2
    Contact Form DB 2.10.9
    Cryout Serious Theme Settings 0.5.6
    Huge IT Slider 3.1.82
    Limit Login Attempts 1.7.1
    Link Library 5.9.12.18
    LinkedIn Auto Publish 1.3.2
    mathtex latex equation editor 1.1.5
    New User Approve 1.7.3
    Peter’s Login Redirect 2.9.0
    Recent Posts Widget With Thumbnails 4.9.2
    SI CAPTCHA Anti-Spam 2.7.7.7
    Simple Share Buttons Adder 6.1.5
    TablePress 1.7
    Testimonials Widget 3.3.0
    Tooltips 3.5.9
    Twitter Follow Button 1.0.2
    Ultimate Tables 1.6.3
    User Access Manager 1.2.6.7
    WP Content Copy Protection Premium (YOOPlugins) 1.8.32
    WP Statistics 10.1
    WP Support Plus Pro 7.0.1
    WP Twitter Feeds 1.4.8
    WP-Polls 2.73
    WP-Pro-Quiz 0.37
    WP-SpamShield 1.9.8

    #244675
    adrift_
    Participant

    Okay thanks, the plugin redirects after login or logout. My problem still is, that the logo and root URL link to the members page. Is there a solution for that (PHP would be okay)?

    #242729
    Jld142
    Participant

    This is my current code:

    <?php
    
    /* Link parent CSS file */
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    function enqueue_parent_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    
    /* Count number of user notifications */
    function cg_current_user_notification_count() {
        $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), 'object');
        $count = !empty($notifications) ? count($notifications) : 0;
     
        echo $count;
    }
    
    /* Remove register BuddyPress Widget creator */
    function remove_bp_core_register_widgets() {
        remove_action(bp_core_register_widgets());
    }
    add_action('init','remove_bp_core_register_widgets()');
    
    function new_bp_core_register_widgets() {
    	add_action('widgets_init', create_function('', 'return register_widget("new_BP_Core_Login_Widget");') );
    }
    add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
    
    /* New BuddyPress Login Widget */
    class new_BP_Core_Login_Widget extends WP_Widget {
    
    	/**
    	 * Constructor method.
    	 */
    	public function __construct() {
    		parent::__construct(
    			false,
    			_x( '(BuddyPress) Log In', 'Title of the login widget', 'buddypress' ),
    			array(
    				'description' => __( 'Show a Log In form to logged-out visitors, and a Log Out link to those who are logged in.', 'buddypress' ),
    				'classname' => 'widget_bp_core_login_widget buddypress widget',
    			)
    		);
    	}
    
    	/**
    	 * Display the login widget.
    	 *
    	 * @see WP_Widget::widget() for description of parameters.
    	 *
    	 * @param array $args Widget arguments.
    	 * @param array $instance Widget settings, as saved by the user.
    	 */
    	public function widget( $args, $instance ) {
    		$title = isset( $instance['title'] ) ? $instance['title'] : '';
    
    		/**
    		 * Filters the title of the Login widget.
    		 *
    		 * @since BuddyPress (1.9.0)
    		 * @since BuddyPress (2.3.0) Added 'instance' and 'id_base' to arguments passed to filter.
    		 *
    		 * @param string $title    The widget title.
    		 * @param array  $instance The settings for the particular instance of the widget.
    		 * @param string $id_base  Root ID for all widgets of this type.
    		 */
    		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    
    		echo $args['before_widget'];
    
    		echo $args['before_title'] . esc_html( $title ) . $args['after_title']; ?>
    
    		<?php if ( is_user_logged_in() ) : ?>
    
    			<?php
    
     		 	/**
    		 	 * Fires before the display of widget content if logged in.
    		 	 *
    		 	 * @since BuddyPress (1.9.0)
    		 	 */
    			do_action( 'bp_before_login_widget_loggedin' ); ?>
    
    			<div class="bp-login-widget-user-avatar">
    				<a href="<?php echo bp_loggedin_user_domain(); ?>">
    					<?php bp_loggedin_user_avatar( 'type=thumb&width=50&height=50' ); ?>
    				</a>
    			</div>
    
    			<div class="bp-login-widget-user-links">
    				<div class="bp-login-widget-user-link"><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></div>
    				<p>TEST</p>
    				<div class="bp-login-widget-user-logout"><a class="logout" href="<?php echo wp_logout_url( bp_get_requested_url() ); ?>"><?php _e( 'Log Out', 'buddypress' ); ?></a></div>
    			</div>
    
    			<?php
    
    			/**
    		 	 * Fires after the display of widget content if logged in.
    		 	 *
    		 	 * @since BuddyPress (1.9.0)
    		 	 */
    			do_action( 'bp_after_login_widget_loggedin' ); ?>
    
    		<?php else : ?>
    
    			<?php
    
    			/**
    		 	 * Fires before the display of widget content if logged out.
    		 	 *
    		 	 * @since BuddyPress (1.9.0)
    		 	 */
    			do_action( 'bp_before_login_widget_loggedout' ); ?>
    
    			<form name="bp-login-form" id="bp-login-widget-form" class="standard-form" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
    				<label for="bp-login-widget-user-login"><?php _e( 'Username', 'buddypress' ); ?></label>
    				<input type="text" name="log" id="bp-login-widget-user-login" class="input" value="" />
    
    				<label for="bp-login-widget-user-pass"><?php _e( 'Password', 'buddypress' ); ?></label>
    				<input type="password" name="pwd" id="bp-login-widget-user-pass" class="input" value="" <?php bp_form_field_attributes( 'password' ) ?> />
    
    				<div class="forgetmenot"><label><input name="rememberme" type="checkbox" id="bp-login-widget-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ); ?></label></div>
    
    				<input type="submit" name="wp-submit" id="bp-login-widget-submit" value="<?php esc_attr_e( 'Log In', 'buddypress' ); ?>" />
    
    				<?php if ( bp_get_signup_allowed() ) : ?>
    
    					<span class="bp-login-widget-register-link"><?php printf( __( '<a href="%s" title="Register for a new account">Register</a>', 'buddypress' ), bp_get_signup_page() ); ?></span>
    
    				<?php endif; ?>
    
    			</form>
    
    			<?php
    
    			/**
    		 	 * Fires after the display of widget content if logged out.
    		 	 *
    		 	 * @since BuddyPress (1.9.0)
    		 	 */
    			do_action( 'bp_after_login_widget_loggedout' ); ?>
    
    		<?php endif;
    
    		echo $args['after_widget'];
    	}
    
    	/**
    	 * Update the login widget options.
    	 *
    	 * @param array $new_instance The new instance options.
    	 * @param array $old_instance The old instance options.
    	 * @return array $instance The parsed options to be saved.
    	 */
    	public function update( $new_instance, $old_instance ) {
    		$instance             = $old_instance;
    		$instance['title']    = isset( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
    
    		return $instance;
    	}
    
    	/**
    	 * Output the login widget options form.
    	 *
    	 * @param $instance Settings for this widget.
    	 */
    	public function form( $instance = array() ) {
    
    		$settings = wp_parse_args( $instance, array(
    			'title' => '',
    		) ); ?>
    
    		<p>
    			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'buddypress' ); ?>
    			<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $settings['title'] ); ?>" /></label>
    		</p>
    
    		<?php
    	}
    }
    
    ?>

    I was trying to following the below guide to remove the function that initializes the login widget and then redirect it to my own new one:

    http://venutip.com/content/right-way-override-theme-functions

    Obviously hasn’t worked. Any ideas ?

    #242050
    valuser
    Participant

    Perhaps have a look at http://buddydev.com/plugins/bpdev-logout-redirect/

    it MAY be of some help !

    fugu78
    Participant

    I apologize but i am not sure where to add that line of code to the below redirect code:

    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*/
     
    }
    
    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;
    }
    
    ?>
    Mickey
    Participant

    Status of groups is all public, in fact i have no private groups at all, public (2) private (0) Hidden (0) when I go to groups menu.

    These are my active plugins:

    Adminimize
    AG Custom Admin
    Agreeable
    Better Search Replace
    BP Login Redirect
    BP Profile Search
    Buddypress – Who clicked at my Profile?
    BuddyPress Cover Photo
    BuddyPress Members only
    BuddyPress Real Names
    Custom Login URL
    Email Login
    K Elements
    MAYO – Login Screen
    Revolution Slider
    rtMedia for WordPress, BuddyPress and bbPress
    TM Replace Howdy
    WPBakery Visual Composer
    WPi Custom Logout
    Go Daddy Quick Setup

    Mickey
    Participant

    I have the following active at the moment:
    Adminimize
    AG Custom Admin
    Agreeable
    Better Search Replace
    BP Login Redirect
    BP Profile Search
    Buddypress – Who clicked at my Profile?
    BuddyPress Cover Photo
    BuddyPress Members only
    BuddyPress Real Names
    Custom Login URL
    Email Login
    K Elements
    MAYO – Login Screen
    Revolution Slider
    rtMedia for WordPress, BuddyPress and bbPress
    TM Replace Howdy
    WPBakery Visual Composer
    WPi Custom Logout
    Go Daddy Quick Setup

    None of them seem to deal with friend requests.

    #228192
    Paul Bursnall
    Participant

    By default Buddypress doesn’t have it’s own Login or Forgot Password pages. The behaviour of your site is correct. You could create your own page templates for separate pages, or use a plugin something like this:

    https://wordpress.org/plugins/clean-login/ or
    https://wordpress.org/plugins/zm-ajax-login-register/

    To redirect users on login/logout:

    https://wordpress.org/plugins/peters-login-redirect/

    #189642
    JsonB123
    Participant

    I wanted an Ajaxified login along with removal of dashboard access and I’m using 2 plugins:
    Remove Dashboard Access
    Login With Ajax

    Login With Ajax also has a settings panel that allows you to redirect the users (globally or role based) upon login and logout, so it replaces the BP Redirect to Profile, as well, if you’re looking for that type of login functionality to go along with the redirect.

    BP Redirect to Profile doesn’t block wp-admin access in and of itself, it just redirects the user to their profile upon login, but doesn’t block the admin if they put the URL in directly.

    #182968
    David Cavins
    Keymaster

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

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

    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 );
    
Viewing 25 results - 26 through 50 (of 127 total)
Skip to toolbar