The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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) |
#2
|
|||
|
|||
This may help you: https://vborg.vbsupport.ru/showthrea...+automatically
|
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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.
|
#5
|
|||
|
|||
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... |
#6
|
|||
|
|||
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.
|
#7
|
|||
|
|||
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. |
#8
|
|||
|
|||
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.
|
#9
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|