Index: openacs-4/packages/acs-tcl/tcl/00-acs-tcl-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-acs-tcl-init.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-tcl/tcl/00-acs-tcl-init.tcl 21 Feb 2022 20:27:00 -0000 1.1.2.1 +++ openacs-4/packages/acs-tcl/tcl/00-acs-tcl-init.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.2 @@ -6,4 +6,3 @@ set ::acs::kernel_id [ad_acs_kernel_id] ::acs::dc create_db_function_interface ;# -verbose ;# -match test.* - Index: openacs-4/packages/acs-tcl/tcl/acs-cache-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-cache-init.tcl,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/acs-tcl/tcl/acs-cache-init.tcl 14 May 2023 23:14:45 -0000 1.1.2.6 +++ openacs-4/packages/acs-tcl/tcl/acs-cache-init.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.7 @@ -1,5 +1,5 @@ # -# The acs::misc_cache is a potential successor of the util_memoize_cache, +# The acs::misc_cache is a potential successor of the util_memoize_cache, # but in a partitioned fashion to make it scalable. It should only be # used for situation, where not wild-card flushes are required. # Index: openacs-4/packages/acs-tcl/tcl/acs-container-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-container-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-tcl/tcl/acs-container-procs.tcl 11 Jul 2024 05:19:05 -0000 1.1.2.1 +++ openacs-4/packages/acs-tcl/tcl/acs-container-procs.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.2 @@ -59,7 +59,7 @@ # # ::acs::Container create acs::container # - + :public method active_p {} { # # Check, if we are running inside a Docker container Index: openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl,v diff -u -r1.29.2.30 -r1.29.2.31 --- openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 4 Jun 2024 12:20:27 -0000 1.29.2.30 +++ openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 28 Aug 2024 06:44:32 -0000 1.29.2.31 @@ -4271,7 +4271,101 @@ # return [util_memoize [list db_list db_type_keys {select db_type_key from apm_package_db_types}]] } +if {0} { + Procs for manipulating SQL statements + @author lars@pinds.com, May 2000 + @cvs-id $Id$ + + How to use this: + + You simply call ad_sql_append any number of times, then ad_sql_get to feed to the database. + What you gain from using these two procs is that the parts of the SQL statement will + always be output in the right sequence. + + + How this works: + + We represent a SQL statement as a Tcl array of the form + + stmt(select) { t1.column1 t2.column2 t2.column3 ... } join by , + stmt(from) { { table1 t1} {table2 t2} } join by , + stmt(where) { condition1 condition2 } join by and + stmt(groupby) { groupcol1 groupcol2 } join by , + stmt(orderby) { {ordercol1 asc} {ordercol2 desc}} join by , + + This is unused and untested code. +} + +ad_proc -deprecated -public ad_sql_get { + sqlarrayname +} { + @param sqlarrayname array reference + + @return a SQL statement constructed from the pieces provided via ad_sql_append + This is unused and untested code. + + @see ad_sql_append +} { + upvar $sqlarrayname sql + + if { ![info exists sql(select)] } { + error "SQL statement doesn't have any SELECT clause" + } + if { ![info exists sql(from)] } { + error "SQL statement doesn't have any FROM clause" + } + + set sql_string "select [join $sql(select) ", "]\nfrom [join $sql(from) ", "]\n" + + if { [info exists sql(where)] && [llength $sql(where)] > 0 } { + append sql_string "where [join $sql(where) "\nand "]\n" + } + + if { [info exists sql(groupby)] && [llength $sql(groupby)] > 0 } { + append sql_string "group by [join $sql(groupby) ", "]\n" + } + + if { [info exists sql(orderby)] && [llength $sql(orderby)] > 0 } { + append sql_string "order by [join $sql(orderby) ", "]\n" + } + + return $sql_string +} + +ad_proc -deprecated -public ad_sql_append { + {-select {}} + {-from {}} + {-where {}} + {-groupby {}} + {-orderby {}} + sqlarrayname +} { + Adds to the SQL statement. + + This is unused and untested code. + + @see plain SQL statements + trivial Tcl idioms +} { + upvar $sqlarrayname sql + if { $select ne "" } { + lappend sql(select) $select + } + if { $from ne "" } { + lappend sql(from) $from + } + if { $where ne "" } { + lappend sql(where) $where + } + if { $groupby ne "" } { + lappend sql(groupby) $groupby + } + if { $orderby ne "" } { + lappend sql(orderby) $orderby + } +} + + ######################################################################## # Functions based on undefined code ######################################################################## Index: openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl 28 Oct 2020 15:39:19 -0000 1.6.2.1 +++ openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl 28 Aug 2024 06:44:32 -0000 1.6.2.2 @@ -4,7 +4,7 @@ before we stub them out. This is done since the old ad_call_proc_if_exists - is somewhat expensive and these are called a lot in + is somewhat expensive and these are called a lot in every request. @author Jeff Davis Index: openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl,v diff -u -r1.21.2.2 -r1.21.2.3 --- openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl 11 Dec 2019 18:24:35 -0000 1.21.2.2 +++ openacs-4/packages/acs-tcl/tcl/html-email-procs.tcl 28 Aug 2024 06:44:32 -0000 1.21.2.3 @@ -34,7 +34,7 @@ } { Composes multipart/alternative email containing plain text and html versions of the message, parses out the headers we need, - constructs an array and returns it to the caller. + constructs an array and returns it to the caller. This proc is based on ad_html_sendmail, written by Doug Harris at the World Bank. @@ -51,7 +51,7 @@ # build body - ## JCD: I fail to see why you would want both a base64 and a quoted-printable + ## JCD: I fail to see why you would want both a base64 and a quoted-printable ## version of html part of this email. I am removing the base64 version. ## set base64_html_part [mime::initialize -canonical text/html -param [list charset $charset] -encoding base64 -string $html_body] set html_part [mime::initialize -canonical text/html \ @@ -150,7 +150,7 @@ # Expand any first-level multipart/alternative children. set expanded_parts [list] foreach part $parts { - catch {mime::getproperty $part content} this_content + catch {mime::getproperty $part content} this_content if { $this_content eq "multipart/alternative"} { foreach child_part [mime::getproperty $part parts] { lappend expanded_parts $child_part @@ -161,7 +161,7 @@ } foreach part $expanded_parts { - catch {mime::getproperty $part content} this_content + catch {mime::getproperty $part content} this_content switch -- $this_content { "text/plain" { if { ![info exists plain] } { Index: openacs-4/packages/acs-tcl/tcl/http-auth-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/http-auth-procs.tcl,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/acs-tcl/tcl/http-auth-procs.tcl 8 Oct 2019 16:28:28 -0000 1.4.2.2 +++ openacs-4/packages/acs-tcl/tcl/http-auth-procs.tcl 28 Aug 2024 06:44:32 -0000 1.4.2.3 @@ -1,4 +1,3 @@ -# packages/acs-tcl/tcl/http-auth-procs.tcl ad_library { Use OpenACS user logins for HTTP authentication } @@ -10,7 +9,7 @@ } { Implements decoding of authorization header as defined in RFC 7617 "username" containing a colon character is invalid (see RFC 7617, - Section 2). + Section 2). @param authorization content of "Authorization:" reply header field, such as e.g. "Basic 29234k3j49a" Index: openacs-4/packages/acs-tcl/tcl/json-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/json-procs.tcl,v diff -u -r1.11.2.10 -r1.11.2.11 --- openacs-4/packages/acs-tcl/tcl/json-procs.tcl 20 Aug 2024 06:59:12 -0000 1.11.2.10 +++ openacs-4/packages/acs-tcl/tcl/json-procs.tcl 28 Aug 2024 06:44:32 -0000 1.11.2.11 @@ -654,10 +654,10 @@ } ad_proc util::tdomDoc2dict {doc} { - + Helper proc for util::json2dict, which outputsreturns the provided tDOM document in the form of a Tcl dict. - + } { return [util::tdomNodes2dict [$doc childNodes] [$doc jsonType]] } Index: openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl,v diff -u -r1.18.2.5 -r1.18.2.6 --- openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 29 Dec 2022 12:54:06 -0000 1.18.2.5 +++ openacs-4/packages/acs-tcl/tcl/memoize-procs.tcl 28 Aug 2024 06:44:32 -0000 1.18.2.6 @@ -55,7 +55,7 @@ } -ad_proc -private util_memoize_flush_local {script} { +ad_proc -private util_memoize_flush_local {script} { Forget any cached value for script on the local server. You probably want to use util_memoize_flush to flush the caches on all servers in the cluster, in case clustering is Index: openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl,v diff -u -r1.4.2.5 -r1.4.2.6 --- openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl 26 Feb 2024 11:05:45 -0000 1.4.2.5 +++ openacs-4/packages/acs-tcl/tcl/pdf-procs.tcl 28 Aug 2024 06:44:32 -0000 1.4.2.6 @@ -27,7 +27,7 @@ @param set_var_call procedure-name which sets the variables used @return the pdf-file-name -} { +} { # create html.file set html_content [create_html_content -template_id $template_id -set_var_call $set_var_call] @@ -43,7 +43,7 @@ @param html_content HTML Content that is transformed into PDF @return filename of the pdf file } { - + set progname [parameter::get -parameter "HtmlDocBin" -default "htmldoc"] set htmldoc_bin [::util::which $progname] if {$htmldoc_bin eq ""} { @@ -63,7 +63,7 @@ if {[ad_file exists $tmp_pdf_filename]} { return $tmp_pdf_filename } - + } on error {errorMsg} { ns_log Error "Error during conversion from html to pdf: $errorMsg" } finally { Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -r1.141.2.47 -r1.141.2.48 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 25 Aug 2024 12:48:02 -0000 1.141.2.47 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 28 Aug 2024 06:44:32 -0000 1.141.2.48 @@ -806,7 +806,7 @@ # Caching ##################################################### variable createCache - + if {[namespace which ::ns_cache_names] ne ""} { set createCache [expr {"site_nodes_cache" ni [::ns_cache_names]}] } else { Fisheye: Tag 1.5.2.5 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/sql-statement-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/test/acs-db-00-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-db-00-procs.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/acs-tcl/tcl/test/acs-db-00-procs.tcl 29 Aug 2022 10:34:19 -0000 1.1.2.3 +++ openacs-4/packages/acs-tcl/tcl/test/acs-db-00-procs.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.4 @@ -40,4 +40,3 @@ # nsv_unset -nocomplain ::test::acs::dc # } # } - Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-apm-procs.tcl,v diff -u -r1.10.2.6 -r1.10.2.7 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-apm-procs.tcl 27 Feb 2021 20:19:34 -0000 1.10.2.6 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-apm-procs.tcl 28 Aug 2024 06:44:32 -0000 1.10.2.7 @@ -68,7 +68,7 @@ -cats {api smoke} \ -procs { apm_package_instance_new - + db_1row } \ test_apm_package_instance__new { Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.71.2.69 -r1.71.2.70 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 27 Aug 2024 13:55:05 -0000 1.71.2.69 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 28 Aug 2024 06:44:32 -0000 1.71.2.70 @@ -253,7 +253,7 @@ } \ xml_get_child_node_content_by_path { Test xml_get_child_node_content_by_path - } { + } { set tree [xml_parse -persist { @@ -294,7 +294,7 @@ [xml_get_child_node_content_by_path $root_node { { does not exist } { properties } { person name nickname } { person sourcedid id } }] "Superman" aa_equals "properties -> datetime" \ [xml_get_child_node_content_by_path $root_node { { person comments foo } { person name first_names } { properties datetime } }] "2001-08-08" - + $tree delete } @@ -514,7 +514,7 @@ dict set cases word {red 1 " " 0 "hello_world" 1 {$a} 0 a1 1

