Index: openacs-4/packages/acs-authentication/tcl/authority-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authority-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-authentication/tcl/authority-procs.tcl 29 Dec 2017 10:46:39 -0000 1.31 +++ openacs-4/packages/acs-authentication/tcl/authority-procs.tcl 29 Dec 2017 11:22:07 -0000 1.32 @@ -22,8 +22,8 @@ {-authority_id ""} {-array:required} } { - Create a new authentication authority. - + Create a new authentication authority. + @option authority_id Authority_id, or blank if you want one generated for you. @param array Name of an array containing the column values. The entries are: @@ -46,7 +46,7 @@
  • forgotten_pwd_url An alternative URL to redirect to when the user has forgotten his/her password. Defaults to none. - +
  • change_pwd_url An alternative URL to redirect to when the user wants to change his/her password. Defaults to none. @@ -78,10 +78,10 @@ set names [array names row] - array set column_defaults [get_column_defaults] + array set column_defaults [get_column_defaults] set all_columns [array names column_defaults] - # Check that the columns provided in the array are all valid + # Check that the columns provided in the array are all valid # Set array entries as local variables foreach name $names { if {$name ni $all_columns} { @@ -134,18 +134,18 @@ set authority_id [db_exec_plsql create_authority {}] # Set the arguments not taken by the new function with an update statement - # LARS: Great, we had a nice abstraction going, so you only had to add a new column in + # LARS: Great, we had a nice abstraction going, so you only had to add a new column in # one place, now that abstraction is broken, because you have to add it here as well - foreach column { + foreach column { user_info_impl_id get_doc_impl_id process_doc_impl_id batch_sync_enabled_p - help_contact_text_format + help_contact_text_format } { set edit_columns($column) [set $column] - } - + } + edit -authority_id $authority_id -array edit_columns } } @@ -164,7 +164,7 @@ {-array:required} } { Get info about an authority, either by authority_id, user_id, or authority short_name. - + @param authority_id The authority you want to get. @param array Name of an array into which you want the attributes delivered. @@ -185,15 +185,15 @@ {-element:required} } { Return a specific element of the auth_authority data table. - Does a complete database query each time. Should not be used multiple times in a row. + Does a complete database query each time. Should not be used multiple times in a row. Use auth::authority::get instead. @see auth::authority::get } { if { [lsearch [get_select_columns] $element] == -1 } { error "Column '$element' not found in the auth_authority data source." } - + get -authority_id $authority_id -array row return $row($element) } @@ -205,7 +205,7 @@ Get authority_id by short_name. @param short_name The short_name of the authority you wish to get information for. - + @return authority_id or the empty string if short_name doesn't exist. @author Lars Pind (lars@collaboraid.biz) @@ -218,7 +218,7 @@ {-array:required} } { Edit info about a authority. Note, that there's no checking that the columns you name exist. - + @param authority_id The authority you want to get. @param array Name of an array with column values to update. @@ -229,9 +229,9 @@ set old_short_name [get_element -authority_id $authority_id -element short_name] upvar $array row - + set names [array names row] - + # Construct clauses for the update statement set set_clauses [list] foreach name $names { @@ -245,7 +245,7 @@ set columns [get_columns] - # Check that the columns provided in the array are all valid + # Check that the columns provided in the array are all valid # Set array entries as local variables foreach name $names { if {$name ni $columns} { @@ -256,7 +256,7 @@ } set $name $row($name) } - + db_dml update_authority " update auth_authorities set [join $set_clauses ", "] @@ -269,7 +269,7 @@ # check if we need to update the object title set new_short_name [get_element -authority_id $authority_id -element short_name] if {$old_short_name ne $new_short_name } { - db_dml update_object_title {} + db_dml update_object_title {} } } @@ -297,7 +297,7 @@ Execute batch synchronization for this authority now. @param authority_id - @param snapshot If set, we will delete all authority's users + @param snapshot If set, we will delete all authority's users not touched by the process document proc. @return job_id @@ -306,13 +306,13 @@ -authority_id $authority_id] get -authority_id $authority_id -array authority - + set message {} # Verify that we have implementations if { $authority(get_doc_impl_id) eq "" } { set message "No Get Document implementation" - } elseif { $authority(process_doc_impl_id) eq "" } { + } elseif { $authority(process_doc_impl_id) eq "" } { set message "No Process Document implementation" } else { auth::sync::job::start_get_document -job_id $job_id @@ -330,7 +330,7 @@ set doc_result(doc_status) failed_to_connect set doc_result(doc_message) $errorMsg } - + set snapshot_p [template::util::is_true $doc_result(snapshot_p)] auth::sync::job::end_get_document \ @@ -346,17 +346,17 @@ -authority_id $authority_id \ -job_id $job_id \ -document $doc_result(document) - + set ack_doc [auth::sync::GetAcknowledgementDocument \ -authority_id $authority_id \ -job_id $job_id \ -document $doc_result(document)] - + set ack_file_name [parameter::get_from_package_key \ -parameter AcknowledgementFileName \ -package_key acs-authentication \ -default {}] - + if { $ack_file_name ne "" } { # Interpolate set pairs [list \ @@ -380,7 +380,7 @@ set message $doc_result(doc_message) } } - + if { $snapshot_p } { # If this is a snapshot, we need to delete all the users belonging to this authority # that weren't included in the snapshot. @@ -419,7 +419,7 @@ ad_proc -private auth::authority::get_columns {} { Get a list of the columns in the auth_authorities table. - + @author Lars Pind (lars@collaboraid.biz) } { array set column_defaults [get_column_defaults] @@ -432,7 +432,7 @@ @author Peter Marklund } { - set columns { + set columns { authority_id "" short_name "" pretty_name "" @@ -459,10 +459,10 @@ ad_proc -private auth::authority::get_required_columns {} { Get a list of the required columns in the auth_authorities table. - + @author Lars Pind (lars@collaboraid.biz) } { - return { + return { authority_id short_name pretty_name @@ -473,7 +473,7 @@ Get a list of column names for storing service contract implementation ids of the authority. - @author Peter Marklund + @author Peter Marklund } { # DAVEB set columns {auth_impl_id pwd_impl_id register_impl_id user_info_impl_id get_doc_impl_id process_doc_impl_id} @@ -485,7 +485,7 @@ ad_proc -private auth::authority::get_select_columns {} { Get a list of the columns which can be selected from auth_authorities table. - + @author Lars Pind (lars@collaboraid.biz) } { set columns [concat [get_columns] auth_impl_name pwd_impl_name register_impl_name user_info_impl_name get_doc_impl_name process_doc_impl_name] @@ -500,7 +500,7 @@ {-authority_id ""} } { Flush the cache for auth::authority::get. - + @see auth::authority::get } { if { $authority_id ne "" } {