• robertc

    (@robertchittock)


    I had an issue whereby the password link was sending out a reset key but this was being marked as expired.

    In the plugin I updated the code as follows for “ajax-authenticate-users.php” on line 210:

    /*
    $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
    if ( empty($key) ) {
    	// Generate something random for a key...
    	$key = wp_generate_password(20, false);
    	do_action('retrieve_password_key', $user_login, $key);
    	// Now insert the new md5 key into the db
    	$wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
    }
    */
    
    $key = wp_generate_password( 20, false );
    do_action( 'retrieve_password_key', $user_login, $key );
    
    if ( empty( $wp_hasher ) ) {
         require_once ABSPATH . 'wp-includes/class-phpass.php';
    	    $wp_hasher = new PasswordHash( 8, true );
    }
    $hashed = time() . ':' . $wp_hasher->HashPassword( $key );
    $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user_login ) );
    
    • This topic was modified 7 years, 4 months ago by robertc. Reason: Removing commented out code
  • The topic ‘Forget Password Link’ is closed to new replies.