BuddyDev

Search

[Resolved] Plugin – BuddyPress Autologin on Activation

  • Participant
    Level: Initiated
    Posts: 3
    Rob Condon on #28681

    Hi
    I just want to check if this plugin still works and if it works with Buddyboss? On testing when i click the link in the registration email I still have to click the activate button on the activate page before the user is registered.

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28682

    Hi Rob,
    I am sorry I missed to reply your email.

    The plugin “BuddyPress Autologin on Activation” logs in a user when they activate their account.
    So, It seems it is working as expected.

    If you want your users to be automatically activated and logged in on registration, You can use our “BuddyPress Auto Activate Auto Login” plugin.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Rob Condon on #28684

    Hi Brajesh
    Thanks for the reply.

    If they click the link in the email they have to click another activate button before they are registered I thought this plugin bypassed the 2nd activate button.

    I have tried BuddyPress Auto Activate Auto Login but that bypasses the email sent out with the link and i need to be able to confirm the email are real.

    Thanks
    Rob

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28685

    Hi Rob,
    No, this plugin does not bypass the second activation. All it does is logs in the user automatically. Otherwise, they need to login manually.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Rob Condon on #28686

    Hi Brajesh
    Would it be possible to develop it so if you click the link it the email it activates the user and they don’t have to click a 2nd activate button?
    Rob

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28688

    Hi Rob,
    Yes, it is doable.

    The problem is that if we do it in this plugin, It might be against the expectation of many site admins since the plugin has been available for so many years.

    Here is some code. Please put it in your bp-custom.php and see if it helps.

    
    
    add_action( 'bp_actions', function () {
    	if ( ! bp_is_current_component( 'activate' ) ) {
    		return;
    	}
    
    	$key = bp_get_current_activation_key();
    	if ( ! $key ) {
    		return;
    	}
    
    	$user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) );
    
    	// If there were errors, add a message and redirect.
    	if ( ! empty( $user->errors ) ) {
    		bp_core_add_message( $user->get_error_message(), 'error' );
    		bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . buddypress()->pages->activate->slug ) );
    	}
    
    	bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
    	bp_core_redirect( add_query_arg( 'activated', '1', bp_get_activation_page() ) );
    
    } );
    
    

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Rob Condon on #28689

    Brajesh
    Thank you so much that worked a treat hopefully we will have some work for you again soon.
    Regards
    Rob

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #28693

    Thank you Rob.
    I am glad it worked.

    Looking forward to work with you soon again.

    Regards
    Brajesh

The topic ‘ [Resolved] Plugin – BuddyPress Autologin on Activation’ is closed to new replies.

This topic is: resolved