PDA

View Full Version : [VB3] Using VB3 authentication on non-VB pages


guru_guy
04-17-2004, 05:15 PM
Hi

I have some non VB pages where I would like to use the VB authentication to cross check against the database of users. Does anyone know where I can find this code?

assassingod
04-17-2004, 05:31 PM
You could add this to the top of your file:

require_once("./global.php");


Then to see if they are registered or not, you use:

if($bbuserinfo['userid'] == !0)
{
// stuff for registered peeps here
}
else
{
// everything else here
}


Should work.

guru_guy
04-17-2004, 07:16 PM
just so I can understand, what is in globa.php that will work for this and what is the $bbuserinfo variable? is it a cookie?

assassingod
04-17-2004, 07:17 PM
global.php is essentially the backbone of vBulletin, it allows connections to the database automatically and then lets you use important variables (i.e $bbuserinfo) in your pages, or vB forums.

guru_guy
04-17-2004, 07:48 PM
and $bbuserinfo is the a variable created upon login that contains the user's id and other info?

AN-net
04-17-2004, 08:41 PM
$bbuserinfo variable works for all users including guests;)

TouchingVirus
04-17-2004, 09:48 PM
most of the values are returned NULL are they not, like location and that

guru_guy
04-17-2004, 11:19 PM
so if the user isn't signed in, the values are returned null, however, if the user is logged in, the variable is populated. is there a way to authenticate the user using the user id as well as the user's password -- not just checking to see if $bbuserinfo['userid'] is populated?