The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
auto login to vb when login to main site?
Hi all.
I am developing a site that has it's own user registration and login system. I have got as far as auto creating a forum account for a user when they register to the main site. That's fine. Now I want them to be auto logged into the forum when they are logged into the main site, so they don't have to login twice. I have searched about for an answer but not found anything definitive for this. I thought it may be as easy as creating the sessions and cookies for VB in my main login system. I.e bb_sessionhash, bb_userid, bb_password etc. However, I am noticing that the current version of vb no longer seems to generate bb_userid and bb_password cookies when logging in directly to vb. However my bb_sessionhash cookie and coresponding db entry generated by my main login script do seem to be correct, but I'm not logged in to vb. Can some one tell me what the best method is for logging into vb via an other login system? |
#2
|
|||
|
|||
Managed to figure it all out and get it working! Once again thank you all so much for the vast number of replies, help, advice and useful information you have all been so keen to provide here. This really is such a great community right here. I just don't know what I would do with out you guys. Big hugs to you all!
|
2 благодарности(ей) от: | ||
BSMedia |
#3
|
|||
|
|||
35mm, please let me know how you did it? I am working on an application that has already been developed with it's own auth, along with FB auth, and the forums are an addon for support etc. Ultimately what I would like to do is a kind of FB Connect button but an Application Connect where they click that and it automatically creates an account for them using their application logins. However what I'm not sure how to handle is password changes on the application so the connect button would be a great solution.
|
#4
|
|||
|
|||
Hi Ingwa, my site is not in production yet so I changed the password hashing of the site to use the same hashing method of vb. I also sync the user ID's from both systems. So when a user signs up or changes their password, it also creates/updates their forum account. As the main site also has user profiles and messenger, I didn't want vb user profiles or messenger so re-routed those to the main site's. I also got rid of vb's register page and login.
Now when a user logs into the main site, they are automatically logged into vb too. This is just simply a question of creating the sessions/cookies that vb's login process creates. I think this is my working code - based on someone else's code example from some other thread here; PHP Code:
Some considerations; You are probably better off giving your vb users the same user id as they have in your main user db, rather than using the auto increment in the vb user table. For ease of integration I would suggest you use vb's password hashing method for password hashing in your main user database so that their passwords in both databases are the same - have the same hashed result. In your process for users to change or reset their passwords on your main site, make sure you add code so it also updates their password in vb user table. Redirect all vb registration requests, login and lost password requests etc to your main site registration, login and password reset etc pages. I hope this helps! |
#5
|
|||
|
|||
35mm, thank you so much for sharing your code and experience. At this point we have a main site that has been live for a small time so I'll have to figure out how to handle that. However, you've given me some great direction and I appreciate the time you took to reply.
I'll keep a look out for your posts and try help where I can. Here's hoping I can get this cracked in a few hours and I wish you success with your project too. Ingwa. |
#6
|
|||
|
|||
Would someone be able to tell me what I'm doing wrong here?
PHP Code:
--------------- Added [DATE]1314731113[/DATE] at [TIME]1314731113[/TIME] --------------- Just noticed I'd set cookie_expire to the past, but I've sorted that and still it does't work. |
#7
|
|||
|
|||
Punterzone - did you get it working? I'm trying this now using VB4....
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|