last-requests.tcl
Displays last requests of a user
- Location:
- /packages/acs-subsite/www/admin/system/last-requests.tcl
- Author:
- Gustaf Neumann <adapted for interaction with controlling thread>
- CVS ID:
$id: whos-online.tcl,v 1.1.1.1 2004/03/16 16:11:51 nsadmin exp $
Related Files
- packages/acs-subsite/www/admin/system/last-requests.tcl
- packages/acs-subsite/www/admin/system/last-requests.adp
[ hide source ] | [ make this the default ]
File Contents
ad_page_contract { Displays last requests of a user @author Gustaf Neumann (adapted for interaction with controlling thread) @cvs-id $id: whos-online.tcl,v 1.1.1.1 2004/03/16 16:11:51 nsadmin exp $ } -properties { title:onevalue context:onevalue } set title "Last Requests" set context [list "Last Requests"] set request_key [ns_queryget request_key 0] if {[string first . $request_key] > 0} { set user_string $request_key } else { acs_user::get -user_id $request_key -array user set user_string "$user(first_names) $user(last_name)" set url [acs_community_member_url -user_id $request_key] append user_string " (<a href='$url'>$request_key</a>)" } set admin [acs_user::site_wide_admin_p] set template_elements { time { label "Time" } timediff { label "Seconds ago" html { align right } } url { label "Url" } } template::list::create \ -name last_requests \ -multirow last_requests \ -no_data "no requests for this user recorded" \ -elements $template_elements set urls [list] set requests [throttleThread do Users last_requests $request_key] set last_timestamp [lindex $requests end 0] foreach element $requests { lassign $element timestamp url set diff [expr {$last_timestamp-$timestamp}] lappend urls [list [clock format $timestamp] $diff $url] } multirow create last_requests time timediff url foreach elm $urls { multirow append last_requests \ [lindex $elm 0] \ [lindex $elm 1] \ [lindex $elm 2] \ }