The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Manually adding user to database; Can't login with user
I am trying to make a little script to manually add a new user to the vbulletin database. I understand how the password hashing works and have made a script that shows me what should be in the password field when I put in whats in the salt field, so I know the user im manually adding has the right password accoridng to it's salt. For some reason I still can't login to vbulletin with this user I manually added. I tried password reset on the user and afterwards logging in worked with the new password. I assumed some field in db I missed was preventing the original from logging so I compared the user's db info before and after password reset, and other than the password and the salt, I saw no difference. So I am really stumped on what could be preventing the login.
Like I said, I looked at the salt for a working user, and did the md5(md5(password) . salt) and got whats in the password field, then did the same for the manually added user whom I can't login with and got what the password field said for both, so I know thats not the problem. I am using the code for adding the admin user in the install portion of the script as a template for manually adding this user. The only thing I am doing differently is the options field. I am not puting any of the useroption defaults like vbasset_enable, showsignatures because I don't really know how to insert that. However, the user still is getting a string of numbers in the 'options' field in the database, however it isnt changing after the password reset so I don't even see how that could be the problem. I am totally stumped on this, please help. |
#2
|
||||
|
||||
If you want coding help, the best thing to do is to post your exact code, let us know exactly where you are adding it, and then post your template, and let us know where it is being added.
|
#3
|
|||
|
|||
Ok, this is just on a php file not in an vbulletin file.
PHP Code:
|
#4
|
||||
|
||||
In vb4, salt is 30 characters, not 3:
PHP Code:
|
#5
|
|||
|
|||
Changed it. Didn't fix the problem. I put 3 because in vb when it makes the admin account in install it used 3. Either way, I have the same problem though.
|
#6
|
|||
|
|||
The best way to add new account to vBulletin is to use the vB_Datamanager_User.
Here is the code I use in my Integration. PHP Code:
|
#7
|
|||
|
|||
Worked beautifully! Thank you so much for sharing your code with me. I guess I was just taking the wrong approach to this by trying to force the db entry rather than work with the vb code.
I have one more problem, and this may be a dumb question. I want this code to not be in the /forum directory but in the root directory of my site. If I include the global.php file, it includes /includes/class_bootstrap.php. Since my original file is not in the same directory as the global.php, the address to class_bootstrap isn't correct for my original file and I get a cannot find file error. I looked in some of the vb files to see how they solved this problem, and I see that they use this format when in this situation: PHP Code:
|
#9
|
|||
|
|||
Quote:
Or at least that's the result I got when I tested this a few years ago. And that was an unacceptable condition for our website. Banned for life members I would agree with. But we still wanted people that were suspended (for things like spamming etc ) to still be able to use the rest of our website. We saw the website and forums separate in that sense. Just seemed so strange to me that it forced it on you. Unless there's a way to stop that which I'm not aware of, or if they've changed how that works since I tested it a few years ago. I'd much prefer to use Vb's own functions/data managers as it's a bit messy doing things yourself. |
#10
|
|||
|
|||
Well the script I'm trying to integrate with vb is not letting me include global.php. Every time I try I get some error that says ajax must be enabled. So I guess I'm going to have to stick with the manual route. That being said, I still don't know why my original code didn't work correctly. Consolegaming can you either tell me what is wrong with my code or give me a sample of how you are manually inserting users to vb database? I would be very appreciative.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|