xowiki::utility proc user_is_active (public)

 xowiki::utility[i] user_is_active [ -asHTML on|off ] uid

Defined in packages/xowiki/tcl/xowiki-utility-procs.tcl

Tell whether a user is active according to the Request Monitor.

Switches:
-asHTML
(boolean) (defaults to "false") (optional)
when true, the proc will return an HTML rendering of the user information.
Parameters:
uid - the user id
Returns:
boolean or HTML according to the 'asHTML' flag.

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

Testcases:
No testcase defined.
Source code:
if {[info commands ::throttle] ne "" &&
    [::throttle info methods user_is_active] ne ""} {
  set active [throttle user_is_active $uid]
  if {$asHTML} {
    array set color {1 green 0 red}
    array set state {1 active 0 inactive}
    return "<span class='$state($active)' style='background: $color($active);'>&nbsp;</span>"
  } else {
    return $active
  }
} else {
  ns_log notice "user_is_active requires xotcl-request monitor in a recent version"
  return 0
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: