Index: openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl,v diff -u -r1.52 -r1.53 --- openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 29 Dec 2017 11:13:40 -0000 1.52 +++ openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 29 Dec 2017 11:17:34 -0000 1.53 @@ -5,16 +5,16 @@ Routines for importing/exporting messages from/to XML message catalog files. Every OpenACS package has one message catalog file for each locale (language and region) that its UI supports. Importing of messages means reading the messages - from XML catalog files and storing them in the database. Exporting of messages refers to the opposite process. + from XML catalog files and storing them in the database. Exporting of messages refers to the opposite process. The key procedures in this library are:

@@ -38,15 +38,15 @@ ad_proc -private lang::catalog::default_charset_if_unsupported { charset } { Will return the system default charset and issue a warning in the log file if the given charset is not supported by tcl. Otherwise - the given charset is simply returned. + the given charset is simply returned. @author Jeff Davis @author Peter Marklund (peter@collaboraid.biz) } { set ns_charsets [concat [ns_charsets] [encoding names]] # Do case insensitive matching - if {[lsearch -regexp $ns_charsets "(?i)^${charset}\$"] < 0} { - #set default_charset [encoding system] + if {[lsearch -regexp $ns_charsets "(?i)^${charset}\$"] < 0} { + #set default_charset [encoding system] # LARS: Default to utf-8 set default_charset utf-8 ns_log Warning "charset $charset not supported by tcl, assuming $default_charset" @@ -82,7 +82,7 @@ } { return [db_list_of_lists get_messages {}] } - + ad_proc -private lang::catalog::package_catalog_dir { package_key } { Return the catalog directory of the given package. @@ -93,7 +93,7 @@ } ad_proc -private lang::catalog::is_upgrade_backup_file { file_path } { - Given a file path return 1 if the path represents a + Given a file path return 1 if the path represents a file with messages backed up from message catalog upgrade. @author Peter Marklund @@ -151,14 +151,14 @@ } on error {errorMsg} { set has_file_in_locale_p 0 } - + return $has_file_in_locale_p } -ad_proc -private lang::catalog::get_catalog_file_path { +ad_proc -private lang::catalog::get_catalog_file_path { {-backup_from_version ""} {-backup_to_version ""} - {-package_key:required} + {-package_key:required} {-locale:required} {-charset ""} } { @@ -194,7 +194,7 @@ set filename "${message_backup_prefix}${package_key}.${locale}.${file_charset}.xml" set file_path "[package_catalog_dir $package_key]/$filename" - + return $file_path } @@ -246,9 +246,9 @@ {-package_key:required} {-locale:required} } { - For a certain package, and locale, return the messages in + For a certain package, and locale, return the messages in the database the last time catalog files and db were in sync. - This is the message that we use as merge base during message catalog + This is the message that we use as merge base during message catalog upgrades. @return An array list with message keys as keys and messages as @@ -267,7 +267,7 @@ } ad_proc -private lang::catalog::uninitialized_packages {} { - Return a list of keys for installed and enabled packages + Return a list of keys for installed and enabled packages that do not have any message keys associated with them. This would suggest that either the package is not internationalized, or we have not yet imported the message keys for the package. @@ -283,18 +283,18 @@ # ################## -ad_proc -private lang::catalog::export_to_file { +ad_proc -private lang::catalog::export_to_file { {-descriptions_list ""} - file_path - messages_list + file_path + messages_list } { - Export messages for a certain locale and package from the database + Export messages for a certain locale and package from the database to a given XML catalog file. If the catalog file already exists it will be backed up to a file with the same name but the extension .orig added to it. If there is an old backup file no new backup is done. - + @param file_path The path of the catalog file to write messages to. The filename needs to be parseable by apm_parse_catalog_path. The file and the catalog directory will be created if they don't exist. @@ -306,7 +306,7 @@ } { # Extract package_key, locale, and charset from the file path array set filename_info [apm_parse_catalog_path $file_path] - + # Check that the filename is parsable. We are not requiring any particular directory though if { [array size filename_info] == 0 } { error "Could not parse package_key, locale, and charset from filename of file $file_path" @@ -331,7 +331,7 @@ if { [file exists $file_path] } { ns_log Notice "Creating backup catalog file $backup_path" file copy -force -- $file_path $backup_path - } + } # Since the output charset, and thus the filename, may have changed since # last time that we wrote the catalog file we remove old files with the same locale @@ -367,7 +367,7 @@ # Close the root node and close the file puts $catalog_file_id "" - close $catalog_file_id + close $catalog_file_id ns_log Notice "Wrote $message_count messages to file $file_path with encoding $file_encoding" } @@ -392,35 +392,35 @@ } foreach package_key $package_key_list { - # We do not want to export acs-translations. This usually is a very bad idea as the object_ids are different from site to site. - if {$package_key ne "acs-translations" } { - # Loop over all locales that the package has messages in - # and write a catalog file for each such locale - db_foreach get_locales_for_package {} { - # If we are only exporting certain locales and this is not one of them - continue - if { [llength $locales] > 0 && $locale ni $locales } { - continue - } - - # Get messages and descriptions for the locale - set messages_list [list] - set descriptions_list [list] - foreach message_tuple [all_messages_for_package_and_locale $package_key $locale] { + # We do not want to export acs-translations. This usually is a very bad idea as the object_ids are different from site to site. + if {$package_key ne "acs-translations" } { + # Loop over all locales that the package has messages in + # and write a catalog file for each such locale + db_foreach get_locales_for_package {} { + # If we are only exporting certain locales and this is not one of them - continue + if { [llength $locales] > 0 && $locale ni $locales } { + continue + } + + # Get messages and descriptions for the locale + set messages_list [list] + set descriptions_list [list] + foreach message_tuple [all_messages_for_package_and_locale $package_key $locale] { lassign $message_tuple message_key message description - lappend messages_list $message_key $message - lappend descriptions_list $message_key $description - } + lappend messages_list $message_key $message + lappend descriptions_list $message_key $description + } - set catalog_file_path [get_catalog_file_path \ - -package_key $package_key \ - -locale $locale] - - export_to_file -descriptions_list $descriptions_list $catalog_file_path $messages_list - - # Messages exported to file are in sync with file - db_dml update_sync_time {} - } - } + set catalog_file_path [get_catalog_file_path \ + -package_key $package_key \ + -locale $locale] + + export_to_file -descriptions_list $descriptions_list $catalog_file_path $messages_list + + # Messages exported to file are in sync with file + db_dml update_sync_time {} + } + } } } @@ -433,9 +433,9 @@ ad_proc -private lang::catalog::read_file { catalog_filename } { Returns the contents of the given catalog file as a string reading the file with the charset given in the filename. - + @param catalog_file_name The full path of the catalog file to read. - The basename of the file should be on the form + The basename of the file should be on the form package_key.locale.charset.ending where ending is either cat or xml (i.e. dotlrn.en_US.iso-8859-1.xml or dotlrn.en_US.iso-8859-1.cat). The cat ending @@ -444,18 +444,18 @@ @author Jeff Davis @author Peter Marklund (peter@collaboraid.biz) } { - if {![regexp {/([^/]*)\.([^/]*)\.(?:xml|cat)$} $catalog_filename match base msg_encoding]} { - ns_log Warning "Charset info missing in filename assuming $catalog_filename is iso-8859-1" + if {![regexp {/([^/]*)\.([^/]*)\.(?:xml|cat)$} $catalog_filename match base msg_encoding]} { + ns_log Warning "Charset info missing in filename assuming $catalog_filename is iso-8859-1" set msg_encoding iso-8859-1 } - + set msg_encoding [default_charset_if_unsupported $msg_encoding] ns_log Notice "reading $catalog_filename in $msg_encoding" set in [open $catalog_filename] fconfigure $in -encoding [ns_encodingforcharset $msg_encoding] - set catalog_file_contents [read $in] - close $in + set catalog_file_contents [read $in] + close $in return $catalog_file_contents } @@ -474,7 +474,7 @@ @author Peter Marklund (peter@collaboraid.biz) @author Simon Carstensen (simon@collaboraid.biz) -} { +} { # Check arguments if { $catalog_file_contents eq "" } { @@ -535,11 +535,11 @@ return [array get msg_catalog_array] } -ad_proc -private lang::catalog::import_from_file { +ad_proc -private lang::catalog::import_from_file { file_path } {

- Import messages for a certain locale and package from a given XML + Import messages for a certain locale and package from a given XML catalog file to the database. This procedure invokes lang::catalog::parse to read the catalog file and lang::message::register to register the messages with the system (updates database and cache). @@ -555,14 +555,14 @@ @param file_path The absolute path of the XML file to import messages from. The path must be on valid format, see apm_is_catalog_file - @return An array list containing the number of messages processed, number of messages added, + @return An array list containing the number of messages processed, number of messages added, number of messages updated, and the number of messages deleted by the import. The keys of the array list are processed, added, updated, and deleted. @see lang::catalog::parse @see lang::message::register @see lang::catalog::import_messages - + @author Peter Marklund } { # Check arguments @@ -625,7 +625,7 @@ Import a given set of messages from a catalog file to the database for a certain package and locale. If we already have messages in the db for the given package and locale then a merge - between the database messages and the file messages will be performed. + between the database messages and the file messages will be performed.

@@ -649,13 +649,13 @@

What follows below is a description of the logic of the proc in terms of its input, the cases considered, and the logical actions taken for each case. -

+

- There are three sets of keys, file, db, and base keys. For each key in + There are three sets of keys, file, db, and base keys. For each key in the union of these keys there are three messages that can exist: the file message, the db message, and the base message. The base message serves as the base for the merge. We will distinguish all the different permutations - of each of the three messages existing or not, and all permutations of the messages being different from eachother. + of each of the three messages existing or not, and all permutations of the messages being different from eachother. We don't distinguish how two messages are different, only whether they are different or not. In total that gives us 14 cases (permutations) to consider.

@@ -696,15 +696,15 @@ 14. All different. upgrade_action=update, conflict_p=t - @param file_messages_list An array list with message keys as keys and - the message of those keys as values, + @param file_messages_list An array list with message keys as keys and + the message of those keys as values, i.e. (key, value, key, value, ...) @param package_key The package_key for the messages. @param locale The locale of the messages. - @return An array list containing the number of messages processed, number of messages added, + @return An array list containing the number of messages processed, number of messages added, number of messages updated, number of messages deleted by the import, and a list of errors produced. The keys of the array list are processed, added, updated, and deleted, and errors. @@ -737,13 +737,13 @@ # Remember each time we've processed a key, so we don't process it twice array set message_key_processed_p [list] - # Loop over the union of import and db keys. + # Loop over the union of import and db keys. foreach message_key [lsort [concat [array names db_messages] [array names file_messages] [array names base_messages]]] { if { [info exists message_key_processed_p($message_key)] } { continue } set message_key_processed_p($message_key) 1 - + ########################################### # # Figure out how db and file messages have changed with regards to the base message @@ -794,8 +794,8 @@ ########################################### # - # Based on the change in file and db messages, - # and based on whether file and db messages differ, decide + # Based on the change in file and db messages, + # and based on whether file and db messages differ, decide # which upgrade actions to take # ########################################### @@ -831,7 +831,7 @@ } add { switch $file_change { - none {} + none {} add { if { $db_messages($message_key) ne $file_messages($message_key) } { # case 8 @@ -841,7 +841,7 @@ set conflict_p "t" } } - } + } } update { switch $file_change { @@ -862,7 +862,7 @@ set upgrade_status "deleted" set conflict_p "t" } - } + } } delete { switch $file_change { @@ -877,7 +877,7 @@ delete { # case 1 set import_case 1 - # deletion in both db and file + # deletion in both db and file # no status change, no conflict # sync time should be updated below } @@ -889,12 +889,12 @@ # # Execute upgrade actions # - ########################################### + ########################################### - # For certain messages we need to move the sync point so that we have a current base for the next upgrade. + # For certain messages we need to move the sync point so that we have a current base for the next upgrade. if { $db_change eq "none" || $file_change ne "none" } { - # If there is no db change then any change in the file will be reflected in - # db (file takes precedence) and file and db are identical. + # If there is no db change then any change in the file will be reflected in + # db (file takes precedence) and file and db are identical. # Also, regardless of what's happened in db, if # there has been a change in the file then that change will take effect in # the db and file and db are again identical (in sync). @@ -932,7 +932,7 @@ set edit_array(deleted_p) [string equal $upgrade_status "deleted"] set edit_array(conflict_p) $conflict_p } - + ns_log Debug "lang::catalog::import_messages - invoking lang::message::edit with import_case=\"$import_case\" -update_sync=$update_sync_p $message_key [array get edit_array]" ad_try { lang::message::edit \ @@ -953,7 +953,7 @@ if { ! $error_p } { incr message_count($upgrade_status) } - } + } incr message_count(processed) } ;# End of message key loop @@ -977,7 +977,7 @@ @param initialize Only load messages from packages that have never before had any message imported @param cache Provide this switch if you want the proc to cache all the imported messages - @return An array list containing the number of messages processed, number of messages added, + @return An array list containing the number of messages processed, number of messages added, number of messages updated, number of messages deleted by the import, and a list of errors produced. The keys of the array list are processed, added, updated, and deleted, and errors. @@ -1073,7 +1073,7 @@ # Get all catalog files for enabled locales set catalog_files [list] - foreach locale $locales_list { + foreach locale $locales_list { # If we are only processing certain locales and this is not one of them - continue if { [llength $locales] > 0 && $locale ni $locales } { @@ -1134,10 +1134,10 @@ # ################## -ad_proc -private lang::catalog::translate {} { +ad_proc -private lang::catalog::translate {} { Translates all untranslated strings in a message catalog from English into Spanish, French and German - using Babelfish. NOTE: this proc is unmaintained. + using Babelfish. NOTE: this proc is unmaintained. Quick way to get a multilingual site up and running if you can live with the quality of the translations.

@@ -1148,7 +1148,7 @@ } { set default_locale [parameter::get -package_id [apm_package_id_from_key acs-lang] -parameter SiteWideLocale] - db_foreach get_untranslated_messages {} { + db_foreach get_untranslated_messages {} { foreach lang [list es_ES fr_FR de_DE] { ad_try { set translated_message [lang_babel_translate $message en_$lang] @@ -1158,7 +1158,7 @@ lang::message::register $lang $package_key $message_key $translated_message } } - } + } } # Local variables: Index: openacs-4/packages/acs-lang/tcl/localization-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/acs-lang/tcl/localization-procs.tcl 29 Dec 2017 11:13:40 -0000 1.26 +++ openacs-4/packages/acs-lang/tcl/localization-procs.tcl 29 Dec 2017 11:17:34 -0000 1.27 @@ -8,20 +8,20 @@ http://www.fsf.org/copyleft/gpl.html @creation-date 30 September 2000 - @author Jeff Davis (davis@xarg.net) + @author Jeff Davis (davis@xarg.net) @author Ashok Argent-Katwala (akatwala@arsdigita.com) @cvs-id $Id$ } -ad_proc -public lc_parse_number { - num - locale +ad_proc -public lc_parse_number { + num + locale {integer_only_p 0} } { - Converts a number to its canonical - representation by stripping everything but the - decimal separator and triming left 0's so it + Converts a number to its canonical + representation by stripping everything but the + decimal separator and triming left 0's so it won't be octal. It can process the following types of numbers:

-} { +} { ad_try { array set result [auth::password::ResetPassword \ -authority_id $authority_id \ -username $username] - + # We do this so that if there aren't even a password_status in the array, that gets caught below set dummy $result(password_status) } on error {errorMsg} { set result(password_status) failed_to_connect set result(password_message) "Error invoking the password management driver." ad_log Error "Error invoking password management driver for authority_id = $authority_id: $errorMsg" } - + # Check the result code and provide canned responses switch $result(password_status) { ok { @@ -459,7 +459,7 @@ -username $username \ -password $result(password) \ -subject_msg_key "acs-subsite.email_subject_Forgotten_password" \ - -body_msg_key "acs-subsite.email_body_Forgotten_password" + -body_msg_key "acs-subsite.email_body_Forgotten_password" } on error {errorMsg} { # We could not inform the user of his email - we failed set result(password_status) "failed_to_connect" @@ -470,7 +470,7 @@ if { ![info exists result(password_message)] || $result(password_message) eq "" } { set result(password_message) [_ acs-subsite.Check_Your_Inbox] } - } + } no_account - not_supported - retrieve_error - failed_to_connect { if { ![info exists result(password_message)] || $result(password_message) eq "" } { array set default_message { @@ -513,7 +513,7 @@ @param from The email's from address. Can be in email@foo.com format. Defaults to ad_system_owner. - + @param subject_msg_key The message key you wish to use for the email subject. @param body_msg_key The message key you wish to use for the email body. @@ -568,10 +568,10 @@ set admin_first_names {} set admin_last_name {} } - + set subject [_ $subject_msg_key] set body [_ $body_msg_key] - + if { $from eq "" } { set from [ad_system_owner] } @@ -587,11 +587,11 @@ ad_proc -private auth::password::CanChangePassword { {-authority_id:required} } { - Invoke the CanChangePassword operation on the given authority. + Invoke the CanChangePassword operation on the given authority. Returns 0 if the authority does not have a password management driver. - + @param authority_id The ID of the authority that we are inquiring about. - + @author Peter Marklund } { set impl_id [auth::authority::get_element -authority_id $authority_id -element "pwd_impl_id"] @@ -615,10 +615,10 @@ ad_proc -private auth::password::CanRetrievePassword { {-authority_id:required} } { - Invoke the CanRetrievePassword operation on the given authority. + Invoke the CanRetrievePassword operation on the given authority. Returns 0 if the authority does not have a password management driver. - @param authority_id The ID of the authority that we are inquiring about. + @param authority_id The ID of the authority that we are inquiring about. @author Peter Marklund } { @@ -643,7 +643,7 @@ ad_proc -private auth::password::CanResetPassword { {-authority_id:required} } { - Invoke the CanResetPassword operation on the given authority. + Invoke the CanResetPassword operation on the given authority. Returns 0 if the authority does not have a password management driver. @param authority_id The ID of the authority that we are inquiring about. @@ -674,7 +674,7 @@ {-new_password:required} {-authority_id:required} } { - Invoke the ChangePassword operation on the given authority. + Invoke the ChangePassword operation on the given authority. Throws an error if the authority does not have a password management driver. @param username @@ -685,7 +685,7 @@ @author Peter Marklund } { set impl_id [auth::authority::get_element -authority_id $authority_id -element "pwd_impl_id"] - + if { $impl_id eq "" } { set authority_pretty_name [auth::authority::get_element -authority_id $authority_id -element "pretty_name"] error "The authority '$authority_pretty_name' doesn't support password management" @@ -704,14 +704,14 @@ $new_password \ $old_password \ $parameters \ - $authority_id]] + $authority_id]] } ad_proc -private auth::password::RetrievePassword { {-username:required} {-authority_id:required} } { - Invoke the RetrievePassword operation on the given authority. + Invoke the RetrievePassword operation on the given authority. Throws an error if the authority does not have a password management driver. @param username @@ -741,13 +741,13 @@ ad_proc -private auth::password::ResetPassword { {-username:required} - {-authority_id ""} + {-authority_id ""} } { - Invoke the ResetPassword operation on the given authority. + Invoke the ResetPassword operation on the given authority. Throws an error if the authority does not have a password management driver. @param username - @param authority_id The ID of the authority the user belongs to. + @param authority_id The ID of the authority the user belongs to. @author Peter Marklund } { @@ -768,8 +768,8 @@ -impl_id $impl_id \ -operation ResetPassword \ -call_args [list $username \ - $parameters \ - $authority_id]] + $parameters \ + $authority_id]] } # Local variables: Index: openacs-4/packages/acs-authentication/tcl/sync-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/sync-procs.tcl,v diff -u -r1.38 -r1.39 --- openacs-4/packages/acs-authentication/tcl/sync-procs.tcl 29 Dec 2017 10:46:39 -0000 1.38 +++ openacs-4/packages/acs-authentication/tcl/sync-procs.tcl 29 Dec 2017 11:22:07 -0000 1.39 @@ -1,6 +1,6 @@ ad_library { API for managing synchronization of user data. - + @creation-date 2003-09-05 @author Lars Pind (lars@collaboraid.biz) @cvs-id $Id$ @@ -29,9 +29,9 @@ Get information about a batch job in an array. @param job_id The ID of the batch job you're ending. - + @param array Name of an array into which you want the information. - + @author Lars Pind (lars@collaboraid.biz) } { upvar 1 $array row @@ -47,7 +47,7 @@ Get a list of entry_ids of the job log entries, ordered by entry_time. @param job_id The ID of the batch job you're ending. - + @author Lars Pind (lars@collaboraid.biz) } { return [db_list select_entries { select entry_id from auth_batch_job_entries where job_id = :job_id order by entry_time }] @@ -59,7 +59,7 @@ Get the authority_id from a job_id. Cached. @param job_id The ID of the batch job you're ending. - + @author Lars Pind (lars@collaboraid.biz) } { return [util_memoize [list auth::sync::job::get_authority_id_not_cached $job_id]] @@ -71,7 +71,7 @@ Flush cache @param job_id The ID of the batch job you're ending. - + @author Lars Pind (lars@collaboraid.biz) } { if { $job_id ne "" } { @@ -88,7 +88,7 @@ Flush cache @param job_id The ID of the batch job you're ending. - + @author Lars Pind (lars@collaboraid.biz) } { util_memoize_seed [list auth::sync::job::get_authority_id_not_cached $job_id] $authority_id @@ -100,9 +100,9 @@ Get the authority_id from a job_id. Not cached. @param job_id The ID of the batch job you're ending. - + @author Lars Pind (lars@collaboraid.biz) - + @see auth::sync::job::get_authority_id } { return [db_string select_auth_id { select authority_id from auth_batch_jobs where job_id = :job_id }] @@ -117,11 +117,11 @@ Record the beginning of a job. @param authority_id The ID of the authority you're trying to sync - + @param interactive Set this if this is an interactive job, i.e. it's initiated by a user. @return job_id An ID for the new batch job. Used when calling other procs in this API. - + @author Lars Pind (lars@collaboraid.biz) } { db_transaction { @@ -132,7 +132,7 @@ if { $interactive_p && $creation_user eq "" } { set creation_user [ad_conn user_id] } - + set interactive_p [db_boolean $interactive_p] db_dml job_insert { @@ -143,7 +143,7 @@ } } - + # See the cache, we're going to need it shortly auth::sync::job::get_authority_id_seed -job_id $job_id -authority_id $authority_id @@ -154,7 +154,7 @@ {-job_id:required} {-message ""} } { - Record the end of a batch job. Closes out the transaction + Record the end of a batch job. Closes out the transaction log and sends out notifications. @param job_id The ID of the batch job you're ending. @@ -166,14 +166,14 @@ @author Lars Pind (lars@collaboraid.biz) } { db_dml update_job_end {} - + # interactive_p, run_time_seconds, num_actions, num_problems get -job_id $job_id -array job set email_p [parameter::get_from_package_key \ -parameter SyncEmailConfirmationP \ -package_key "acs-authentication" \ - -default 0] + -default 0] if { ![template::util::is_true $job(interactive_p)] && $email_p } { # Only send out email if not an interactive job @@ -197,7 +197,7 @@ ad_log Error "Error sending registration confirmation to [ad_system_owner]: $errorMsg" } } - + return [array get job] } @@ -241,17 +241,17 @@ Record a batch job entry. @param job_id The ID of the batch job you're ending. - + @param operation One of 'insert', 'update', or 'delete'. @param username The username of the user being inserted/updated/deleted. - + @param user_id The user_id of the local user account, if known. @param success Whether or not the operation went well. - + @param message Any error message to stick into the log. - + @return entry_id } { set success_p_db [ad_decode $success_p 1 "t" "f"] @@ -266,7 +266,7 @@ ad_proc -public auth::sync::job::get_entry { {-entry_id:required} {-array:required} -} { +} { Get information about a log entry } { upvar 1 $array row @@ -299,20 +299,20 @@ Inserts/updates/deletes a user, depending on the operation. @param job_id The job which this is part of for logging purposes. - + @param operation 'insert', 'update', 'delete', or 'snapshot'. - - @param username The username which this action refers to. - + + @param username The username which this action refers to. + @param array Name of an array containing the relevant registration elements. Not required if this is a delete operation. - + @return entry_id of newly created entry } { if { $operation ne "delete" && $array eq "" } { error "Switch -array is required when operation is not delete" } upvar 1 $array user_info - + set entry_id {} set user_id {} @@ -322,13 +322,13 @@ set user_id [acs_user::get_by_username \ -authority_id $authority_id \ -username $username] - + set success_p 1 array set result { message {} element_messages {} } - + switch $operation { snapshot { if { $user_id ne "" } { @@ -407,13 +407,13 @@ -parameter SyncDotLrnReadPrivateDataP \ -package_key "acs-authentication" \ -default 1] - + dotlrn::user_add \ -id $user_info(email) \ -type $type \ -can_browse=$can_browse_p \ -user_id $user_id - + dotlrn_privacy::set_user_is_non_guest \ -user_id $user_id \ -value $read_private_data_p @@ -431,7 +431,7 @@ -authority_id $authority_id \ -username $username \ -array user_info] - + if { $result(update_status) ne "ok" } { set result(message) $result(update_message) set success_p 0 @@ -443,7 +443,7 @@ array set result [auth::delete_local_account \ -authority_id $authority_id \ -username $username] - + if { $result(delete_status) ne "ok" } { set result(message) $result(delete_message) set success_p 0 @@ -515,12 +515,12 @@ -package_key "acs-authentication" \ -default 0] } - + if {![string is integer -strict $num_days]} { - error "num_days ($num_days) has to be an integer" + error "num_days ($num_days) has to be an integer" } - if { $num_days > 0 } { + if { $num_days > 0 } { db_dml purge_jobs {} } } @@ -529,8 +529,8 @@ {-user_id ""} {-authority_id ""} } { - Get a Tcl list of the user profile elements controlled by the batch synchronization. - These should not be editable by the user. Supply either user_id or authority_id. + Get a Tcl list of the user profile elements controlled by the batch synchronization. + These should not be editable by the user. Supply either user_id or authority_id. Authority_id is the most efficient. } { if { $authority_id eq "" } { @@ -720,9 +720,9 @@ document {} snapshot_p f } - + array set param $parameters - + if { ($param(SnapshotURL) ne "" && [clock format [clock seconds] -format "%d"] eq "01") || $param(IncrementalURL) eq "" } { @@ -798,9 +798,9 @@ document {} snapshot_p f } - + array set param $parameters - + if { ($param(SnapshotPath) ne "" && [clock format [clock seconds] -format "%d"] eq "01") || $param(IncrementalPath) eq "" } { @@ -896,7 +896,7 @@ 1 { set operation "insert" } - 2 { + 2 { set operation "update" } 3 { @@ -941,7 +941,7 @@ document parameters } { - Generates an record-wise acknowledgement document in home-brewed + Generates an record-wise acknowledgement document in home-brewed adaptation of the IMS Enterprise v 1.1 spec. } { set tree [xml_parse -persist $document] @@ -985,7 +985,7 @@ } append doc {} \n - + return $doc }