XF 2.1 Create Forum User Using Remote SQL or Something Similar?

Hizen

Member
Hi,

I am interested in being able to create forum users via some remote function.

I run a small game community. When users register their game account, I want to give them the option to register a forum account on the spot, rather than having to funnel them there through other means.

E.g. the registration form might look like this.
-
Username:
Password:
Confirm Password:
Email Address:
Birthdate:

☐ I agree to the terms of service.
☐ I would also like to register a forum account.
Forum Username: (this would only become typeable if user ticked above box)
-

If they checked the "I would also like to register a forum account." box, their info would create a new user.
XenForo Username = 'Forum Username'
XenForo Password = 'Password'
XenForo Email Address = 'Email Address'

I hope somebody can point me in the right direction. Thanks!
 
You want to add data to the tables from another script?
More or less: INSERT ... INTO table;

but you need to understand which fields and tables are needed for a new user, because there are more than one.
If you know that, the php is quite easy. Your other script is written in php?
 
You want to add data to the tables from another script?
More or less: INSERT ... INTO table;

but you need to understand which fields and tables are needed for a new user, because there are more than one.
If you know that, the php is quite easy. Your other script is written in php?
Yep my other script is in php.

Call the built in API endpoint for user creation with a super user key from your gaming server registration script.
I don't understand sorry.
 
Looks like there is an API, means something like a connection point for extern scripts to xenforo.
Please try to search for xenforo api, i will do this later also, because this is a very intersting hint from Lukas.
 
Yep my other script is in php.


I don't understand sorry.

Here's the endpoint you're looking for: https://xenforo.com/community/pages/api-endpoints/#route_post_users_

Also take a look at the docs (note the required encoding): https://xenforo.com/xf2-docs/dev/rest-api/

The reason you need to create the super user key is so that XF knows the command is coming from an authorized source. (If keys weren't involved, anyone could access your API and issue commands to your XF install.) Navigate to ACP > Setup > API keys to create one.
 
Top Bottom