Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2005, 09:10 PM
TMR Bac TMR Bac is offline
 
Join Date: Feb 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default VB and Sub-Domains & Session Cookies

Hey All, I recently successfully installed the latest version of VB. That was the easy part. The hard part for me is that I have an existing site-wide login this forum is replacing, so I need to use this forum login and session cookie to do the following across all sub-domains:

Check for and decode the vb cookie that has the login information in it to determine if they are logged in or not.

If they are, extract either the username or userid (or both if available) from that cookie.

So in a nutshell, the user will use the VB login and forums, but then can navigate to xxx.domain.com, yyy.domain.com, etc. and will still need to appear as logged in.

Here is an example of it working in action: forum.teamxbox.com

Any help would be greatly appreciated. Thanks!
Dan
Reply With Quote
  #2  
Old 02-10-2005, 10:00 AM
WhSox21 WhSox21 is offline
 
Join Date: Feb 2004
Posts: 328
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll need to change your cookie settings I believe. I'm not sure what to change them to or even where to be honest but I believe in your vbulletin settings.
Reply With Quote
  #3  
Old 02-10-2005, 10:47 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Set the Cookie Domain to .domain.com (the leading dot is important!), then the cookies should be available on all subdomains.

To determine if a user is logged in:
The easiest way would be to require vBulletins global.php and check if $bbuserinfo[userid] is set.

If this is not possible you can check the cookies manually:
  • bbuserid is, obviously, the UserID
  • bbpassword is md5(md5(md5('Plaintext-Password') . $salt) . 'LicenseNo'), where $salt is the value of column salt in table user for this UserID and LicenseNo is your vBulletin License Number.

Also note the bb is just the default cookie-prefix. If you have set this to vbcookie for example, the cookies would be vbcookieuserid and vbcookiepassword.
Reply With Quote
  #4  
Old 02-10-2005, 01:21 PM
TMR Bac TMR Bac is offline
 
Join Date: Feb 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys, I got it working. The only obstacle now is figuring out how to hack vbulletin so it allows the login box to sit outside the forum directory. Right now the login doesn't like you to post from a sub-domain other than the main domain the forum is on. It throws up a security message.
Reply With Quote
  #5  
Old 02-10-2005, 01:34 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In init.php FIND
PHP Code:
// referrer check for POSTs 
Below this is a referer check. Id' suggest do modify the regex to suit your needs (eg. only check domain, not the complete host).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:14 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
  • Page Generation 0.04465 seconds
  • Memory Usage 2,197KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete