Andrew,

I have a squid cache that makes people authenticate... I'd like to set up
PHP page that displays some information about the person logged in
based on the username they are using..


I did a phpinfo()  but the squid auth username doesn't appear in any
global variables...

That is because squid doesn't pass the authentication information to the web server (nor should it!).


How do I find out the username of the person viewing my php script?

You can't easily.


Is there any way to list all the users who are currently logged in ?

HTTP is a stateless protocol. Nobody is "logged in", they just make requests.


You could fake this by importing access log entries into a database and then searching for people who have made requests in the recent past (e.g. in the last five minutes).

Matthew.



Reply via email to