whos-online-procs.tcl

Provides support for registering which users are online.

Location:
packages/acs-tcl/tcl/whos-online-procs.tcl
Created:
03 October 2003
Authors:
Bjoern Kiesbye
Peter Marklund
Lars Pind
CVS Identification:
$Id: whos-online-procs.tcl,v 1.11 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

whos_online::all_invisible_user_ids (public)

 whos_online::all_invisible_user_ids

This function returns a list with all user_ids which are set to invisible

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::all_invisible_user_ids whos_online::all_invisible_user_ids test_whos_online__check_online_visibility->whos_online::all_invisible_user_ids

Testcases:
whos_online__check_online_visibility

whos_online::flush (private)

 whos_online::flush

Removing all user_ids from the last_hit (nsv_set) which have a timestamp older than the number of seconds indicated by the proc whos_online::interval.

Author:
Bjoern Kiesbye

Partial Call Graph (max 5 caller/called nodes):
%3 whos_online::interval whos_online::interval (public) whos_online::flush whos_online::flush whos_online::flush->whos_online::interval

Testcases:
No testcase defined.

whos_online::init (private)

 whos_online::init

Schedules the flush proc that cleans up old who's online values. Makes sure the unregistered visitor (user_id=0) is invisible.

Author:
Bjoern Kiesbye

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-tcl/tcl/whos-online-init.tcl packages/acs-tcl/ tcl/whos-online-init.tcl whos_online::init whos_online::init packages/acs-tcl/tcl/whos-online-init.tcl->whos_online::init ad_schedule_proc ad_schedule_proc (public) whos_online::init->ad_schedule_proc whos_online::set_invisible whos_online::set_invisible (public) whos_online::init->whos_online::set_invisible

Testcases:
No testcase defined.

whos_online::interval (public)

 whos_online::interval

Returns the last number of seconds within a user must have requested a page to be considered online. Based on the LastVisitUpdateInterval parameter of the main site and defaults to 600 seconds = 10 minutes.

Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-subsite/www/shared/whos-online.tcl packages/acs-subsite/ www/shared/whos-online.tcl whos_online::interval whos_online::interval packages/acs-subsite/www/shared/whos-online.tcl->whos_online::interval whos_online::flush whos_online::flush (private) whos_online::flush->whos_online::interval whos_online::user_ids whos_online::user_ids (public) whos_online::user_ids->whos_online::interval parameter::get parameter::get (public) whos_online::interval->parameter::get subsite::main_site_id subsite::main_site_id (public) whos_online::interval->subsite::main_site_id

Testcases:
No testcase defined.

whos_online::num_anonymous (public)

 whos_online::num_anonymous

Get the number of anonymous users currently online, and not invisible

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

whos_online::num_users (public)

 whos_online::num_users

Get the number of registered users currently online, and not invisible

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::num_users whos_online::num_users test_whos_online__check_online_visibility->whos_online::num_users whos_online::user_ids whos_online::user_ids (public) whos_online::num_users->whos_online::user_ids packages/acs-subsite/www/group-master.tcl packages/acs-subsite/ www/group-master.tcl packages/acs-subsite/www/group-master.tcl->whos_online::num_users packages/openacs-default-theme/lib/plain-master.tcl packages/openacs-default-theme/ lib/plain-master.tcl packages/openacs-default-theme/lib/plain-master.tcl->whos_online::num_users packages/openacs-default-theme/lib/plain-streaming-head.tcl packages/openacs-default-theme/ lib/plain-streaming-head.tcl packages/openacs-default-theme/lib/plain-streaming-head.tcl->whos_online::num_users

Testcases:
whos_online__check_online_visibility

whos_online::seconds_since_first_request (public)

 whos_online::seconds_since_first_request user_id

Returns the number of seconds since the user with given id first requested a page. Returns the empty string if the user is not currently online.

Parameters:
user_id (required)
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-subsite/www/shared/whos-online.tcl packages/acs-subsite/ www/shared/whos-online.tcl whos_online::seconds_since_first_request whos_online::seconds_since_first_request packages/acs-subsite/www/shared/whos-online.tcl->whos_online::seconds_since_first_request

Testcases:
No testcase defined.

whos_online::seconds_since_last_request (public)

 whos_online::seconds_since_last_request user_id

Returns the number of seconds since the user with given id requested a page. Returns the empty string if the user is not currently online.

Parameters:
user_id (required)
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

whos_online::set_invisible (public)

 whos_online::set_invisible user_id

This procedure sets the user user_id to invisible, his user_id will not be returned by user_ids. The invisible state will only last as long as the user is online.

Parameters:
user_id (required)
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::set_invisible whos_online::set_invisible test_whos_online__check_online_visibility->whos_online::set_invisible packages/acs-subsite/www/shared/make-invisible.tcl packages/acs-subsite/ www/shared/make-invisible.tcl packages/acs-subsite/www/shared/make-invisible.tcl->whos_online::set_invisible whos_online::init whos_online::init (private) whos_online::init->whos_online::set_invisible

Testcases:
whos_online__check_online_visibility

whos_online::unset_invisible (public)

 whos_online::unset_invisible user_id

This procedure unsets the invisible state of user_id.

Parameters:
user_id (required)
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::unset_invisible whos_online::unset_invisible test_whos_online__check_online_visibility->whos_online::unset_invisible packages/acs-subsite/www/shared/make-visible.tcl packages/acs-subsite/ www/shared/make-visible.tcl packages/acs-subsite/www/shared/make-visible.tcl->whos_online::unset_invisible

Testcases:
whos_online__check_online_visibility

whos_online::user_ids (public)

 whos_online::user_ids [ -all ]

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

whos_online::user_invisible_p (public)

 whos_online::user_invisible_p user_id

This function checks if the user user_id is set to invisible. Returns a Tcl boolean.

Parameters:
user_id (required)
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_invisible_p whos_online::user_invisible_p test_whos_online__check_online_visibility->whos_online::user_invisible_p packages/acs-subsite/lib/home.tcl packages/acs-subsite/ lib/home.tcl packages/acs-subsite/lib/home.tcl->whos_online::user_invisible_p whos_online::user_ids whos_online::user_ids (public) whos_online::user_ids->whos_online::user_invisible_p

Testcases:
whos_online__check_online_visibility

whos_online::user_requested_page (private)

 whos_online::user_requested_page user_id

Records that the user with given id requested a page on the server

Parameters:
user_id (required)
Author:
Bjoern Kiesbye

Partial Call Graph (max 5 caller/called nodes):
%3 rp_filter rp_filter (private) whos_online::user_requested_page whos_online::user_requested_page rp_filter->whos_online::user_requested_page

Testcases:
No testcase defined.
[ show source ]