![]() |
Automatically login to vbb
I have a site that is controlled by a user class and that vbb is only a part of the site structure. What I need is for when the person logs into the main site, they automatically get logged-in to vbb.
They are registered automatically into vbb from the main user class (direct db input). The vbb registration is disabled -> the user being redirected to the user class login. What I have now is a global vbb plugin which detects whether the user is logged in with the user class, and if yes, I extract their username/password from the database and the vbb login (hidden) is automatically filled in. I then have autologin with another plugin using javascript as Code:
<? if ($memuser !=''){ Any suggestions would be greatly appreciated. Thanx |
Nevermind, figured out how to do it...
Stripped the login function from login.php and renamed it vbblogin.php and then added it to the user class I am using from the main site. Needed a few minor modifications to the vbb login, but got it working. When someone logs-in from any external page, they are logged in to the userclass as well as vbb all in one login request. :) Thanks anyway |
Wow, nice! Don't mind sharing?
|
If you want to know how....
I use a access_user_class on several sites because it is readily customizable and offers a high degree of security (http://www.finalwebsites.com/snippets.php?id=10). 1. As part of the registration for the general user-class login, I added an automatic vbb account as follows: Code:
//Create Randon Salt 4 password 2. Stripped out the login from vbb login.php and saved it as vbblogin.php: Code:
<? Code:
$_POST[vb_login_username] = $_GET[user]; 3. Now to login, I located the login and cookie functions of the access_user_class.php that performn the login/cookie which happens to be the function set_user(). I tried an include, but the scripting in vbblogin.php and access_user_class.php were in conflict and to take the cheap and easy way out (easier than fixing the conflicts), I used a Location to drive the vbb login: Code:
//define username-password of access_user_class I also changed the login form in the narbar template to the user_class login, added the user_class to the top of headinclude, changed logout to the user_class (rather than vbb), added a few plug-ins to deal with a few issues. As I said, probably not the best way, but it works and probably can be applicable to a host of different external registration/login schemes. Hope it helps someone :confused: |
All times are GMT. The time now is 06:53 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|