Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2007, 07:06 PM
ianskate ianskate is offline
 
Join Date: Dec 2002
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default External Registration / Database information

Hello,

I've been trying to create an external registration script from a current website.

I run a website that has a registration script for posting comments, but I would like to allow the registration from that end. At the moment we only have the user name, ID, and password. The problem is when adding a new user to the database from this external site, I am bypassing the vBulletin registration process.

The end result is my user's info within the _user table is correct, however, users' posts display as though they are non-registered users (even though I hard coded the table population for them all to be Registered Users).

When viewing a user through the member list, everything appears fine. When viewing a post, the user displays like a guest user. When viewing through the admin control panel, the user names appear in the list, but ALL user data is absent, however, the data is visible within the _user table when viewing the sql tables manually through the database.

I'd like to copy the information into the forums database -- and create a user within those tables at the same time. In short, this would prevent double registering, etc, etc. Is there any method of easily creating the same information, or a small package to ease the conversion process on-the-fly as opposed to an import script?

Thank you in advance!

Also, I'm using the most recent version of vB. (3.6.8)
Reply With Quote
  #2  
Old 09-17-2007, 07:33 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This may help you: https://vborg.vbsupport.ru/showthrea...+automatically
Reply With Quote
  #3  
Old 09-17-2007, 08:01 PM
ianskate ianskate is offline
 
Join Date: Dec 2002
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That seems really useful, if you're already working within the forum pages themselves.

Do you know if there's a way to copy one group of attributes from our current "non-vbulletin forum" database to the vb user tables, thus creating new accounts?

At the moment, filling in the user tables alone doesn't seem completely create the new accounts, despite actually populating all the user fields within vb_user.
Reply With Quote
  #4  
Old 09-17-2007, 08:09 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you require the global.php file from your forum root, you can then make use of the datamanager. This will sort out everything for you.
Reply With Quote
  #5  
Old 09-18-2007, 12:34 PM
ianskate ianskate is offline
 
Join Date: Dec 2002
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I doubt this (Datamanager_User) will work, but I am going to try it anyway. I dont see how its functions will be able to access the vBulletin database from within the scope of my web controller. My platform has its own database, and currently I am accessing the vBulletin database by addressing it through a mysql query.

I am able to add to the vBuleltin db via sql queries, but then I run into the issue with vBulletin where my loading of a user isnt robust enough. Again, my problem is that while I load a user with all the appropriate settings (password, name, usergroup, salt, etc etc) the same way the register file activates them, however, the admin control panel can not load any of the user metadata from the _user table, and when these users post they appear as guests (but when viewed through the member list, they are Junior Members - group 2 - registered users, etc).

Has anyone had experience with loading a user externally with just sql queries? I feel like there are some rows/tables I am not addressing, but cant seem to find them.

just to update, for several reasons, the vBulletin Datamanager will not work within my webspace. Multiple conflicts -> loading $vbulletin, paths to all the includes, and of course, addressing (vBulletin's) database.

I suppose i can dig all the way through how Datamanager loads a new user and make an attempt at copying its procedure...
Reply With Quote
  #6  
Old 09-18-2007, 02:19 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd take a look at the save() function of the User Datamanager then. You will probably find the queries in there or something of the sort.
Reply With Quote
  #7  
Old 09-18-2007, 02:53 PM
ianskate ianskate is offline
 
Join Date: Dec 2002
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for all your replies. That is what I am doing currently. So far, im doing exactly what this function does, save for verifying things like names and passwords since I know theyll be acceptable regardless (my website's signup verifies things accordingly).

Here is how I am sending the data to the (vBulletin) _user table:

//INITIALIZE VARS SUCH AS usergroupid, username, salt, etc...
//GET VBULLETIN DATABASE->query(
('INSERT INTO vbim_user (usergroupid, username, password, email, showvbcode, usertitle, pmpopup, options, salt)
VALUES(?i, ?s, ?s, ?s, ?i, ?s, ?i, ?i, ?s)',
$vbusergrpid, $this->user->username, $vbpwhash, $this->user->email, $vbcode, $vbtitle, $vbpmpopup, $vboptions, $vbsalt
);

note: $this->* comes from the users registering on my webpage. this snippet of code is found within my website's registration page.

Ive been tracking down how vbulletin gets user info (such as the $userinfo array and the fetch_userinfo() function). It appears to default the values to guest values if the fetch_userinfo() isnt successful. HOWEVER, everything is aligned perfectly in the _user table. Ive even gone through it and filled out every attribute in the table with an allready existing user's metadata that works. There must be another table or flag or something somewhere that I am not addressing, and I cant find what that is.

All my users registered externally operate as guests. They can post, but thats it. They can send PMs but can not recieve pms. Admin control panel cant find their userid, and thus no other attributes. Their posts display with a postcount of 'n/a' and their names are just grey text (no hyperlink to their profile or anything).

As ive stated before, im setting their info as though they are group 2 -> registered members.
Reply With Quote
  #8  
Old 09-18-2007, 05:15 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check the other user tables, I haven't got the files handy at the moment but its probable that information is inserted into other tables to. Probably why you are getting some errors.
Reply With Quote
  #9  
Old 09-18-2007, 06:30 PM
ianskate ianskate is offline
 
Join Date: Dec 2002
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ive also spent the entire day exploring vBulletin's caching. I suspected that user attributes were being loaded into a cache (datastore) of some sort, and most of the board's functionality referred to this cache as opposed to the _user table. From what ive found, this is not the case.

I am going to make an attempt at adding a user through a datamanager script, and pass the info to it through a URL, as a last ditch effort. I really wanted to be able to simply add new users via sql queries tho.

Oh and to reply to the above post: i dont believe there are any other tables associated with a user
as far as a user being registered or not goes. The userfields, usernote, usertextfield, etc, tables are not relevant when considering most of the problems im having (for example, those fields can be left totally blank, which most users will have them as, when looking up a userid to send a pm, or viewing a profile, or post, etc).

OK just in case anyone has this problem in the future:

I found a way of using the VB Datamanager_User externally (without having use any dependencies) by passing user metadata such as name, pw (hash), salt, options, etc, through a url that calls a datamanager_register php script within the forum branch on my server. However, just as I had accomplished this, my coworker found a problem with my initial attempt at accomplishing external registration.

When writing to the _user table, you must also write the userid to the _userfield and _usertextfield tables as well. The values for the rest of the columns can all be set to null, which is what caused me to overlook these tables (since their defaults are all null). Directly sending as much info as you can to the _user table, and sending the id to the _userfield and _usertextfield tables, allows external registration via sql queries to work perfectly fine!

http://nextnewnetworks.com/networks.html
Reply With Quote
Reply


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 08:29 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.07960 seconds
  • Memory Usage 2,243KB
  • 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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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