Skip to:
Content
Pages
Categories
Search
Top
Bottom

difficulties with bypass activation and auto-login

Viewing 4 replies - 1 through 4 (of 4 total)
  • @henrywright

    Moderator

    Hi @terraling

    Could it be anything to do with the customisations you made to the registration process recently?

    @terraling

    Participant

    Hmmm – it would seem so.

    Don’t know why but hooking onto the bp_screens action seems to have broken it, somehow, so I’ll need to rethink that, perhaps ask for a more appropriate hook to be added to core after all.

    Thanks @henrywright for the nudge.

    @terraling

    Participant

    Okay, scratch that, it’s not working… I stripped out what I’d been tinkering with before.

    Here’s the problem:

    
    global $wpdb;
    // Activate user
    $wpdb->query('UPDATE wp_users SET user_status = 0 WHERE ID = '.$user_id);
    // Remove the activation key meta
    delete_user_meta( $user_id, 'activation_key' );
    //TESTING
    $user = get_user_by( 'id', $user_id );
    error_log("user id " . $user_id . " has status = " . $user->user_status);
    
    $signon = wp_signon( array('user_login' => $user_login, 'user_password' => $user_password, 'remember' => false) );
    

    So the signon fails because my error_log says
    user id 106 has status = 2
    even though it has just been set to 0 and, if I look directly in the wp_users table I see that it is indeed 0.

    I can only assume that the sql query to write user_status is slow and when I manually inspect it it has changed, but when the code checks it it is still set to 2.

    Does that sound plausible? Or am I missing something?

    @terraling

    Participant

    Of course, I could just

    remove_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30 );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘difficulties with bypass activation and auto-login’ is closed to new replies.
Skip to toolbar