PDA

View Full Version : Checking for logged in users


Syberius
03-02-2003, 02:46 PM
Hi,

I am writing a site that will be part of a large community running a vb Board.

However before a member of the main site can use the services of my site they must verify that they are registered.

This is OK but I currently have to ask them to be logged in to the main site before logging into mine.

Is there any way I can check for a session record created by VB or what?

I dont have access to all the VB tables in the db but I can ask for the acccess should I need it.

Thx in advance.

Syberius,

Steve Machol
03-02-2003, 04:08 PM
Syberius, to download hacks and get support you will need to go to this (http://www.vbulletin.com/members/forums.php) page and enter your email address, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.

Morgalis
03-07-2003, 06:08 PM
hello :)

Syberius is coding a very cool site that compliments my domain, www.diabloworld.com

we are looking for information and have been sent here from the main site

i am the licensed owner and for obvious reasons i do not share my customer number

i can send email anywhere that is appropriate as a member.. we just need to know WHERE and hopefully this time we'll get an answer ;)

Syberius
03-17-2003, 05:31 PM
OK,

although I do not have a vbb account, my good friend and site owner, Morgalis has added my email to the account.

So, would I now be able to get some help for my query?

Syb,

Steve Machol
03-17-2003, 07:21 PM
Thanks. I don't know the answer to your question but hopefully someone will.

Xenon
03-17-2003, 07:29 PM
you can theoretically require global.php of vb in your scripts and then test if the $bbuserinfo['userid'] equals 0 (not logged in)

Syberius
03-17-2003, 07:35 PM
ok, thx,

that is what i needed for checking a user, but what about keeping the users session alive. My site is an extension of the original but im not using VBB, merely linking to elements of it.

Is there a way for me to keep a vbb session alive using php even though the user is not browsing a vb board?

Syb,

Xenon
03-17-2003, 07:46 PM
if you require global.php it automatically keeps the session alive :)

or you can just update the session table everytime manually

Syberius
03-17-2003, 07:50 PM
Great,

thank you very much for your time and help.

This really will help me with the project, even if it has added yet another thing to the todo list for the project :)

Thanks again, on behalf of Diabloworld and the D2TP Project,

Syberius,

Xenon
03-17-2003, 07:53 PM
you're welcome :)

Syberius
03-18-2003, 12:12 PM
Just had a thought, how can this be done if my site is on a subdomain of the main one, but both sites are on the same server?

Syb,

Xenon
03-18-2003, 01:15 PM
if you use absolute path's it should work :)

Syberius
03-19-2003, 06:11 PM
Well, the idea was there but not quite that simple.

I have had to copy global.php into the root dir of the site and also copy 4 other files into a new "admin" dir.

Then I had to edit a few SQL queries in the files because the SQL Connection I use for my site is not the same as for the main one.

The setup works but I would prefer to control the sessions via MySQL but I dont know enough about how vbb was coded to do this.

Can you maybe give me some hints and tips on how I can keep a user's session alive on my site using the vbb db tables?

I have good knowledge of php and mysql but my brain just aint ready for reading the vbb code yet!

Thx,

Syb,

Xenon
03-19-2003, 06:48 PM
hmm i think a chdir() use before including global.php would have been enough, no need to copy files :)

hmm, the sessions.php which controlls the vb sessions is a file i never worked with, just take a look at the table sessions of the vb database, every active user is in there with a field lastactivity. just update this field to time() to keep trhe session alive :)

Syberius
03-19-2003, 06:50 PM
That is what I was not sure of, things like session hash had me thrown, so all I have to do is update that table?

Or, that is how it should work in theroy,

Thx,

Syb,

Xenon
03-19-2003, 06:55 PM
it should work :)

just be sure you update the right row ;)