how do i check from within a php script, if a user is logged in? My current way is, to get the output of
w | grep <username>
and check, if there is output. It works, if a user is logged in via gdm, kdm or ssh or login on a tty. But what it doesn't get is, if an other user opened a terminal and run
su <username>, this shell process is not reported, how do i get this?