enqueue users

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
yamobe
Forum Newbie
Posts: 13
Joined: Mon Jun 19, 2006 9:42 am

enqueue users

Post by yamobe »

Hello, well... I have been trying to achieve this task with not very good results. Hopefully someone can help me.
I want to do the following thing:

I have a webpage with authentification, and it is a virtual lab to control a motor remotely, so only ONE person is allowed to enter to my website, otherwise a lot of people could use the motor at the same time... whick is not possible.

Well, what I want to do, is:

person A enter the site... now he has a time of T seconds before beeing disconnected
person B wants to enter:
_if A is using the site, B is first in the queue to enter the site
_if A is disconnected, B enters
person C wants to enter
_if A is using the site and B is in the queue, C enters to the queue as number 2


I don´t need you to give me the code to do this (unless you really want to), but I would like to know some references to read so I can do this.. because I really don't know how.

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sounds like a "given each user a token" while you "record the order of tokens" kind of deal. You could use a page refresh or something similar (Ajax maybe) that does a pulse check on the user queue updating their position information as well as helping automate the token decay without the need of a cron.
yamobe
Forum Newbie
Posts: 13
Joined: Mon Jun 19, 2006 9:42 am

Post by yamobe »

yeah... token is a good work to start my search, then you are right.. I could refresh the page every few seconds to update the positions. cool
yamobe
Forum Newbie
Posts: 13
Joined: Mon Jun 19, 2006 9:42 am

Post by yamobe »

now a new problem pops up

when I refresh the page I loose the nick and password variables I get with $HTTP_POST_VARS

should I work this out with some session variables=?
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Yep.
Post Reply