BP Registration Options Conflict

This topic contains 13 reply and 3 voices, and was last updated by Tareq Hasan 11 years ago
Viewing 13 Posts - 1 through 13 (of 13 total)
Author Posts
November 6, 2013 at 11:18 am 9801
Tareq Hasan 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!
November 6, 2013 at 4:12 pm 9806
Mahi Mahi

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

November 6, 2013 at 8:52 pm 9810
hughs hughs

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.

November 7, 2013 at 2:32 am 9821
hughs hughs

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!

November 7, 2013 at 10:08 pm 9835
hughs hughs

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!

November 10, 2013 at 10:15 pm 9928
hughs hughs

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.

November 11, 2013 at 12:41 am 9929
Tareq Hasan Tareq Hasan

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.

November 11, 2013 at 12:57 am 9932
hughs hughs

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.

November 11, 2013 at 1:16 am 9934
hughs hughs

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.

November 11, 2013 at 1:20 am 9935
Tareq Hasan Tareq Hasan

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]

November 11, 2013 at 4:28 am 9940
hughs hughs

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

November 11, 2013 at 1:05 pm 9944
Mahi Mahi

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.

November 26, 2013 at 8:46 am 12846
hughs hughs

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

November 26, 2013 at 1:49 pm 12859
Tareq Hasan Tareq Hasan

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 13 Posts - 1 through 13 (of 13 total)