I want to collect statistics about who is using a computer and for how much time. I can use the users command to see who is logged in but I want to know who is on the currently active VT. I don't care about people who's logged in through SSH or who leaves a download running in a locked session. I only care about who actually sits in front of the machine.

I need information on X and console sessions.

Getting the time of the last activity (moving the mouse, etc) would be also useful but I can live without it.

That's what the wtmp file, and last command are for. Type last at a shell to see who has logged in, how long they were logged in, and from where. If they are currently logged on the command reports that.

The column showing where the user is/was logged in from will show a DISPLAY there, such as :0. Console users will have a tty matching tty[0-9]+.