PDA

View Full Version : vBulletin as Authentication


ee99ee
01-20-2011, 10:49 PM
Hi. We have a large forum community that we have taken ownership of running on vBulletin 4. We have an in-house application (written in PHP w/ Zend Framework) that we want to integrate authentication into vBulletin with. We want users to be able to use the same login and only have to login once (to the forum).

Any suggestions on how to get started? The most simple way I can think of would be to detect the cookie of vBulletin (if such exists) to see if the user is logged in, and then store the user's ID in our custom application as a reference to the user. So, our application would have no concept of users or passwords, just the ID to reference from vBulletin.

-Chris

ee99ee
01-26-2011, 04:15 PM
Have any idea?

-Chris

zlos
01-27-2011, 08:28 AM
include your /forum/global.php into the script and inspect $vbulletin->userinfo array.

There you will see quite a loty of info about user being logged int.

--------------- Added 1296124237 at 1296124237 ---------------

Try something like this:
<?
require_once("/path/to/your/forum/global.php");

//assuming admin has userid = 1
if($vbulletin->userinfo['userid'] == 1) {
echo "<pre>";
print_r($vbulletin->userinfo);
echo "</pre>";
} else {
echo "Sorry. Admin only."
}
?>