0 "a.b" 0 "-flag" 0 "1,2" 0 "r: -1" 0} dict set cases token {red 1 " " 1 "hello_world" 1 {$a} 0 a1 1

0 "a.b" 1 "-flag" 1 "1,2" 1 "r: -1" 1} - dict set cases safetclchars {red 1 " " 1 "hello world" 1 {$a} 0 a1 1

1 "a.b" 1 "-flag" 1 "1,2" 1 "r: -1" 1 {a[b]c} 0 x\\y 0} + dict set cases safetclchars {red 1 " " 1 "hello world" 1 {$a} 0 a1 1

1 "a.b" 1 "-flag" 1 "1,2" 1 "r: -1" 1 {a[b]c} 0 x\\y 0} dict set cases sql_identifier {red 1 " " 0 "hello_world" 1 {$a} 0 a1 1

0 "a.b" 0 "-flag" 0 "1,2" 0 "r: -1" 0} dict set cases email { {philip@mit.edu} 1 {Philip Greenspun } 0 } @@ -1499,7 +1499,7 @@ aa_equals "ad_decode $case $cases_complete return $result" "$result" [ad_decode $case {*}$cases_complete] } aa_equals "ad_decode gibberish $cases_complete return Unknown" "Unknown" [ad_decode gibberish {*}$cases_complete] - + aa_equals "ad_decode no default, found" [ad_decode b a 1 b 2] 2 aa_equals "ad_decode no default, not found" [ad_decode x a 1 b 2] "" aa_equals "ad_decode no default, no alternatives" [ad_decode x] "" Index: openacs-4/packages/acs-tcl/tcl/test/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/apm-install-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/acs-tcl/tcl/test/apm-install-procs.tcl 29 Aug 2022 10:34:19 -0000 1.1.2.2 +++ openacs-4/packages/acs-tcl/tcl/test/apm-install-procs.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.3 @@ -22,4 +22,3 @@ [llength $repo] 2 } } - Index: openacs-4/packages/acs-tcl/tcl/test/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/apm-procs.tcl,v diff -u -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/acs-tcl/tcl/test/apm-procs.tcl 25 Apr 2023 12:00:52 -0000 1.1.2.5 +++ openacs-4/packages/acs-tcl/tcl/test/apm-procs.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.6 @@ -71,7 +71,7 @@ } set package_id [apm_package_id_from_key acs-kernel] aa_true "Kernel package_id '$package_id' plausible " {$package_id > 0} - + set package_key [apm_package_key_from_id $package_id] aa_true "Kernel package_key '$package_key' plausible " {$package_key eq "acs-kernel"} } Index: openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl,v diff -u -r1.9.2.13 -r1.9.2.14 --- openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl 27 Aug 2024 12:13:41 -0000 1.9.2.13 +++ openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl 28 Aug 2024 06:44:32 -0000 1.9.2.14 @@ -308,7 +308,7 @@ -filename test.png \ -mime_type image/png \ -file $tmpfile] - + aa_equals "We can retrieve the portrait" \ [acs_user::get_portrait_id -user_id $user_id] $portrait_id Index: openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl,v diff -u -r1.20.2.16 -r1.20.2.17 --- openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 27 Aug 2024 13:21:23 -0000 1.20.2.16 +++ openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 28 Aug 2024 06:44:32 -0000 1.20.2.17 @@ -367,12 +367,12 @@ aa_log "result is

[ns_quotehtml $result]
" set nrBr [regsub -all
$result
.] aa_true "text contains some [ns_quotehtml
] tags" {$nrBr > 0} - + if {[::acs::icanuse "ns_parsehtml"]} { aa_true "text contains $nrBr [ns_quotehtml
] tags" {$nrBr == 2} } - + } @@ -614,12 +614,12 @@ aa_log "result is
[ns_quotehtml $result]
" set nrBr [regsub -all
$result
.] aa_true "text contains [ns_quotehtml
] tags" {$nrBr > 0} - + if {[::acs::icanuse "ns_parsehtml"]} { aa_true "text contains $nrBr [ns_quotehtml
] tags" {$nrBr == 1} } #aa_equals "new: $html _version should be the same" $html_version $string_with_img - + } @@ -637,7 +637,7 @@ aa_log "Original string is $string_with_img" set html_version [ad_enhanced_text_to_html $string_with_img] aa_equals "new: $html_version should be the same" $html_version $string_with_img - } + } aa_register_case \ -cats {api smoke} \ Index: openacs-4/packages/acs-tcl/tcl/test/resource-info-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/resource-info-procs.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-tcl/tcl/test/resource-info-procs.tcl 17 Aug 2024 17:07:30 -0000 1.1.2.1 +++ openacs-4/packages/acs-tcl/tcl/test/resource-info-procs.tcl 28 Aug 2024 06:44:32 -0000 1.1.2.2 @@ -15,11 +15,11 @@ cdn cdnHost configuredVersion - cssFiles + cssFiles extraFiles jsFiles parameterInfo - prefix + prefix resourceDir resourceName urnMap @@ -32,7 +32,7 @@ } foreach resource_info_proc [::util::resources::resource_info_procs] { set resource_info [$resource_info_proc] - foreach member $required_members { + foreach member $required_members { aa_true "$resource_info_proc resource_info contains $member" {$member in $required_members} } foreach key [dict keys $resource_info] { @@ -49,4 +49,3 @@ } } - Index: openacs-4/packages/acs-tcl/tcl/test/site-nodes-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/site-nodes-test-procs.tcl,v diff -u -r1.12.2.4 -r1.12.2.5 --- openacs-4/packages/acs-tcl/tcl/test/site-nodes-test-procs.tcl 27 Feb 2023 17:51:34 -0000 1.12.2.4 +++ openacs-4/packages/acs-tcl/tcl/test/site-nodes-test-procs.tcl 28 Aug 2024 06:44:32 -0000 1.12.2.5 @@ -17,7 +17,7 @@ site_node::init_cache site_node::instantiate_and_mount site_node::rename - site_node::unmount + site_node::unmount } \ site_node_update_cache { Test site_node::update_cache Index: openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl,v diff -u -r1.7.2.3 -r1.7.2.4 --- openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl 27 Feb 2023 17:23:06 -0000 1.7.2.3 +++ openacs-4/packages/acs-tcl/tcl/test/test-membership-rel-procs.tcl 28 Aug 2024 06:44:32 -0000 1.7.2.4 @@ -43,7 +43,7 @@ aa_equals "Changed State to aprroved" \ $member_state "approved" - + # Try to change his state to banned aa_log "We change the state to banned" membership_rel::ban -rel_id $rel_id