Index: openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 29 Dec 2003 20:08:52 -0000 1.22 +++ openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 30 Dec 2003 22:49:32 -0000 1.23 @@ -19,15 +19,14 @@ ad_proc -public ds_permission_p {} { Do we have permission to view developer support stuff. } { - return [ad_permission_p -user_id [ds_get_real_user_id] [ds_instance_id] "admin"] + return [permission::permission_p -party_id [ds_ad_conn user_id] -object_id [ds_instance_id] -privilege "admin"] } ad_proc -public ds_require_permission { object_id privilege } { - set user_id [ds_get_real_user_id] - if {![ad_permission_p -user_id $user_id $object_id $privilege]} { + if {![permission::permission_p -party_id [ds_ad_conn user_id] -object_id $object_id -privilege $privilege]} { if {$user_id == 0} { ad_maybe_redirect_for_registration } else { @@ -102,16 +101,13 @@ return "" } - set out "" + set out "
" if { [ds_enabled_p] && [ds_collection_enabled_p] } { global ad_conn set ds_url [ds_support_url] if {![empty_string_p $ds_url]} { - append out "
- " + append out "Developer Information
" } else { ns_log Error "ACS-Developer-Support: Unable to offer link to Developer Support \ because it is not mounted anywhere." @@ -127,34 +123,33 @@ } } if { $counter > 0 } { - append out "" + append out "$counter database command[ad_decode $counter 1 " taking" "s totalling"] [format "%.f" [expr { $total }]] ms
" } } if { [nsv_exists ds_request "$ad_conn(request).conn"] } { array set conn [nsv_get ds_request "$ad_conn(request).conn"] if { [info exists conn(startclicks)] } { - append out "\n" + append out "Page served in [format "%.f" [expr { ([clock clicks -milliseconds] - $conn(startclicks)) }]] ms
\n" } } if { [ad_parameter -package_id [ds_instance_id] ShowCommentsInlineP acs-developer-support 0] } { + append out "Comments: On | Off
" if { [nsv_exists ds_request "$ad_conn(request).comment"] } { - append out "" } + } else { + append out "Comments: On | Off
" } } if { [ds_user_switching_enabled_p] } { - append out "" + append out "[ds_user_select_widget]
" } - append out "
- Developer Information -
$counter database command[ad_decode $counter 1 " taking" "s totalling"] [format "%.f" [expr { $total }]] ms
page served in - [format "%.f" [expr { ([clock clicks -milliseconds] - $conn(startclicks)) }]] ms

" foreach comment [nsv_get ds_request "$ad_conn(request).comment"] { append out "Comment: $comment
\n" } - append out "
[ds_user_select_widget]
\n" return $out } @@ -352,10 +347,16 @@ ad_proc -private ds_get_real_user_id {} { Get the "real" user id. } { + return [ds_ad_conn user_id] +} + +ad_proc -private ds_ad_conn { args } { + Get the "real" user id. +} { if { [llength [info proc orig_ad_conn]] == 1 } { - return [orig_ad_conn user_id] + return [eval orig_ad_conn $args] } else { - return [ad_conn user_id] + return [eval ad_conn $args] } } @@ -459,4 +460,4 @@ ns_log Notice "developer support - not watching file for package $package_key as package is not enabled" } } -} \ No newline at end of file +}