Ah, are you sure activity is measured by how many people are logged in? Can you measure it by the number of HTTP requests in the last 5 minutes or so?
Can people by logged in and at the same time offline? If they haven't done any HTTP requests for the last five minutes, you can mark them 'offline'.