The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have a login script already for my membership site. I match the $username and $password input variables against the vB database, and it works fine. The problem is that users have to log in twice if they want to log in to the forum - first the membership site, then the forum.
This doubled login is really disturbing, what I want is to log the user into the vb forum automatically when they login to the site. I guess I have to set a cookie from my login script containing the same information as vB sets, and I have searched this forum, but so far have not been able to find a decent solution. |
#2
|
|||
|
|||
![]()
Well if you want a very easy way you could use the following plugin:
https://vborg.vbsupport.ru/showthread.php?t=108026 This involves basically including parts of vB on your site (nothing visible but it auto fills some arrays, checks you're logged in etc). There are a few drawbacks to this though which is why we're not using it, if the forum is closed or if a user is temp suspended it seems this same block that stops the user from accessing the forum is also in place for the site too. At our site at least we don't want people not to able to view the site just because they spammed on the forums lol. If those are disadvantages you can't put up with then the following may well help you: What we did was use the forum's login script i.e. passed our login info to the login.php page and then on our own site header check for the existence of the cookies vb creates. For the first part (passing the login info we simply looked at what the forum's login box usually passed to login.php and duplicated it. and for checking if they were logged in we just did something like; if (isset($_COOKIE['bbuserid'])) { $userid = $_COOKIE['bbuserid']; $userinfo = mysql_fetch_array(mysql_query("SELECT * FROM user WHERE userid = '$userid'")); } Also for my suggestion or the above plugin to work on multiple subdomains i.e. if you have forum.website.com or other subdomains you need to alter the value in the forum's admincp at: vBulletin Options -> Cookie and HTTP Header Options -> Cookie DOmain -> Custom Domain then do the following: if you're website is http:www.google.com then you'd chaneg the cookie domain to .google.com i.e. a dot then just the main domain. Hope that helps at least a bit. |
#3
|
|||
|
|||
![]()
Thx for the tips, I am getting closer to the solution, I can already login both to my site and the forums from my login script, BUT...
login.php makes a redirect on line 130: // do redirect do_login_redirect(); If I comment out this line then it will not redirect, BUT no vB login will take place either... ![]() I just cannot figure out how to modify includes/functions_login.php in order to skip this redirection AND still log in to vB. Or if redirect is necessary, is it possible to redirect to an arbitrary mypage.php instead? |
#4
|
|||
|
|||
![]()
For mine, I used the drupal vb script and it logged me into the site and the forums at the same time perfectly.
|
#5
|
|||
|
|||
![]()
Yes the redirect is needed for the cookie to be set.
|
#6
|
|||
|
|||
![]() Quote:
![]() Well, I will not open a new thread just because of this, but a completely different question: Now that the integrated login works, I would like to put my site's menubar above vBulletin's. Therefore I included my menubar.php under the <Navigation bar> in the header, however, it seems that php is not parsed within the template. Now am I missing something, or is it really not so simple to do it as I thought? |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|