[isf-wifidog] auth server: debian packaging, timeouts, kicking
users, captcha
Alexander List
alex at list.priv.at
Mer 17 Mai 06:02:16 EDT 2006
Ian,
thanks indeed for your help -
now what I do to log out the user is running a small Perl script from
cron doing this:
UPDATE connections SET token_status='USED'
WHERE NOW()-timestamp_in > '60 minutes'
What did you mean by changing the auth/index.php? When I set the token
to 'USED', any web access will be redirected to the login page again -
do you mean some message like "You have been logged out after 60 minutes
of online time"? How should the auth/index.php "know" that this just
happened? Just display that sentence for 5 minutes after the user being
logged out, that is having a 'USED' session less than 5 minutes old?
Something like
SELECT user_id,user_ip,user_mac FROM connections WHERE
token_status='USED' AND NOW()-last_updated < '5 minutes'
I didn't figure how to do this autologout feature elegantly using a
trigger and stored procedure as I'm not familiar with Postgres, and a
cronjob will do for my urgent needs. If anyone can come up with an
"inside the database" solution, I'm anxious for your input :-)
I'll have a look at some PHP captcha library for the Turing test now.
Thanks again for your help!
Alex
More information about the WiFiDog
mailing list