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.2 -r1.2.2.1 --- openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 17 Nov 2001 11:40:42 -0000 1.2 +++ openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 9 Mar 2002 23:20:52 -0000 1.2.2.1 @@ -306,10 +306,10 @@ ad_proc -private ds_get_real_user_id {} { Get the "real" user id. } { - if { [llength [info proc orig_ad_get_user_id]] == 1 } { - return [orig_ad_get_user_id] + if { [llength [info proc orig_ad_conn]] == 1 } { + return [orig_ad_conn user_id] } else { - return [ad_get_user_id] + return [ad_conn user_id] } } @@ -325,6 +325,18 @@ } } +ad_proc ds_conn { args } { + Developer support version of ad_conn. Overloads "ad_conn user_id", + delegates to ad_conn in all other cases. +} { + if { [lindex $args 0] == "user_id" || + ([lindex $args 0] == "-get" && [lindex $args 1] == "user_id") } { + return [ds_get_user_id] + } else { + return [eval "orig_ad_conn [join $args]"] + } +} + ad_proc ds_set_user_switching_enabled { enabled_p } { Enables/disables user-switching in a safe manner. @@ -345,9 +357,13 @@ catch { ad_set_client_property developer-support user_id [ad_get_user_id] } + rename ad_conn orig_ad_conn rename ad_get_user_id orig_ad_get_user_id rename ad_verify_and_get_user_id orig_ad_verify_and_get_user_id + proc ad_conn { args } { + eval "ds_conn [join $args]" + } proc ad_get_user_id {} { ds_get_user_id } @@ -357,6 +373,9 @@ } } else { if { [llength [info proc orig_ad_get_user_id]] == 1 } { + rename ad_conn {} + rename orig_ad_conn ad_conn + rename ad_get_user_id {} rename orig_ad_get_user_id ad_get_user_id