The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Creating users outside of VBulletin
I'm integrating VBulletin with a client application that handles the registering of users. On the backend, when the server gets a user creation request, it goes into the VB database and inserts the appropriate records to create that user (username, salt, password hash, etc.). It also inserts an entry in the usertextfield and userfield tables.
Here are the insert scripts we're using: "INSERT INTO user (username, salt, password, passworddate, email, styleid, parentemail, showvbcode, usertitle, joindate, daysprune, lastvisit, lastactivity, usergroupid, timezoneoffset, options, maxposts, threadedmode, startofweek, ipaddress, pmpopup, referrerid, reputationlevelid, reputation, autosubscribe, birthday, birthday_search) VALUES (?,?,?,?,?,1,'',1,'Junior Member',unix_timestamp(),0,unix_timestamp(),unix_t imestamp(),2,-5,3287,-1,0,1,'',0,0,5,10,-1,'','0000-00-00')"; INSERT INTO usertextfield (userid) VALUES (?) INSERT INTO userfield (userid, field6) VALUES (?,?) Most of the time, the user's profile is "broken" after it's inserted. They can log in correctly, but all of their posts have strange info in the section where their username usually is (it still has their username, but I think the usergroup is "guest"). Also, when I go through the AdminCP and search for their username, it will bring up the user info page, but none of the data will be filled in (even username is blank). If I run the "fix user profiles" script, everything is fixed and all the posts look correct. Does anyone have an idea of what I'm missing when we create the user in the database? I realize this is skirting around VBulletin's scripts, but this was the only way we could do it. I appreciate any information. |
#2
|
||||
|
||||
Quote:
|
#3
|
|||
|
|||
I'm not sure what you mean by "Other way around"....register through the VBulletin stuff and then create our users on our side?
One of the problems here is that VBulletin can't run on SQLServer, which is what we're using for our application. So we have two separate DB's that need to stay in sync. I've already put together the stuff to change passwords in the VB database, and that works fine, it's just a matter of something missing (I'm assuming) when we do the insert in the 3 tables for the user. Our client is C++ communicating with a Java based server, and we can't catch VBulletin registrations and create a record in our own user table off of that. We have to insert into the record into the MySQL from our server. The records in the three tables seem to be inserted properly, and I don't see anything changing after the "fix broken user profiles" is run. |
#4
|
|||
|
|||
Can you just add these two lines after you insert the data?
require_once('~path~/includes/functions_databuild.php'); build_user_statistics(); Or is the thing that does it in admincp/misc.php? You could probably just use the same code they use right after yours. |
#5
|
||||
|
||||
Quote:
Take a look at register.php, it should provide abit of help (and any of the files linked to it) |
#6
|
|||
|
|||
I am populating all three tables, with what I believe is correct data (I read through all of register.php to get the correct insert statements).
I guess what I'm wondering is if there is anything other than those three tables that need information in them. Tekton -- we're not dealing with PHP at all (straight to the database from a Java class), so I can't call any php functions. I'll take a look at what those functions do though, and see if maybe we have to duplicate them? Thanks for the ideas so far! |
#7
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|