Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 01-14-2005, 06:14 PM
BrandonC BrandonC is offline
 
Join Date: Jul 2004
Location: Scotia, NY
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 01-14-2005, 06:29 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-14-2005, 06:41 PM
BrandonC BrandonC is offline
 
Join Date: Jul 2004
Location: Scotia, NY
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 01-15-2005, 06:40 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 01-15-2005, 03:16 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #6  
Old 01-16-2005, 01:56 PM
BrandonC BrandonC is offline
 
Join Date: Jul 2004
Location: Scotia, NY
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #7  
Old 01-16-2005, 04:14 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03966 seconds
  • Memory Usage 2,226KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete