Home Forums Plugin Support WP User Frontend (Free Version) BP Registration Options Conflict

This topic is: not resolved

This topic contains 13 replies, has 3 voices, and was last updated by  Tareq Hasan 5 years, 5 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #9801

    hughs
    Participant
    Post count: 42

    I am using WPUF Pro with Buddypress Integration Add On to create a custom registration page. When users register from my custom page my membership approval workflow doesn't work. I am using Buddypress Registration Options plugin to put new users into an approval queue where they can still login and upload their avatar but cannot use the site until I approve them.
    From the custom registration page the approval workflow still sends the verification mail but then lets new users login and begin to use the site with no approval workflow. When I tested the default Buddypress registration page with a new user the workflow still works fine.
    Any ideas what in the custom WPUF registration page would be breaking this approval workflow?
    Thanks!

    #9806

    Mahi
    Member
    Post count: 1555

    Are you using any 3rd party membership approval plugin?
    any chance to check your site?

    #9810

    hughs
    Participant
    Post count: 42

    Yes, the name of the approval plugin is Buddypress Registration Options. As I mentioned, the plugin works when I am using the default Buddypress registration page but when I use my custom page built with WPUF Pro and Buddypress Integration Add On the plugin doesn't work.

    #9821

    hughs
    Participant
    Post count: 42

    I have tested the WPUF registration process using the Buddypress Integration Add-On and I believe there is a problem with the email validation.
    When a new user completes my registration form and clicks the Register button the email that should be sent is a validation email with a subject line that reads “Activate Your Account” and email content that says “Thanks for registering! To complete the activation of your account please click the following link: http;//yourURL?key=lksdfj34l3kjasdetc….

    The email that is being sent to my users is a Username and Password email with a subject line of “Your username and password” and content that has no greeting at all, just the UN and PW and a link back to the wp-login.php page.

    This is a problem because it is not validating the email of the new user. And this is what is making my approval workflow break.

    Can you let me know if there is a quick fix for this or point me to where I can investigate this in the WPUF code.
    Thanks a lot!

    #9835

    hughs
    Participant
    Post count: 42

    I tested this today with a new form and can confirm that the WPUF registration upon clicking the Register button should send out a validation email to the new user. Instead it sends a Username and Password reset email.

    This issue is fairly critical to my site so please let me know if there is a way of putting the email validation back on the correct path.

    Thanks!

    #9928

    hughs
    Participant
    Post count: 42

    I located the problem at frontend-form-profile.php line 226:

    // send user notification
                    if ( class_exists( 'Theme_My_Login_Custom_Email') ) {
                        do_action( 'tml_new_user_registered', $user_id, $password );
                    } else {
                        wp_new_user_notification( $user_id, $password );
                    }

    wp_new_user_notification is not the correct function for sending out a verification email. According to the Codex this function is used to “notify the blog admin of a new user, normally via email and also send an email with login/password to the new user.” What the new user should receive is a mail with a link that verifies the email address and brings them back to the site. I looked for the correct function in the Buddypress registration form but could not find it.

    If you don't mind, please confirm that this support string is being read. I haven't heard back in 5 days. Thanks.

    #9929

    Tareq Hasan
    Keymaster
    Post count: 2831

    Sorry for that, but WPUF doesn't send out any verification mail by itself. It just does the registration and sends the default notification mail as WordPress does. BTW, Theme My Login does the verification stuff and may be it's doing pretty great by default.

    #9932

    hughs
    Participant
    Post count: 42

    Thanks Tareq,
    I'm using the WPUF Pro along with the Buddypress Integration Add On, so the registration page that I create should send the Buddypress verification email and not the WordPress verification email. I think this is the confusion.
    When I test the default Buddypress registration page a verification email is sent to the new user with a link which they click to verify their email. The WordPress registration process sends a password and login email.
    So your Buddypress Integration Add On should accommodate for this difference or I was hoping that you could help me write a quick function to drop into my child theme functions.php to remedy the problem for buddypress users.

    #9934

    hughs
    Participant
    Post count: 42

    If you would like to see for yourself you can go to my site and fill out the two different registration forms and you will see that you receive two different types of verification emails.

    WPUF Registration Form Using Buddypress Integration Add On:
    http://uberon.net/registration-form/

    Default Buddypress Registration Form:
    http://uberon.net/register

    The second one is correct for Buddypress and is what I am trying to get my custom form to generate.

    #9935

    Tareq Hasan
    Keymaster
    Post count: 2831

    FYI, the integration add-on is for syncing profile fields only. It doesn't do anything with the verification thing.

    Anyway, just checked out the registration function of BuddyPress and I think there is a solution. Test this function, should be working…

    [php]
    function wpuf_bp_profile_activation( $user_id ) {
    global $wpdb;

    // Update the user status to ‘2' which we will use as ‘not activated' (0 = active, 1 = spam, 2 = not active)
    $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 2 WHERE ID = %d", $user_id ) );

    if ( !is_multisite() ) {
    $activation_key = wp_hash( $user_id );
    $userdata = get_userdata($user_id);
    update_user_meta( $user_id, ‘activation_key', $activation_key );

    if ( apply_filters( ‘bp_core_signup_send_activation_key', true ) ) {
    bp_core_signup_send_validation_email( $user_id, $userdata->user_email, $activation_key );
    }
    }
    }

    add_action( ‘wpuf_after_register', ‘wpuf_bp_profile_activation', 11 );
    [/php]

    #9940

    hughs
    Participant
    Post count: 42

    Thanks Tareq,
    That does work. New users now receive the Activate Your Account email and must validate by clicking the link or they cannot use the site.
    The only difference now is that the user is receiving 2 emails. The subject line of the first is “Your username and password” and the second one is “Activate Your Account”.
    The Buddypress default registration only sends the “Activate Your Account” mail. Any explanation why this is happening and if I can get the “Your Username and Password” mail to not send or edit it to not include a link or be a simple greeting.
    Thanks again for helping me with this. Especially on a Sunday!
    Hugh

    #9944

    Mahi
    Member
    Post count: 1555

    The code you found wp_new_user_notification( $user_id, $password ); in WPUF, it needs to be removed in your case. So users won't receive the username/password mail.

    #12846

    hughs
    Participant
    Post count: 42

    Hello Tareq
    You helped me by sending a piece of code for my function.php file in my child theme which sets my new user verification status to 2 or “not activated”.
    I thought that this was working but discovered that the new members are not being counted. When I click the Member page link, the number of members is not accurate. I can see new members but they are not being counted correctly.

    I checked with BP Registration Options which is the approval plugin that I am using. The support team tells me that there are two values that need to be set. The first is user_status which they recommend setting a value in the DB to “69”. They also set a “hide_sitewide” field to 1 or true, in the bp_activity table.
    Upon approval of a new users both values are set to 0 and the members are active.

    Any idea why my members are not being counted? When I get rid of your function and use the BP default registration the member count works.

    Thanks for your support.
    Hugh

    #12859

    Tareq Hasan
    Keymaster
    Post count: 2831

    I only checked the code that BuddyPress had, so I gave you the code.

    If you think the number should be 69 instead of 2, you can change the number in the code.
    Also for hide_site, you can add this code update_user_meta( $user_id, 'hide_site', '1' ); after line 12 of this code snippet.

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘BP Registration Options Conflict’ is closed to new replies.