问题
I need to use vBulletin auth system on the rest of my site. Does vB has any APIs for that?
Im expecting to find something like that:
if($vBulletin->isAuthenticated())
{
// user authenticated
}
In case of vB does not have such API, is there any other ways to check if user is authenticated?
回答1:
Basically, to ensure the user is logged in you need to look into cookies and match the session hash from vBulletin DB.
This link has good information on that matter: http://www.saurdo.com/11/11/utilizing-the-vbulletin-database-in-your-main-site
More information can be found in my answer to this similar question: Django / vBulletin single sign on
回答2:
A plugin has been written for 3.7 which you can find here and an updated version for 4 is here.
I don't think there's an API which has been developed by vBulletin which allows you to do it, but these mods seem to do the trick. You could look through the code to see how it has been done if you want to use a different method.
来源:https://stackoverflow.com/questions/2476975/how-to-integrate-vbulletin-auth-with-my-site