vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Creating users outside of VBulletin (https://vborg.vbsupport.ru/showthread.php?t=74368)

BrandonC 01-14-2005 06:14 PM

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.

Zachery 01-14-2005 06:29 PM

Quote:

Originally Posted by BrandonC
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.

Not recomended, as you need to populate 3 tables, you'd be better off going the other way around.

BrandonC 01-14-2005 06:41 PM

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.

Tekton 01-15-2005 06:40 AM

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.

Zachery 01-15-2005 03:16 PM

Quote:

Originally Posted by BrandonC
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.

Ok, hmm well if that is the case you are going to need to populate the other tables with the correct data (or whateveR).

Take a look at register.php, it should provide abit of help (and any of the files linked to it)

BrandonC 01-16-2005 01:56 PM

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!

Zachery 01-16-2005 04:14 PM

Quote:

Originally Posted by BrandonC
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!

See if there is any sort of function to update the datacache.


All times are GMT. The time now is 07:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01029 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete