Index: openacs-4/contrib/obsolete-packages/bboard/www/message-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/message-edit-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/contrib/obsolete-packages/bboard/www/message-edit-2.tcl 28 Aug 2003 09:41:47 -0000 1.7 +++ openacs-4/contrib/obsolete-packages/bboard/www/message-edit-2.tcl 26 Feb 2005 17:52:19 -0000 1.8 @@ -21,7 +21,7 @@ } -validate { content_html -requires {content mime_type} { if [string eq $mime_type "text/html"] { - set complaint [ad_check_for_naughty_html $content] + set complaint [ad_html_security_check $content] if ![empty_string_p $complaint] { ad_complain $complaint return 0 Index: openacs-4/contrib/obsolete-packages/bboard/www/message-edit-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/bboard/www/message-edit-3.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/obsolete-packages/bboard/www/message-edit-3.tcl 28 Aug 2003 09:41:47 -0000 1.4 +++ openacs-4/contrib/obsolete-packages/bboard/www/message-edit-3.tcl 26 Feb 2005 17:52:19 -0000 1.5 @@ -22,7 +22,7 @@ } -validate { content_html -requires {content mime_type} { if [string eq $mime_type "text/html"] { - set complaint [ad_check_for_naughty_html $content] + set complaint [ad_html_security_check $content] if ![empty_string_p $complaint] { ad_complain $complaint } Index: openacs-4/contrib/obsolete-packages/library/www/admin/categories/index-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/library/www/admin/categories/index-template.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/library/www/admin/categories/index-template.tcl 2 Jul 2003 12:19:45 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/library/www/admin/categories/index-template.tcl 26 Feb 2005 17:52:19 -0000 1.2 @@ -4,7 +4,7 @@ set path_info index } -array set node [site_node "/categories"] +array set node [site_node::get -url "/categories"] ad_conn -set template_key $node(template_key) ad_return_template Index: openacs-4/contrib/obsolete-packages/library/www/groupadmin/index-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/library/www/groupadmin/index-template.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/library/www/groupadmin/index-template.tcl 2 Jul 2003 12:19:45 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/library/www/groupadmin/index-template.tcl 26 Feb 2005 17:52:19 -0000 1.2 @@ -22,7 +22,7 @@ set target $path_info } -array set node [site_node "/groupadmin"] +array set node [site_node::get -url "/groupadmin"] ad_conn -set template_key $node(template_key) ad_return_template Index: openacs-4/contrib/obsolete-packages/library/www/linking/index-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/library/www/linking/index-template.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/library/www/linking/index-template.tcl 2 Jul 2003 12:19:45 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/library/www/linking/index-template.tcl 26 Feb 2005 17:52:19 -0000 1.2 @@ -11,7 +11,7 @@ set path_info index } -array set node [site_node [bookmarks::get_global_instance_path]] +array set node [site_node::get -url [bookmarks::get_global_instance_path]] ad_conn -set template_key $node(template_key) if {[info exists pass]} { Index: openacs-4/contrib/packages/events/www/admin/order-history-date.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-date.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/events/www/admin/order-history-date.tcl 9 Mar 2003 12:08:22 -0000 1.1 +++ openacs-4/contrib/packages/events/www/admin/order-history-date.tcl 26 Feb 2005 17:52:19 -0000 1.2 @@ -73,7 +73,7 @@ set r_date $reg_date append whole_page "
This file has been locally added.\n" continue Index: openacs-4/packages/acs-admin/www/apm/version-generate-diffs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/Attic/version-generate-diffs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-admin/www/apm/version-generate-diffs.xql 27 Apr 2001 01:41:12 -0000 1.1 +++ openacs-4/packages/acs-admin/www/apm/version-generate-diffs.xql 26 Feb 2005 17:52:20 -0000 1.2 @@ -4,7 +4,7 @@
acs_user::delete -permanent
instead
- @see acs_user::delete
-} {
- acs_user::delete -user_id $user_id -permanent
-}
-
ad_proc -public person::new {
{-first_names:required}
Index: openacs-4/packages/acs-tcl/tcl/deprecated-utilities-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/deprecated-utilities-procs.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-tcl/tcl/deprecated-utilities-procs.tcl 28 Aug 2003 09:41:43 -0000 1.5
+++ openacs-4/packages/acs-tcl/tcl/deprecated-utilities-procs.tcl 26 Feb 2005 17:52:20 -0000 1.6
@@ -3,334 +3,15 @@
Provides a variety of non-ACS-specific utilities that have been
deprecated
+ Note the 5.2 deprecated procs have been moved to deprecated/5.2/acs-tcl
+
+
@author yon [yon@arsdigita.com]
@creation-date 9 Jul 2000
@cvs-id deprecated-utilities-procs.tcl,v 1.4 2002/09/24 19:34:53 jeffd Exp
}
-ad_proc -deprecated -warn nmc_IllustraDatetoPrettyDate {sql_date} {
- to be removed.
-} {
- regexp {(.*)-(.*)-(.*)$} $sql_date match year month day
-
- set allthemonths {January February March April May June July August September October November December}
-
- # we have to trim the leading zero because Tcl has such a
- # brain damaged model of numbers and decided that "09-1"
- # was "8.0"
-
- set trimmed_month [string trimleft $month 0]
- set pretty_month [lindex $allthemonths [expr $trimmed_month - 1]]
-
- return "$pretty_month $day, $year"
-
-}
-
-ad_proc -deprecated -warn util_prepare_update {table_name primary_key_name primary_key_value form} {
- to be removed.
-} {
-
- set form_size [ns_set size $form]
- set form_counter_i 0
- set column_list [db_columns $table_name]
- set bind_vars [ad_tcl_list_list_to_ns_set [list [list $primary_key_name $primary_key_value]]]
-
- while {$form_counter_i<$form_size} {
-
- set form_var_name [ns_set key $form $form_counter_i]
- set value [string trim [ns_set value $form $form_counter_i]]
-
- if { ($form_var_name != $primary_key_name) && ([lsearch $column_list $form_var_name] != -1) } {
-
- ad_tcl_list_list_to_ns_set -set_id $bind_vars [list [list $form_var_name $value]]
- lappend the_sets "$form_var_name = :$form_var_name"
-
- }
-
- incr form_counter_i
- }
-
- return [list "update $table_name\nset [join $the_sets ",\n"] \n where $primary_key_name = :$primary_key_name" $bind_vars]
-
-}
-
-ad_proc -deprecated -warn util_prepare_update_multi_key {table_name primary_key_name_list primary_key_value_list form} {
- to be removed.
-} {
-
- set form_size [ns_set size $form]
- set form_counter_i 0
- set bind_vars [ns_set create]
-
- while {$form_counter_i<$form_size} {
-
- set form_var_name [ns_set key $form $form_counter_i]
- set value [string trim [ns_set value $form $form_counter_i]]
-
- if { [lsearch -exact $primary_key_name_list $form_var_name] == -1 } {
-
- # this is not one of the keys
- ad_tcl_list_list_to_ns_set -set_id $bind_vars [list [list $form_var_name $value]]
- lappend the_sets "$form_var_name = :$form_var_name"
-
- }
-
- incr form_counter_i
- }
-
- for {set i 0} {$i<[llength $primary_key_name_list]} {incr i} {
-
- set this_key_name [lindex $primary_key_name_list $i]
- set this_key_value [lindex $primary_key_value_list $i]
-
- ad_tcl_list_list_to_ns_set -set_id $bind_vars [list [list $this_key_name $this_key_value]]
- lappend key_eqns "$this_key_name = :$this_key_name"
-
- }
-
- return [list "update $table_name\nset [join $the_sets ",\n"] \n where [join $key_eqns " AND "]" $bind_vars]
-}
-
-ad_proc -deprecated -warn util_prepare_insert {table_name form} {
- to be removed.
-} {
-
- set form_size [ns_set size $form]
- set form_counter_i 0
- set bind_vars [ns_set create]
-
- while { $form_counter_i < $form_size } {
-
- ns_set update $bind_vars [ns_set key $form $form_counter_i] [string trim [ns_set value $form $form_counter_i]]
- incr form_counter_i
-
- }
-
- return [list "insert into $table_name\n([join [ad_ns_set_keys $bind_vars] ", "])\n values ([join [ad_ns_set_keys -colon $bind_vars] ", "])" $bind_vars]
-}
-
-ad_proc -deprecated -warn util_PrettySex {m_or_f { default "default" }} {
- to be removed.
-} {
- if { $m_or_f == "M" || $m_or_f == "m" } {
- return "Male"
- } elseif { $m_or_f == "F" || $m_or_f == "f" } {
- return "Female"
- } else {
- # Note that we can't compare default to the empty string as in
- # many cases, we are going want the default to be the empty
- # string
- if { [string compare $default "default"] == 0 } {
- return "Unknown (\"$m_or_f\")"
- } else {
- return $default
- }
- }
-}
-
-ad_proc -deprecated -warn util_PrettySexManWoman {m_or_f { default "default"} } {
- to be removed.
-} {
- if { $m_or_f == "M" || $m_or_f == "m" } {
- return "Man"
- } elseif { $m_or_f == "F" || $m_or_f == "f" } {
- return "Woman"
- } else {
- # Note that we can't compare default to the empty string as in
- # many cases, we are going want the default to be the empty
- # string
- if { [string compare $default "default"] == 0 } {
- return "Person of Unknown Sex"
- } else {
- return $default
- }
- }
-}
-
-ad_proc -deprecated -warn merge_form_with_ns_set {form set_id} {
- to be removed.
-} {
-
- for {set i 0} {$i<[ns_set size $set_id]} {incr i} {
- set form [ns_formvalueput $form [ns_set key $set_id $i] [ns_set value $set_id $i]]
- }
-
- return $form
-
-}
-
-
-# Perform the dml statements in sql_list in a transaction.
-# Aborts the transaction and returns an error message if
-# an error occurred for any of the statements, otherwise
-# returns null string. -jsc
-ad_proc -deprecated -warn do_dml_transactions {dml_stmt_list} {
- to be removed.
-} {
- db_transaction {
- foreach dml_stmt $dml_stmt_list {
- if { [catch {db_dml $dml_stmt} errmsg] } {
- db_abort_transaction
- return $errmsg
- }
- }
- }
- return ""
-}
-
-
-# Perform body within a database transaction.
-# Execute on_error if there was some error caught
-# within body, with errmsg bound.
-# This procedure will clobber errmsg in the caller.
-# -jsc
-ad_proc -deprecated -warn with_transaction {body on_error} {
- to be removed.
-} {
- upvar errmsg errmsg
- global errorInfo errorCode
- if { [catch {db_transaction { uplevel $body }} errmsg] } {
- db_abort_transaction
- set code [catch {uplevel $on_error} string]
- # Return out of the caller appropriately.
- if { $code == 1 } {
- return -code error -errorinfo $errorInfo -errorcode $errorCode $string
- } elseif { $code == 2 } {
- return -code return $string
- } elseif { $code == 3 } {
- return -code break
- } elseif { $code == 4 } {
- return -code continue
- } elseif { $code > 4 } {
- return -code $code $string
- }
- }
-}
-
-
-ad_proc -deprecated -warn string_contains_p {small_string big_string} {
- Returns 1 if the BIG_STRING contains the SMALL_STRING, 0 otherwise; syntactic sugar for string first != -1
-
- to be removed.
-} {
- if { [string first $small_string $big_string] == -1 } {
- return 0
- } else {
- return 1
- }
-}
-
-ad_proc -deprecated -warn remove_whitespace {input_string} {
- to be removed.
-} {
- if { [regsub -all "\[\015\012\t \]" $input_string "" output_string] } {
- return $output_string
- } else {
- return $input_string
- }
-}
-
-ad_proc -deprecated -warn util_just_the_digits {input_string} {
- to be removed.
-} {
- if { [regsub -all {[^0-9]} $input_string "" output_string] } {
- return $output_string
- } else {
- return $input_string
- }
-}
-
-ad_proc -deprecated -warn leap_year_p {year} {
- to be removed.
-} {
- expr ( $year % 4 == 0 ) && ( ( $year % 100 != 0 ) || ( $year % 400 == 0 ) )
-}
-
-
-ad_proc -deprecated -warn set_csv_variables_after_query {} {
-
- You can call this after an ns_db getrow or ns_db 1row to set local
- Tcl variables to values from the database. You get $foo, $EQfoo
- (the same thing but with double quotes escaped), and $QEQQ
- (same thing as $EQfoo but with double quotes around the entire
- she-bang).
- - to be removed. -} { - uplevel { - set set_variables_after_query_i 0 - set set_variables_after_query_limit [ns_set size $selection] - while {$set_variables_after_query_i<$set_variables_after_query_limit} { - set [ns_set key $selection $set_variables_after_query_i] [ns_set value $selection $set_variables_after_query_i] - set EQ[ns_set key $selection $set_variables_after_query_i] [util_escape_quotes_for_csv [string trim [ns_set value $selection $set_variables_after_query_i]]] - set QEQQ[ns_set key $selection $set_variables_after_query_i] "\"[util_escape_quotes_for_csv [string trim [ns_set value $selection $set_variables_after_query_i]]]\"" - incr set_variables_after_query_i - } - } -} - -# should remove since openacs does not work on anything other than 3+ -# since it requires tcl8 -ad_proc -deprecated -warn util_aolserver_2_p {} { - to be removed. -} { - if {[string index [ns_info version] 0] == "2"} { - return 1 - } else { - return 0 - } -} - -ad_proc -deprecated -warn ad_chdir_and_exec { dir arg_list } { - chdirs to $dir and executes the command in $arg_list. We'll probably want to improve this to be thread-safe. - to be removed. -} { - cd $dir - eval exec $arg_list -} - -ad_proc -deprecated -warn post_args_to_query_string {} { - to be removed. -} { - set arg_form [ns_getform] - set query_return [list] - if {$arg_form!=""} { - - set form_counter_i 0 - while {$form_counter_i<[ns_set size $arg_form]} { - lappend query_return "[ns_set key $arg_form $form_counter_i]=[ns_urlencode [ns_set value $arg_form $form_counter_i]]" - incr form_counter_i - } - set query_return [join $query_return "&"] - } - return $query_return -} - - -ad_proc -deprecated -warn get_referrer_and_query_string {} { - to be removed. -} { - if {[ad_conn method]!="GET"} { - set query_return [post_args_to_query_string] - return "[get_referrer]?${query_return}" - } else { - return [get_referrer] - } -} - -ad_proc -deprecated -warn nmc_GetNewIDNumber {id_name} { - to be removed. -} { - - db_transaction { - db_dml id_number_update "update id_numbers set :id_name = :id_name + 1" - set id_number [db_string nmc_getnewidnumber "select unique :id_name from id_numbers"] - return $id_number - } - -} - # if you do a # set selection [ns_db 1row $db "select foo,bar from my_table where key=37"] # set_variables_after_query @@ -403,286 +84,3 @@ incr set_variables_after_query_i } } - -# takes a query like "select unique short_name from products where product_id = 45" -# and returns the result (only works when you are after a single row/column -# intersection) - -ad_proc -deprecated -warn database_to_tcl_string {db sql} { - to be removed. -} { - - set selection [ns_db 1row $db $sql] - - return [ns_set value $selection 0] - -} - -ad_proc -deprecated -warn database_to_tcl_string_or_null {db sql {null_value ""}} { - to be removed. -} { - set selection [ns_db 0or1row $db $sql] - if { $selection != "" } { - return [ns_set value $selection 0] - } else { - # didn't get anything from the database - return $null_value - } -} - -#for commands like set full_name ["select first_name, last_name..."] - -ad_proc -deprecated -warn database_cols_to_tcl_string {db sql} { - to be removed. -} { - set string_to_return "" - set selection [ns_db 1row $db $sql] - set size [ns_set size $selection] - set i 0 - while {$i<$size} { - append string_to_return " [ns_set value $selection $i]" - incr i - } - return [string trim $string_to_return] -} - -ad_proc -deprecated -warn database_to_tcl_list {db sql} { - takes a query like "select product_id from foobar" and returns all the ids as a Tcl list - - to be removed. -} { - set selection [ns_db select $db $sql] - set list_to_return [list] - while {[ns_db getrow $db $selection]} { - lappend list_to_return [ns_set value $selection 0] - } - return $list_to_return -} - -ad_proc -deprecated -warn database_to_tcl_list_list {db sql} { - Returns a list of Tcl lists, with each sublist containing the columns - returned by the database; if no rows are returned by the database, - returns the empty list (empty string in Tcl 7.x and 8.x) - - to be removed. -} { - set selection [ns_db select $db $sql] - set list_to_return [list] - while {[ns_db getrow $db $selection]} { - set row_list "" - set size [ns_set size $selection] - set i 0 - while {$i<$size} { - lappend row_list [ns_set value $selection $i] - incr i - } - lappend list_to_return $row_list - } - return $list_to_return -} - -ad_proc -deprecated -warn database_1row_to_tcl_list {db sql} { - Returns the column values from one row in the database as - a Tcl list. If there isn't exactly one row from this query, - throws an error. - - to be removed. -} { - set selection [ns_db 1row $db $sql] - set list_to_return [list] - set size [ns_set size $selection] - set counter 0 - while {$counter<$size} { - lappend list_to_return [ns_set value $selection $counter] - incr counter - } - return $list_to_return -} - -# Helper procedure for sortable_table. -# column_list is a list of column names optionally followed by " desc". -# Returns a new list with sort_column as the first element, followed -# by the columns in column_list excluding any beginning with sort_column. -ad_proc -deprecated -warn sortable_table_new_sort_order {column_list sort_column} { - to be removed. -} { - set new_order [list $sort_column] - - # Relies on string representation of lists. [lindex "colname desc" 0] - # returns just "colname". - set just_the_sort_column [lindex $sort_column 0] - foreach col $column_list { - if { [lindex $col 0] != $just_the_sort_column } { - lappend new_order $col - } - } - return $new_order -} - -ad_proc -deprecated -warn sortable_table {db select_string display_spec vars_to_export sort_var current_sort_order {table_length ""} {extra_table_parameters ""} {stripe_color_list ""} {max_results ""} {header_font_params ""} {row_font_params ""}} { - to be removed. -
-Procedure to format a database query as a table that can be sorted by clicking on the headers. -Arguments are: -
" - } else { - append headers " | " - } - - append headers "$column_header$sort_icon | " - - } - - append headers "
---|
-Current syntax: - - ad_page_variables {var_spec1 [varspec2] ... } - - This proc handles translating form inputs into Tcl variables, and checking - to see that the correct set of inputs was supplied. Note that this is mostly a - check on the proper programming of a set of pages. - -Here are the recognized var_specs: - - variable ; means it's required - {variable default-value} - Optional, with default value. If the value is supplied but is null, and the - default-value is present, that value is used. - {variable -multiple-list} - The value of the Tcl variable will be a list containing all of the - values (in order) supplied for that form variable. Particularly useful - for collecting checkboxes or select multiples. - Note that if required or optional variables are specified more than once, the - first (leftmost) value is used, and the rest are ignored. - {variable -array} - This syntax supports the idiom of supplying multiple form variables of the - same name but ending with a "_[0-9]", e.g., foo_1, foo_2.... Each value will be - stored in the array variable variable with the index being whatever follows the - underscore. - -QQ variables are automatically created by ad_page_variables. - -Other elements of the var_spec are ignored, so a documentation string -describing the variable can be supplied. - -Note that the default value form will become the value form in a "set" - -Note that the default values are filled in from left to right, and can depend on -values of variables to their left: -ad_page_variables { - file - {start 0} - {end {[expr $start + 20]}} -} -- @see ad_page_contract -} { - set exception_list [list] - set form [ns_getform] - if { $form != "" } { - set form_size [ns_set size $form] - set form_counter_i 0 - - # first pass -- go through all the variables supplied in the form - while {$form_counter_i<$form_size} { - set variable [ns_set key $form $form_counter_i] - set value [ns_set value $form $form_counter_i] - check_for_form_variable_naughtiness $variable $value - set found "not" - # find the matching variable spec, if any - foreach variable_spec $variable_specs { - if { [llength $variable_spec] >= 2 } { - switch -- [lindex $variable_spec 1] { - -multiple-list { - if { [lindex $variable_spec 0] == $variable } { - # variable gets a list of all the values - upvar 1 $variable var - lappend var $value - set found "done" - break - } - } - -array { - set varname [lindex $variable_spec 0] - set pattern "($varname)_(.+)" - if { [regexp $pattern $variable match array index] } { - if { ![empty_string_p $array] } { - upvar 1 $array arr - set arr($index) [ns_set value $form $form_counter_i] - } - set found "done" - break - } - } - default { - if { [lindex $variable_spec 0] == $variable } { - set found "set" - break - } - } - } - } elseif { $variable_spec == $variable } { - set found "set" - break - } - } - if { $found == "set" } { - upvar 1 $variable var - if { ![info exists var] } { - # take the leftmost value, if there are multiple ones - set var $value - } - } - incr form_counter_i - } - } - - # now make a pass over each variable spec, making sure everything required is there - # and doing defaulting for unsupplied things that aren't required - foreach variable_spec $variable_specs { - set variable [lindex $variable_spec 0] - upvar 1 $variable var - - if { [llength $variable_spec] >= 2 } { - if { ![info exists var] } { - set default_value_or_flag [lindex $variable_spec 1] - - switch -- $default_value_or_flag { - -array { - # don't set anything - } - -multiple-list { - set var [list] - } - default { - # Needs to be set. - uplevel [list eval set $variable "\[subst [list $default_value_or_flag]\]"] - # This used to be: - # - # uplevel [list eval [list set $variable "$default_value_or_flag"]] - # - # But it wasn't properly performing substitutions. - } - } - } - - # no longer needed because we QQ everything by default now - # # if there is a QQ or qq or any variant after the var_spec, - # # make a "QQ" variable - # if { [regexp {^[Qq][Qq]$} [lindex $variable_spec 2]] && [info exists var] } { - # upvar QQ$variable QQvar - # set QQvar [DoubleApos $var] - # } - - } else { - if { ![info exists var] } { - lappend exception_list "\"$variable\" required but not supplied" - } - } - - # modified by rhs@mit.edu on 1/31/2000 - # to QQ everything by default (but not arrays) - if {[info exists var] && ![array exists var]} { - upvar QQ$variable QQvar - set QQvar [DoubleApos $var] - } - - } - - set n_exceptions [llength $exception_list] - # this is an error in the HTML form - if { $n_exceptions == 1 } { - ns_returnerror 500 [lindex $exception_list 0] - return -code return - } elseif { $n_exceptions > 1 } { - ns_returnerror 500 "
- This proc allows page arg, etc. validation. It accepts a bunch of - code blocks. Each one is executed, and any error signalled is - appended to the list of exceptions. - Note that you can customize the complaint page to match the design of your site, - by changing the proc called to do the complaining: - it's [ad_parameter ComplainProc "" ad_return_complaint] - - The division of labor between ad_page_variables and page_validation - is that ad_page_variables - handles programming errors, and does simple defaulting, so that the rest of - the Tcl code doesn't have to worry about testing [info exists ...] everywhere. - page_validation checks for errors in user input. For virtually all such tests, - there is no distinction between "unsupplied" and "null string input". - - Note that errors are signalled using the Tcl "error" function. This allows - nesting of procs which do the validation tests. In addition, validation - functions can return useful values, such as trimmed or otherwise munged - versions of the input. - - @see ad_page_contract -} { - if { [info exists {%%exception_list}] } { - error "Something's wrong" - } - # have to put this in the caller's frame, so that sub_page_validation can see it - # that's because the "uplevel" used to evaluate the code blocks hides this frame - upvar {%%exception_list} {%%exception_list} - set {%%exception_list} [list] - foreach validation_block $args { - if { [catch {uplevel $validation_block} errmsg] } { - lappend {%%exception_list} $errmsg - } - } - set exception_list ${%%exception_list} - unset {%%exception_list} - set n_exceptions [llength $exception_list] - if { $n_exceptions != 0 } { - set complain_proc [ad_parameter ComplainProc "" ad_return_complaint] - if { $n_exceptions == 1 } { - $complain_proc $n_exceptions [lindex $exception_list 0] - } else { - $complain_proc $n_exceptions "
- Use this inside a page_validation block which needs to check more than one thing. - Put this around each part that might signal an error. - - @see ad_page_contract -} { - # to allow this to be at any level, we search up the stack for {%%exception_list} - set depth [info level] - for {set level 1} {$level <= $depth} {incr level} { - upvar $level {%%exception_list} {%%exception_list} - if { [info exists {%%exception_list}] } { - break - } - } - if { ![info exists {%%exception_list}] } { - error "sub_page_validation not inside page_validation" - } - foreach validation_block $args { - if { [catch {uplevel $validation_block} errmsg] } { - lappend {%%exception_list} $errmsg - } - } -} - ad_proc -deprecated validate_integer {field_name string} { Throws an error if the string isn't a decimal integer; otherwise strips any leading zeros (so this won't work for octals) and returns @@ -2126,45 +1732,7 @@ } -ad_proc -deprecated -warn ReturnHeadersNoCache {{content_type text/html}} { - Deprecated. just set [ad_conn outputheaders]. - @see ad_conn -} { - ns_write "HTTP/1.0 200 OK -MIME-Version: 1.0 -Content-Type: $content_type -pragma: no-cache\r\n" - - ns_startcontent -type $content_type -} - -ad_proc -deprecated -warn ReturnHeadersWithCookie {cookie_content {content_type text/html}} { - Deprecated. just set [ad_conn outputheaders]. - @see ad_conn -} { - ns_write "HTTP/1.0 200 OK -MIME-Version: 1.0 -Content-Type: $content_type -Set-Cookie: $cookie_content\r\n" - - ns_startcontent -type $content_type -} - -ad_proc -deprecated -warn ReturnHeadersWithCookieNoCache {cookie_content {content_type text/html}} { - Deprecated. just set [ad_conn outputheaders]. - @see ad_conn -} { - - ns_write "HTTP/1.0 200 OK -MIME-Version: 1.0 -Content-Type: $content_type -Set-Cookie: $cookie_content -pragma: no-cache\r\n" - - ns_startcontent -type $content_type -} - ad_proc -public ad_return_top_of_page {first_part_of_page {content_type text/html}} { Returns HTTP headers plus the top of the user-visible page. Saves a TCP packet (and therefore some overhead) compared to using @@ -3420,34 +2988,6 @@ return $max } -ad_proc -deprecated -warn ad_check_for_naughty_html {user_submitted_html} { - -This proc is deprecated. Please use ad_html_security_check -instead. - -
- -Returns a human-readable explanation if the user has used any of the -HTML tags marked as naughty in the antispam section of ad.ini, otherwise -returns an empty string. - -@see ad_html_security_check -} { - - set tag_names [list div font] - # look for a less than sign, zero or more spaces, then the tag - if { ! [empty_string_p $tag_names]} { - if { [regexp "< *([join $tag_names "\[ \n\t\r\f\]|"]\[ \n\t\r\f\])" [string tolower $user_submitted_html]] } { - return "
For security reasons we do not accept the submission of any HTML - containing the following tags:
[join $tag_names " "]
"
- }
- }
-
- # HTML was okay as far as we know
- return ""
-}
-
# usage:
# suppose the variable is called "expiration_date"
# put "[ad_dateentrywidget expiration_date]" in your form
@@ -3469,11 +3009,6 @@
return [ns_dbformvalueput $output $column date $default_date]
}
-ad_proc -deprecated -warn ad_dateentrywidget_default_to_today {column} {
- set today [lindex [split [ns_localsqltimestamp] " "] 0]
- return [ad_dateentrywidget $column $today]
-}
-
ad_proc -public util_ns_set_to_list {
{-set:required}
} {
Index: openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 2 Mar 2004 15:41:11 -0000 1.15
+++ openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 26 Feb 2005 17:52:21 -0000 1.16
@@ -169,9 +169,3 @@
}
}
-ad_proc -public -deprecated -warn ad_template_return {{file_stub ""}} {
- Alias proc (wrapper) for ad_return_template
-} {
- uplevel 1 "ad_return_template $file_stub"
-}
-
Index: openacs-4/packages/acs-templating/tcl/paginator-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/paginator-procs.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 24 Feb 2005 13:33:02 -0000 1.15
+++ openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 26 Feb 2005 17:52:21 -0000 1.16
@@ -100,7 +100,7 @@
if { ([string equal $row_ids {}] && ![nsv_exists __template_cache_timeout $cache_key]) || ([info exists opts(flush_p)] && [string equal $opts(flush_p) "t"]) } {
if { [info exists opts(printing_prefs)] && ![empty_string_p $opts(printing_prefs)] } {
- ReturnHeadersNoCache "text/html"
+ ReturnHeaders "text/html"
ns_write "
"
Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v
diff -u -r1.189 -r1.190
--- openacs-4/packages/dotlrn/tcl/community-procs.tcl 13 Jan 2005 13:57:20 -0000 1.189
+++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 26 Feb 2005 17:52:21 -0000 1.190
@@ -93,11 +93,11 @@
db_transaction {
set community_type_key [db_exec_plsql create_community_type {}]
- set package_id [site_node_apm_integration::new_site_node_and_package \
- -name [ad_decode $url_part "" $community_type_key $url_part] \
- -parent_id $parent_node_id \
+ set package_id [site_node::instantiate_and_mount \
+ -node_name [ad_decode $url_part "" $community_type_key $url_part] \
+ -parent_node_id $parent_node_id \
-package_key [one_community_type_package_key] \
- -instance_name $pretty_name \
+ -package_name $pretty_name \
-context_id $parent_node(object_id) \
]
@@ -1809,11 +1809,11 @@
set parent_node_id [get_type_node_id $community_type]
}
- set package_id [site_node_apm_integration::new_site_node_and_package \
- -name $key \
- -parent_id $parent_node_id \
+ set package_id [site_node::instantiate_and_mount \
+ -node_name $key \
+ -parent_node_id $parent_node_id \
-package_key [one_community_package_key] \
- -instance_name $pretty_name \
+ -package_name $pretty_name \
-context_id $clone_id \
]
Index: openacs-4/packages/dotlrn/tcl/zz-dotlrn-postload-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/zz-dotlrn-postload-init.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn/tcl/zz-dotlrn-postload-init.tcl 4 Dec 2002 09:51:04 -0000 1.2
+++ openacs-4/packages/dotlrn/tcl/zz-dotlrn-postload-init.tcl 26 Feb 2005 17:52:21 -0000 1.3
@@ -1,3 +1,3 @@
-#if { [ad_ssl_available_p] } {
+#if { [security::https_available_p] } {
# ad_register_filter preauth GET "[dotlrn::get_url]/admin/*" ad_restrict_to_https
#}
\ No newline at end of file
Index: openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl 13 Jan 2005 13:57:56 -0000 1.8
+++ openacs-4/packages/ecommerce/tcl/ecommerce-ssl-procs.tcl 26 Feb 2005 17:52:21 -0000 1.9
@@ -159,7 +159,7 @@
# made this simpler by relying on ad_secure_conn_p
if {![ad_secure_conn_p]} {
# see if ssl is installed
- # replaced ad_ssl_available_p with ec_ssl_available_p
+ # replaced security::https_available_p with ec_ssl_available_p
# which detects nsopenssl
if { ![ec_ssl_available_p] } {
# there's no ssl
@@ -279,7 +279,7 @@
} {
- if {![ad_ssl_available_p]} {
+ if {![security::https_available_p]} {
# we don't have ssl installed, so return the original URL
return $new_page
}
@@ -313,7 +313,7 @@
insecure page
} {
- if {![ad_ssl_available_p]} {
+ if {![security::https_available_p]} {
# we don't have ssl installed, so return the original URL
return $new_page
}
Index: openacs-4/packages/edit-this-page/tcl/etp-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/tcl/etp-procs.tcl,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 13 Jan 2005 13:58:04 -0000 1.18
+++ openacs-4/packages/edit-this-page/tcl/etp-procs.tcl 26 Feb 2005 17:52:21 -0000 1.19
@@ -501,7 +501,7 @@
} {
set url_stub [ns_conn url]
- array set site_node [site_node $url_stub]
+ array set site_node [site_node::get -url $url_stub]
set urlc [regexp -all "/" $url_stub]
if { ($site_node(package_key) == "edit-this-page" ||
$site_node(package_key) == "acs-subsite") &&
Index: openacs-4/packages/edit-this-page/www/etp-install-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-install-portlet.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/edit-this-page/www/etp-install-portlet.tcl 13 Jan 2005 13:58:04 -0000 1.2
+++ openacs-4/packages/edit-this-page/www/etp-install-portlet.tcl 26 Feb 2005 17:52:21 -0000 1.3
@@ -37,7 +37,7 @@
set name [db_string site_node_name ""]
set parent_url [file dirname $site_node_url]
set name "$name $package_id"
- array set parent_site_node [site_node $parent_url]
+ array set parent_site_node [site_node::get -url $parent_url]
set parent_package_id $parent_site_node(object_id)
db_transaction {
set folder_id [db_exec_plsql create_folder ""]
Index: openacs-4/packages/edit-this-page/www/etp-setup-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-setup-2.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/edit-this-page/www/etp-setup-2.tcl 9 Jan 2004 01:53:13 -0000 1.2
+++ openacs-4/packages/edit-this-page/www/etp-setup-2.tcl 26 Feb 2005 17:52:21 -0000 1.3
@@ -30,7 +30,7 @@
set name [db_string site_node_name ""]
set parent_url [file dirname $site_node_url]
- array set parent_site_node [site_node $parent_url]
+ array set parent_site_node [site_node::get -url $parent_url]
set parent_package_id $parent_site_node(object_id)
# set parent_package_id [site_node_closest_ancestor_package -url "$parent_url" "edit-this-page"]
Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl,v
diff -u -r1.22 -r1.23
--- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl 23 Feb 2005 15:28:57 -0000 1.22
+++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl 26 Feb 2005 17:52:21 -0000 1.23
@@ -101,7 +101,7 @@
the default blog.adp).
} {
if { ![exists_and_not_null package_id] } {
- array set blog_site_node [site_node $url]
+ array set blog_site_node [site_node::get -url $url]
set package_id $blog_site_node(object_id)
}
set create_p [ad_permission_p $package_id create]
Index: openacs-4/packages/lars-blogger/www/blog.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog.tcl,v
diff -u -r1.24 -r1.25
--- openacs-4/packages/lars-blogger/www/blog.tcl 13 Jan 2005 13:58:22 -0000 1.24
+++ openacs-4/packages/lars-blogger/www/blog.tcl 26 Feb 2005 17:52:22 -0000 1.25
@@ -15,7 +15,7 @@
# If the caller specified a URL, then we gather the package_id from that URL
if { [info exists url] } {
- array set blog_site_node [site_node $url]
+ array set blog_site_node [site_node::get -url $url]
set package_id $blog_site_node(object_id)
}
Index: openacs-4/packages/monitoring/www/monitor.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/monitor.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/monitoring/www/monitor.tcl 19 Aug 2002 23:10:28 -0000 1.2
+++ openacs-4/packages/monitoring/www/monitor.tcl 26 Feb 2005 17:52:22 -0000 1.3
@@ -37,32 +37,6 @@
"
-if [util_aolserver_2_p] {
- append whole_page "
-AOLserver says that the max number of threads spawned since server
-startup is [ns_totalstats HWM-threads]. The max threads since the
-last interval reset (every 5 minutes or so by default):
-[ns_intervalstats HWM-threads]. This final number is probably the
-best estimate of current server activity.
-
--" -} - -if [util_aolserver_2_p] { - # run standard Unix uptime command to get load average (crude measure of - # system health) - set uptime_output [exec /usr/bin/uptime] - append whole_page " - -Here's what uptime has to say about the box: - -
-$uptime_output --" -} - append whole_page "