whos_online::user_ids (public)

 whos_online::user_ids [ -all ]

Defined in packages/acs-tcl/tcl/whos-online-procs.tcl

This function returns a list of user_ids from users which have requested a page from this Server in the last 10 min and aren't set to invisible.

Switches:
-all (optional, boolean)
Set this flag if you want to include invisible users.
Author:
Bjoern Kiesbye

Partial Call Graph (max 5 caller/called nodes):
%3 test_whos_online__check_online_visibility whos_online__check_online_visibility (test acs-tcl) whos_online::user_ids whos_online::user_ids test_whos_online__check_online_visibility->whos_online::user_ids whos_online::interval whos_online::interval (public) whos_online::user_ids->whos_online::interval whos_online::user_invisible_p whos_online::user_invisible_p (public) whos_online::user_ids->whos_online::user_invisible_p packages/acs-subsite/www/shared/whos-online.tcl packages/acs-subsite/ www/shared/whos-online.tcl packages/acs-subsite/www/shared/whos-online.tcl->whos_online::user_ids whos_online::num_users whos_online::num_users (public) whos_online::num_users->whos_online::user_ids

Testcases:
whos_online__check_online_visibility
Source code:
    array set last_hit [nsv_array get last_hit]
    set onliners [list]
    set oldtime [expr {[ns_time] - [interval]}]

    for { set search [array startsearch last_hit] } { [array anymore last_hit $search] } {} {
        set user_id [array nextelement last_hit $search]
        if { $last_hit($user_id) > $oldtime } {
            # User is online
            if { $all_p || ![user_invisible_p $user_id] } {
                # And he's not invisible, or we want all users
                lappend onliners $user_id
            }
        }
    }

    array donesearch last_hit $search

    return $onliners
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: