The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hi All,
I need to integrate the vb user/group system into a secondary php system. The script should return the username if: 1. The users vb cookie is in a logged in state (dont know if it can exist and not be in a logged-in state). 2. The user is a member of a special group. (Hardcoded groupname) Otherwise the script should return a blank and the receiving system will tell the visitor to log into VB first and/or join the appropiate group . Oh, and the script should work across domains!, i.e. I need to return the user name or the blank to www.site1.com from www.site2.com. Any ideas to the various levels in the above? /Tim |
#2
|
|||
|
|||
![]()
Ok,
I made the following script Script 1 PHP Code:
But I need to call script1 from another domain. Script1 above is actually placed in one subdomain like sub1.mysite.com and I need to call script1 from script2 in another subdomain like sub2.mysite.com. Script 2 PHP Code:
When script 2 calls script 1 it echos "no" even though calling script1 directly returns a username and id. I found out that script1 fails at " PHP Code:
What am I missing here? |
#3
|
||||
|
||||
![]()
Simpilfied code:
PHP Code:
If you use an include with an URL, the included script will never get cookies. Also, for cookies to work across subdomains, your cookie-domain must be set to .mysite.com |
#4
|
||||
|
||||
![]() Quote:
![]() Quote:
Quote:
Quote:
|
#5
|
||||
|
||||
![]()
When you do an include through an URL, the PHP process is the "browser" - and it does not have cookies
![]() You would have to use fsockopen, curl or smth. to pass through the cookies. But still I don't underestand why you don't just load the vBulletin backend where you need the data? |
#6
|
|||
|
|||
![]() Quote:
![]() Quote:
![]() Can I require the global.php file from a script on subdomain 2 and run script 1 here instead? Or do I have to disect the various VB scripts and extract userinfo initialization code into a standalone script that does not require a VB installation but only the cookie and the db? |
#7
|
||||
|
||||
![]()
I assumed both subdomains are being hosted on the same phsical server (does not necessarily have to be the same webserver). If they are being run on separate machines, it gets more compicated - you could use NFS for example.
Or you could use a standalone login check (that's what I would do). Or you could take the cookies and pass it (through a GET request for example) to the other server, process it and return if it's authorized or not). |
#8
|
|||
|
|||
![]()
Andreas,
I'll investigate the different approaches. Thx's for your efforts. It is much appreciated! /Tim |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|