Index: openacs-4/packages/acs-tcl/tcl/utilities-procs-aolserver.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs-aolserver.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs-aolserver.tcl 26 Feb 2018 19:07:07 -0000 1.1 @@ -0,0 +1,283 @@ +ad_library { + + Provides a variety of non-ACS-specific utilities, including + the procs to support the who's online feature. + + @author Various (acs@arsdigita.com) + @creation-date 13 April 2000 + @cvs-id $Id: utilities-procs-aolserver.tcl,v 1.1 2018/02/26 19:07:07 gustafn Exp $ +} + +if {[ns_info name] eq "NaviServer"} { + return +} + +#------------------------------------------------------------------------- +# AOLserver implementation of ad_url(en|de)code* procs +#------------------------------------------------------------------------- + +ad_proc -public ad_urlencode_folder_path {path} { + Perform an urlencode operation on the segments of the provided + folder (for a full folder path rather than path segments as in + ad_urlencode_path). + @see ad_urlencode_path +} { + set segments {} + foreach segment [split $path /] { + lappend segments [ns_urlencode $segment] + } + return [join $segments /] +} + +ad_proc -public ad_urlencode_path { string } { + Encode provided string with url-encoding for path segments; + same as ad_urlencode, since AOLserver does not support this difference +} { + return [ad_urlencode $string] +} + +ad_proc -public ad_urldecode_path { string } { + Decode provided string with url-encoding for path segments; + same as ns_urldecode, since AOLserver does not support this difference +} { + return [ns_urldecode $string] +} + +ad_proc -public ad_urlencode_query { string } { + Encode provided string with url-encodingfor path segments; + same as ad_urlencode, since AOLserver does not support this difference +} { + return [ad_urlencode $string] +} + +ad_proc -public ad_urldecode_query { string } { + Decode provided string with url-encoding for path segments; + same as ns_urldecode, since AOLserver does not support this difference +} { + return [ns_urldecode $string] +} + + +#------------------------------------------------------------------------- +# Cookie operations based on AOLserver primitives +#------------------------------------------------------------------------- + +ad_proc -public ad_unset_cookie { + {-secure f} + {-domain ""} + {-path "/"} + name +} { + Un-sets a cookie. + + @see ad_get_cookie + @see ad_set_cookie +} { + ad_set_cookie -replace t -expire t -max_age 0 \ + -secure $secure -domain $domain -path $path \ + $name "" +} + +# +# Get Cookie +# +ad_proc -public ad_get_cookie { + { -include_set_cookies t } + name + { default "" } +} { + Returns the value of a cookie, or $default if none exists. + + @see ad_set_cookie + @see ad_unset_cookie +} { + + if { $include_set_cookies == "t" } { + set headers [ns_conn outputheaders] + set nr_headers [ns_set size $headers] + for { set i 0 } { $i < $nr_headers } { incr i } { + if { [string tolower [ns_set key $headers $i]] eq "set-cookie" + && [regexp "^$name=(\[^;\]*)" [ns_set value $headers $i] match value] + } { + return [ns_urldecode $value] + } + } + } + + set headers [ns_conn headers] + set cookie [ns_set iget $headers Cookie] + + if { [regexp " $name=(\[^;\]*)" " $cookie" match value] } { + + # If the cookie was set to a blank value we actually stored two quotes. We need + # to undo the kludge on the way out. + + if { $value eq "\"\"" } { + set value "" + } + return [ns_urldecode $value] + } + + return $default +} + +# +# Set Cookie +# +ad_proc -public ad_set_cookie { + {-replace f} + {-secure f} + {-expire f} + {-max_age ""} + {-domain ""} + {-path "/"} + {-discard f} + {-scriptable t} + name + {value ""} +} { + + Sets a cookie. Cookies are name/value pairs stored in a client's + browser and are typically sent back to the server of origin with + each request. + + @param max_age specifies the maximum age of the cookies in + seconds (consistent with RFC 2109). max_age "inf" specifies cookies + that never expire. The default behavior is to issue session + cookies. + + @param expire specifies whether we should expire (clear) the cookie. + Setting Max-Age to zero ought to do this, but it doesn't in some browsers + (tested on IE 6). + + @param path specifies a subset of URLs to which this cookie + applies. It must be a prefix of the URL being accessed. + + @param domain specifies the domain(s) to which this cookie + applies. See RFC2109 for the semantics of this cookie attribute. + + @param secure specifies to the user agent that the cookie should + only be transmitted back to the server of secure transport. + + @param replace forces the current output headers to be checked for + the same cookie. If the same cookie is set for a second time + without the replace option being specified, the client will + receive both copies of the cookie. + + @param discard instructs the user agent to discard the + cookie when when the user agent terminates. + + @param scriptable If the scriptable option is false or not + given the cookie is unavailable to javascript on the + client. This can prevent cross site scripting attacks (XSS) on + clients which support the HttpOnly option. Set -scriptable to + true if you need to access the cookie via javascript. For + compatibility reasons with earlier versions, OpenACS 5.8 has + the default set to "true". OpenACS 5.9 will have the flag per + default set to "false". + + @param value is autmatically URL encoded. + + @see ad_get_cookie + @see ad_unset_cookie +} { + set headers [ad_conn outputheaders] + if { $replace } { + # Try to find an already-set cookie named $name. + for { set i 0 } { $i < [ns_set size $headers] } { incr i } { + if { [string tolower [ns_set key $headers $i]] eq "set-cookie" + && [string match "$name=*" [ns_set value $headers $i]] + } { + ns_set delete $headers $i + } + } + } + + # need to set some value, so we put "" as the cookie value + if { $value eq "" } { + set cookie "$name=\"\"" + } else { + set cookie "$name=[ns_urlencode $value]" + } + + if { $path ne "" } { + append cookie "; Path=$path" + } + + if { $discard != "f" } { + append cookie "; Discard" + } elseif { $max_age eq "inf" } { + if { $expire == "f"} { + # + # netscape seemed unhappy with huge max-age, so we use + # expires which seems to work on both netscape and IE + # + append cookie "; Expires=Mon, 01-Jan-2035 01:00:00 GMT" + } + } elseif { $max_age ne "" } { + # + # We know $max_age is also not "inf" + # + append cookie "; Max-Age=$max_age" + if {$expire == "f"} { + # Reinforce Max-Age via "Expires", unless user required + # immediate expiration + set expire_time [util::cookietime [expr {[ns_time] + $max_age}]] + append cookie "; Expires=$expire_time" + } + } + + if {$expire != "f"} { + append cookie "; Expires=Tue, 01-Jan-1980 01:00:00 GMT" + } + + if { $domain ne "" } { + append cookie "; Domain=$domain" + } + + if { $secure == "t" } { + append cookie "; Secure" + } + + if { $scriptable == "f" } { + # Prevent access to this cookie via JavaScript + append cookie "; HttpOnly" + } + + ns_log Debug "OACS Set-Cookie: $cookie" + ns_set put $headers "Set-Cookie" $cookie +} + + +#------------------------------------------------------------------------- +# Provide a clean way of handling exceptions in mutexed regions +# (between locking and unlocking of an mutex). Should be used probably +# on more places in OpenACS. +#------------------------------------------------------------------------- + +ad_proc -public ad_mutex_eval {mutex script} { + + Compatibility proc for handling differences between NaviServer + and AOLserver since AOLserver does not support "ns_mutex + eval". + + @author Gustaf Neumann + +} { + ns_mutex lock $mutex + ad_try { + set result [uplevel $script] + } on error {errorMsg} { + error $errorMsg + } finally { + ns_mutex unlock $mutex + } + return $result +} + + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/acs-tcl/tcl/utilities-procs-naviserver.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs-naviserver.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs-naviserver.tcl 26 Feb 2018 19:07:07 -0000 1.1 @@ -0,0 +1,191 @@ +ad_library { + + Provides a variety of non-ACS-specific utilities, including + the procs to support the who's online feature. + + @author Various (acs@arsdigita.com) + @creation-date 13 April 2000 + @cvs-id $Id: utilities-procs-naviserver.tcl,v 1.1 2018/02/26 19:07:07 gustafn Exp $ +} + + +if {[ns_info name] ne "NaviServer"} { + return +} + +#------------------------------------------------------------------------- +# NaviServer implementation of ad_url(en|de)code* procs +#------------------------------------------------------------------------- + +ad_proc -public ad_urlencode_folder_path {path} { + Perform an urlencode operation on the segments of the provided + folder (for a full folder path rather than path segments as in + ad_urlencode_path). + @see ad_urlencode_path +} { + return [ns_urlencode -part path -- {*}[split $path /]] +} + +ad_proc -public ad_urlencode_path { string } { + Encode provided string with url-encoding for paths segments + (instead of query segments) as defined in RFC 3986 +} { + return [ns_urlencode -part path -- $string] +} + +ad_proc -public ad_urldecode_path { string } { + Decode provided string with url-encoding for paths segments + (instead of query segments) as defined in RFC 3986 +} { + return [ns_urldecode -part path -- $string] +} + +ad_proc -public ad_urlencode_query { string } { + Encode provided string with url-encoding for query segments + (instead of paths) as defined in RFC 3986 +} { + return [ns_urlencode -part query -- $string] +} + +ad_proc -public ad_urldecode_query { string } { + Decode provided string with url-encoding for query segments + (instead of path segments) as defined in RFC 3986 +} { + return [ns_urldecode -part query -- $string] +} + +#------------------------------------------------------------------------- +# Cookie operations based on NaviServer primitives +#------------------------------------------------------------------------- + +ad_proc -public ad_unset_cookie { + {-secure f} + {-domain ""} + {-path "/"} + name +} { + Un-sets a cookie. + + @see ad_get_cookie + @see ad_set_cookie +} { + ns_deletecookie -domain $domain -path $path -replace t -secure $secure -- $name +} + +# +# Get Cookie +# +ad_proc -public ad_get_cookie { + { -include_set_cookies t } + name + { default "" } +} { + Returns the value of a cookie, or $default if none exists. + + @see ad_set_cookie + @see ad_unset_cookie +} { + ns_getcookie -include_set_cookies $include_set_cookies -- $name $default +} +# +# Set Cookie +# +ad_proc -public ad_set_cookie { + {-replace f} + {-secure f} + {-expire f} + {-max_age ""} + {-domain ""} + {-path "/"} + {-discard f} + {-scriptable t} + name + {value ""} +} { + + Sets a cookie. Cookies are name/value pairs stored in a client's + browser and are typically sent back to the server of origin with + each request. + + @param max_age specifies the maximum age of the cookies in + seconds (consistent with RFC 2109). max_age "inf" specifies cookies + that never expire. The default behavior is to issue session + cookies. + + @param expire specifies whether we should expire (clear) the cookie. + Setting Max-Age to zero ought to do this, but it doesn't in some browsers + (tested on IE 6). + + @param path specifies a subset of URLs to which this cookie + applies. It must be a prefix of the URL being accessed. + + @param domain specifies the domain(s) to which this cookie + applies. See RFC2109 for the semantics of this cookie attribute. + + @param secure specifies to the user agent that the cookie should + only be transmitted back to the server of secure transport. + + @param replace forces the current output headers to be checked for + the same cookie. If the same cookie is set for a second time + without the replace option being specified, the client will + receive both copies of the cookie. + + @param discard instructs the user agent to discard the + cookie when when the user agent terminates. + + @param scriptable If the scriptable option is false or not + given the cookie is unavailable to javascript on the + client. This can prevent cross site scripting attacks (XSS) on + clients which support the HttpOnly option. Set -scriptable to + true if you need to access the cookie via javascript. For + compatibility reasons with earlier versions, OpenACS 5.8 has + the default set to "true". OpenACS 5.9 will have the flag per + default set to "false". + + @param value is autmatically URL encoded. + + @see ad_get_cookie + @see ad_unset_cookie +} { + + + if { $expire == "f"} { + set expire -1 + } elseif {$max_age ne ""} { + if {$max_age eq "inf"} { + set expire -1 + } else { + set expire [expr {[ns_time] + $max_age}] + } + } + + ns_setcookie -discard $discard -domain $domain -expires $expire -path $path \ + -replace $replace -scriptable $scriptable -secure $secure -- \ + $name $value +} + +#------------------------------------------------------------------------- +# Provide a clean way of handling exceptions in mutexed regions +# (between locking and unlocking of an mutex). Should be used probably +# on more places in OpenACS. +#------------------------------------------------------------------------- + +ad_proc -public ad_mutex_eval {mutex script} { + + Compatibility proc for handling differences between NaviServer + and AOLserver since AOLserver does not support "ns_mutex + eval". + + @author Gustaf Neumann + +} { + uplevel [list ns_mutex eval $mutex $script] +} + + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: + Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.149 -r1.150 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 25 Jan 2018 12:24:54 -0000 1.149 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 26 Feb 2018 19:07:07 -0000 1.150 @@ -1302,87 +1302,6 @@ return $ad_encoded_string } -if {[ns_info name] eq "NaviServer"} { - # - # NaviServer - # - ad_proc -public ad_urlencode_folder_path {path} { - Perform an urlencode operation on the segments of the provided - folder (for a full folder path rather than path segments as in - ad_urlencode_path). - @see ad_urlencode_path - } { - return [ns_urlencode -part path -- {*}[split $path /]] - } - - ad_proc -public ad_urlencode_path { string } { - Encode provided string with url-encoding for paths segments - (instead of query segments) as defined in RFC 3986 - } { - return [ns_urlencode -part path -- $string] - } - ad_proc -public ad_urldecode_path { string } { - Decode provided string with url-encoding for paths segments - (instead of query segments) as defined in RFC 3986 - } { - return [ns_urldecode -part path -- $string] - } - ad_proc -public ad_urlencode_query { string } { - Encode provided string with url-encoding for query segments - (instead of paths) as defined in RFC 3986 - } { - return [ns_urlencode -part query -- $string] - } - ad_proc -public ad_urldecode_query { string } { - Decode provided string with url-encoding for query segments - (instead of path segments) as defined in RFC 3986 - } { - return [ns_urldecode -part query -- $string] - } -} else { - # - # AOLserver - # - - ad_proc -public ad_urlencode_folder_path {path} { - Perform an urlencode operation on the segments of the provided - folder (for a full folder path rather than path segments as in - ad_urlencode_path). - @see ad_urlencode_path - } { - set segments {} - foreach segment [split $path /] { - lappend segments [ns_urlencode $segment] - } - return [join $segments /] - } - - ad_proc -public ad_urlencode_path { string } { - Encode provided string with url-encoding for path segments; - same as ad_urlencode, since AOLserver does not support this difference - } { - return [ad_urlencode $string] - } - ad_proc -public ad_urldecode_path { string } { - Decode provided string with url-encoding for path segments; - same as ns_urldecode, since AOLserver does not support this difference - } { - return [ns_urldecode $string] - } - ad_proc -public ad_urlencode_query { string } { - Encode provided string with url-encodingfor path segments; - same as ad_urlencode, since AOLserver does not support this difference - } { - return [ad_urlencode $string] - } - ad_proc -public ad_urldecode_query { string } { - Decode provided string with url-encoding for path segments; - same as ns_urldecode, since AOLserver does not support this difference - } { - return [ns_urldecode $string] - } -} - ad_proc -public ad_urlencode_url {url} { Perform an urlencode operation on a potentially full url (containing a location, but without query part). @@ -1403,317 +1322,10 @@ return $result } -if {[ns_info name] eq "NaviServer"} { - # - # Use NaviServer primitives - # - ad_proc -public ad_unset_cookie { - {-secure f} - {-domain ""} - {-path "/"} - name - } { - Un-sets a cookie. - - @see ad_get_cookie - @see ad_set_cookie - } { - ns_deletecookie -domain $domain -path $path -replace t -secure $secure -- $name - } - # - # Get Cookie - # - ad_proc -public ad_get_cookie { - { -include_set_cookies t } - name - { default "" } - } { - Returns the value of a cookie, or $default if none exists. - @see ad_set_cookie - @see ad_unset_cookie - } { - ns_getcookie -include_set_cookies $include_set_cookies -- $name $default - } - # - # Set Cookie - # - ad_proc -public ad_set_cookie { - {-replace f} - {-secure f} - {-expire f} - {-max_age ""} - {-domain ""} - {-path "/"} - {-discard f} - {-scriptable t} - name - {value ""} - } { - Sets a cookie. Cookies are name/value pairs stored in a client's - browser and are typically sent back to the server of origin with - each request. - @param max_age specifies the maximum age of the cookies in - seconds (consistent with RFC 2109). max_age "inf" specifies cookies - that never expire. The default behavior is to issue session - cookies. - - @param expire specifies whether we should expire (clear) the cookie. - Setting Max-Age to zero ought to do this, but it doesn't in some browsers - (tested on IE 6). - - @param path specifies a subset of URLs to which this cookie - applies. It must be a prefix of the URL being accessed. - - @param domain specifies the domain(s) to which this cookie - applies. See RFC2109 for the semantics of this cookie attribute. - - @param secure specifies to the user agent that the cookie should - only be transmitted back to the server of secure transport. - - @param replace forces the current output headers to be checked for - the same cookie. If the same cookie is set for a second time - without the replace option being specified, the client will - receive both copies of the cookie. - - @param discard instructs the user agent to discard the - cookie when when the user agent terminates. - - @param scriptable If the scriptable option is false or not - given the cookie is unavailable to javascript on the - client. This can prevent cross site scripting attacks (XSS) on - clients which support the HttpOnly option. Set -scriptable to - true if you need to access the cookie via javascript. For - compatibility reasons with earlier versions, OpenACS 5.8 has - the default set to "true". OpenACS 5.9 will have the flag per - default set to "false". - - @param value is autmatically URL encoded. - - @see ad_get_cookie - @see ad_unset_cookie - } { - - - if { $expire == "f"} { - set expire -1 - } elseif {$max_age ne ""} { - if {$max_age eq "inf"} { - set expire -1 - } else { - set expire [expr {[ns_time] + $max_age}] - } - } - - ns_setcookie -discard $discard -domain $domain -expires $expire -path $path \ - -replace $replace -scriptable $scriptable -secure $secure -- \ - $name $value - } - -} else { - # - # Use plain AOLserver - # - - # - # Unset Cookie - # - ad_proc -public ad_unset_cookie { - {-secure f} - {-domain ""} - {-path "/"} - name - } { - Un-sets a cookie. - - @see ad_get_cookie - @see ad_set_cookie - } { - ad_set_cookie -replace t -expire t -max_age 0 \ - -secure $secure -domain $domain -path $path \ - $name "" - } - - # - # Get Cookie - # - ad_proc -public ad_get_cookie { - { -include_set_cookies t } - name - { default "" } - } { - Returns the value of a cookie, or $default if none exists. - - @see ad_set_cookie - @see ad_unset_cookie - } { - - if { $include_set_cookies == "t" } { - set headers [ns_conn outputheaders] - set nr_headers [ns_set size $headers] - for { set i 0 } { $i < $nr_headers } { incr i } { - if { [string tolower [ns_set key $headers $i]] eq "set-cookie" - && [regexp "^$name=(\[^;\]*)" [ns_set value $headers $i] match value] - } { - return [ns_urldecode $value] - } - } - } - - set headers [ns_conn headers] - set cookie [ns_set iget $headers Cookie] - - if { [regexp " $name=(\[^;\]*)" " $cookie" match value] } { - - # If the cookie was set to a blank value we actually stored two quotes. We need - # to undo the kludge on the way out. - - if { $value eq "\"\"" } { - set value "" - } - return [ns_urldecode $value] - } - - return $default - } - - # - # Set Cookie - # - ad_proc -public ad_set_cookie { - {-replace f} - {-secure f} - {-expire f} - {-max_age ""} - {-domain ""} - {-path "/"} - {-discard f} - {-scriptable t} - name - {value ""} - } { - - Sets a cookie. Cookies are name/value pairs stored in a client's - browser and are typically sent back to the server of origin with - each request. - - @param max_age specifies the maximum age of the cookies in - seconds (consistent with RFC 2109). max_age "inf" specifies cookies - that never expire. The default behavior is to issue session - cookies. - - @param expire specifies whether we should expire (clear) the cookie. - Setting Max-Age to zero ought to do this, but it doesn't in some browsers - (tested on IE 6). - - @param path specifies a subset of URLs to which this cookie - applies. It must be a prefix of the URL being accessed. - - @param domain specifies the domain(s) to which this cookie - applies. See RFC2109 for the semantics of this cookie attribute. - - @param secure specifies to the user agent that the cookie should - only be transmitted back to the server of secure transport. - - @param replace forces the current output headers to be checked for - the same cookie. If the same cookie is set for a second time - without the replace option being specified, the client will - receive both copies of the cookie. - - @param discard instructs the user agent to discard the - cookie when when the user agent terminates. - - @param scriptable If the scriptable option is false or not - given the cookie is unavailable to javascript on the - client. This can prevent cross site scripting attacks (XSS) on - clients which support the HttpOnly option. Set -scriptable to - true if you need to access the cookie via javascript. For - compatibility reasons with earlier versions, OpenACS 5.8 has - the default set to "true". OpenACS 5.9 will have the flag per - default set to "false". - - @param value is autmatically URL encoded. - - @see ad_get_cookie - @see ad_unset_cookie - } { - set headers [ad_conn outputheaders] - if { $replace } { - # Try to find an already-set cookie named $name. - for { set i 0 } { $i < [ns_set size $headers] } { incr i } { - if { [string tolower [ns_set key $headers $i]] eq "set-cookie" - && [string match "$name=*" [ns_set value $headers $i]] - } { - ns_set delete $headers $i - } - } - } - - # need to set some value, so we put "" as the cookie value - if { $value eq "" } { - set cookie "$name=\"\"" - } else { - set cookie "$name=[ns_urlencode $value]" - } - - if { $path ne "" } { - append cookie "; Path=$path" - } - - if { $discard != "f" } { - append cookie "; Discard" - } elseif { $max_age eq "inf" } { - if { $expire == "f"} { - # - # netscape seemed unhappy with huge max-age, so we use - # expires which seems to work on both netscape and IE - # - append cookie "; Expires=Mon, 01-Jan-2035 01:00:00 GMT" - } - } elseif { $max_age ne "" } { - # - # We know $max_age is also not "inf" - # - append cookie "; Max-Age=$max_age" - if {$expire == "f"} { - # Reinforce Max-Age via "Expires", unless user required - # immediate expiration - set expire_time [util::cookietime [expr {[ns_time] + $max_age}]] - append cookie "; Expires=$expire_time" - } - } - - if {$expire != "f"} { - append cookie "; Expires=Tue, 01-Jan-1980 01:00:00 GMT" - } - - if { $domain ne "" } { - append cookie "; Domain=$domain" - } - - if { $secure == "t" } { - append cookie "; Secure" - } - - if { $scriptable == "f" } { - # Prevent access to this cookie via JavaScript - append cookie "; HttpOnly" - } - - ns_log Debug "OACS Set-Cookie: $cookie" - ns_set put $headers "Set-Cookie" $cookie - } - - -} - - - - - ad_proc -private ad_run_scheduled_proc { proc_info } { Runs a scheduled procedure and updates monitoring information in the shared variables. } { @@ -4246,46 +3858,6 @@ return [ns_job wait {*}$timeout $queue $j] } -# -# Provide a clean way of handling exceptions in mutexed regions -# (between locking and unlocking of an mutex). Should be used probably -# on more places in OpenACS. -# - -if {[ns_info name] eq "NaviServer"} { - ad_proc -public ad_mutex_eval {mutex script} { - - Compatibility proc for handling differences between NaviServer - and AOLserver since AOLserver does not support "ns_mutex - eval". - - @author Gustaf Neumann - - } { - uplevel [list ns_mutex eval $mutex $script] - } -} else { - ad_proc -public ad_mutex_eval {mutex script} { - - Compatibility proc for handling differences between NaviServer - and AOLserver since AOLserver does not support "ns_mutex - eval". - - @author Gustaf Neumann - - } { - ns_mutex lock $mutex - ad_try { - set result [uplevel $script] - } on error {errorMsg} { - error $errorMsg - } finally { - ns_mutex unlock $mutex - } - return $result - } -} - ad_proc ad_tmpnam {{template ""}} { A stub function to replace the deprecated "ns_tmpnam", which uses the deprecated C-library function "tmpnam()"