Skip to:
Content

BuddyPress.org

Opened 5 years ago

Last modified 3 years ago

#5585 reopened defect (bug)

Activating user by other means than email or admin doesn't remove them from pending list

Reported by: modemlooper Owned by:
Milestone: Awaiting Contributions Priority: low
Severity: minor Version: 2.0
Component: Core Keywords: reporter-feedback
Cc:

Description

This is fringe...

If you auto activate a user, as example, change db status they still show in pending list. When you click to activate it removes user but has error user can't be activate.

Change History (16)

#1 @imath
5 years ago

  • Keywords reporter-feedback added

Hi

i'm sorry, i don't understand what you mean by auto activating a signup ? Can you explain it a bit more ?

Using bp_core_activate_signup( $activation_key ) doesn't work ?

#2 @DJPaul
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

If you're modifying the database directly (and potentially causing cache problems), and not using our API functions, I think you should start using our API functions because you're causing your own problems. :)

#3 follow-up: @modemlooper
5 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Some sites do not want to have the normal activation process. When this happens the admin pending list is out of sync. Is there a hook to also remove the user from pending in admin?

#4 in reply to: ↑ 3 @imath
5 years ago

Replying to modemlooper:

Some sites do not want to have the normal activation process.

Correct me if i'm wrong :
So "some sites" are using the BuddyPress registration process (as the pending list seems (not sure) to be incremented in your description) but are using a specific activation process that is bypassing the BuddyPress one, as a result the pending list keeps on displaying activated users ?

In this case, i imagine the event/hook is on these "some sites" way of dealing with activation. If they get the activation key, then they can hook in their process and use :
BP_Signup::validate( $activation_key )

This way the wp_signup "active" field will be set to 1 and the corresponding account will no longer show in the pending list.

#5 @modemlooper
5 years ago

Doing some testing, might be a weirdness with multisite and trying to skip activation.

#6 @boonebgorges
5 years ago

  • Milestone set to Awaiting Review

#7 @modemlooper
5 years ago

After playing around with this I can't see a way of removing users from the pending activation list during the registration process.

Using this to stop activation. Using this should also auto place a user as activated.

add_filter( 'bp_registration_needs_activation'	, '__return_false');

Tried BP_Signup::validate( $activation_key ) did not work

Tried to just update db did not work

function remove_from_pending( $user_id ) {
	global $wpdb;
	
	$key = get_user_meta( $user_id, 'activation_key' );
	
	$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->signups SET active = 1 WHERE activation_key = %d", $key ) );
		
}
add_action( 'bp_core_signup_user', ' remove_from_pending');

Now if I add the activation key directly to BP_Signup::validate( 'www7w7w88w@@@' ) it works but It's not doing it during the sign up process.

#8 @modemlooper
5 years ago

ok stupid me, my sql statement had $wpdb->signups and that won't work.

This worked

function remove_from_pending( $user_id ) {
	global $wpdb;
	
	$key = get_user_meta( $user_id, 'activation_key' );
	$wpdb->query( $wpdb->prepare( "UPDATE wp_signups SET active = 1 WHERE activation_key = %s", $key ) );	
}
add_action( 'bp_core_signup_user', 'remove_from_pending');

using this in the function doesn't activate the user


bp_core_activate_signup( $key )

#9 @DJPaul
5 years ago

modemlooper, I'm still confused here as to what you'd like us to do. Is there a bug you found in core we need to fix, or an API enhancement, or did you figure out a solution for your issue (as you seemed to have done) and no longer need this ticket open?

#10 @modemlooper
5 years ago

Well, bp_core_activate_signup( $key ) should activate a user but I could't get it to work without using my function above to force it. This was during bp_core_signup_user so It's kinda fringe.

#11 @DJPaul
5 years ago

I'll try to take a look sometime. It sounds like you're using multisite, not regular flavour WordPress?

#12 @DJPaul
5 years ago

modemlooper, are you using multisite or regular WordPress?

#14 @slaFFik
5 years ago

One of the problematic plugins that creates exactly this issue:
BuddyPress Registration Options

#15 @DJPaul
5 years ago

  • Milestone changed from Awaiting Review to Future Release

#16 @tw2113
3 years ago

@slaFFik hoping I've evolved BuddyPress Registration Options to handle things better in the past 22 months :D

Note: See TracTickets for help on using tickets.