User Sync When Registers

matteld80

Member
XFtoWP
Messages
10
Reaction score
0
Hi @Alex is there any documentation about syncing users to Xenforo when they are created on the the wordpress site and the single sign on feature?

I have auth and auth token showing as connected.

Under User Sync Actions
User Register - selected the groups - Send No Message

Do I need any more Actions for this to add the users to Xenforo?

We're using memberpress so users are being added through the registration forms and when adding a few test sign ups these users are not being added to the Xenforo account.

Any pointers greatly appreciated.

Thanks, Matt
 

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,276
Reaction score
1,694
Hi @matteld80, thanks for purchasing XFtoWP!

The best documentation for User sync setup is currently the YouTube video made below. The settings for XFtoWP were designed to be mostly self-explanatory and to "just work" but I am happy to answer any questions about setup.


Do I need any more Actions for this to add the users to Xenforo?

We're using memberpress so users are being added through the registration forms and when adding a few test sign ups these users are not being added to the Xenforo account.
Here's what my setup looks like to register new WP users to XenForo:

Screen Shot 2021-09-22 at 4.08.18 PM.png

The key is to make sure "Run user action on..." is during "User register".
 
Comment

matteld80

Member
XFtoWP
Messages
10
Reaction score
0
Hi @Alex of I've got it connected now and syncing when adding a user but found a slight problem I'm not sure on how to get around

If the username is an email it doesn't sync but if it's a username of say testsync and email is in the email box it works

Issue I have is that we're using ThriveCart linked to memberpress which adds the email address as the username.

Any settings that can allow email as a user name in Xenforo?

Thanks, Matt
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,276
Reaction score
1,694
Hi @Alex of I've got it connected now and syncing when adding a user but found a slight problem I'm not sure on how to get around

If the username is an email it doesn't sync but if it's a username of say testsync and email is in the email box it works

Issue I have is that we're using ThriveCart linked to memberpress which adds the email address as the username.

Any settings that can allow email as a user name in Xenforo?

Thanks, Matt
I'll take a look and see if there is any validation the plugin performs that may cancel the request. It would be best if you figured out how to pass the data to the right fields, but I agree that having an email as a username should not cancel the request.
 
Comment

matteld80

Member
XFtoWP
Messages
10
Reaction score
0
Hi @Alex I spoke to Thrivecart - there is no way to pass a username to memberpress through their connection to Worpdress.

Did you manage to take a look to see if it's possible to pass the user using the email address as their username?

Thanks, Matt
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,276
Reaction score
1,694
Hi @Alex I spoke to Thrivecart - there is no way to pass a username to memberpress through their connection to Worpdress.

Did you manage to take a look to see if it's possible to pass the user using the email address as their username?

Thanks, Matt
Thanks for the reminder! I'll keep this thread open and will return to it later today with an answer for you.
 
Comment

matteld80

Member
XFtoWP
Messages
10
Reaction score
0
Ok thanks @Alex look forward to hearing from you, were looking to go live on the site next week but still dont have this element syncing users as we need.
 
Comment

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,276
Reaction score
1,694
Ok thanks @Alex look forward to hearing from you, were looking to go live on the site next week but still dont have this element syncing users as we need.
Just confirmed the issue, debugging now.
 
M
matteld80 commented
@Alex ok I don't see a way to map username to fields in ThriveCart, I have asked the question and they said it's not currently possible. Hmmm not sure whatelse can be done
 
Alex
Alex commented
The best course of action is to check the XF forums for a workaround to accept email as a username. I'll take a quick look myself
 
M
matteld80 commented

Alex

MD developer
Staff member
Md
XFtoWP
Messages
6,276
Reaction score
1,694
Hi @Alex

We have a question regarding the way your plugin adds the urser to Xenforo

Could you take a look at the video below for extra information

https://the.integrateprovideos.com/conversations/a37b7dae-32a3-5fd2-a0b3-d7b4f22196f9

Thanks, Matt
Thanks for the question. I've just released XFtoWP 1.3RC1 which now includes the full integration code used for MemberPress, in case you missed it.

XFtoWP doesn't directly connect to the MemberPress API, but calls action hooks and filters that presumably do, or open up the possibility to. As a side note, creating users on XenForo is actually connected to the native user_register hook in WordPress, so if MemberPress goes around this, a user won't be created. This may be something I could look back into as I vaguely remember MemberPress > Add Member didn't work, but users were still created correctly when registered to WordPress natively.

Regarding the nonce check, I added it as an aggressive security check but if you are able to pass a newly created nonce through the MemberPress API you could take advantage of that and also get through. I am open to this being too aggressive, but most of the WordPress security hacks you hear have to do with unblocked requests so I this check may have to stay in place.

To be sure, try removing the nonce block and check if the request works anyway:

PHP:
if ( ! isset( $_POST['xfwp_add_user_nonce'] ) || ! wp_verify_nonce( $_POST['xfwp_add_user_nonce'], 'xfwp_add_user_nonce' ) )
            return;

You can always create a nonce on the fly and try to pass it through the main $_POST body:

PHP:
...
'xfwp_add_user_nonce' => wp_create_nonce( 'xfwp_add_user_nonce', 'xfwp_add_user_nonce' )
...

I hope this helps, nice workaround to solve the username issue!
 
Comment
Top