Index: openacs-4/packages/acs-admin/www/auth/authority.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/auth/authority.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/acs-admin/www/auth/authority.tcl 11 Sep 2003 16:12:30 -0000 1.5
+++ openacs-4/packages/acs-admin/www/auth/authority.tcl 12 Sep 2003 12:26:39 -0000 1.6
@@ -40,17 +40,17 @@
{auth_impl_id:integer(select),optional
{label "Authentication implementation"}
- {options {[acs_sc::impl::get_options -exclude_names local -empty_option -contract_name auth_authentication]}}
+ {options {[acs_sc::impl::get_options -empty_label "disabled" -contract_name auth_authentication]}}
}
{pwd_impl_id:integer(select),optional
{label "Password implementation"}
- {options {[acs_sc::impl::get_options -exclude_names local -empty_option -contract_name auth_password]}}
+ {options {[acs_sc::impl::get_options -empty_label "disabled" -contract_name auth_password]}}
}
{register_impl_id:integer(select),optional
{label "Register implementation"}
- {options {[acs_sc::impl::get_options -exclude_names local -empty_option -contract_name auth_registration]}}
+ {options {[acs_sc::impl::get_options -empty_label "disabled" -contract_name auth_registration]}}
}
{forgotten_pwd_url:text,optional
@@ -90,12 +90,12 @@
{get_doc_impl_id:integer(select),optional
{label "GetDocument implementation"}
- {options {[acs_sc::impl::get_options -empty_option -contract_name auth_getdoc]}}
+ {options {[acs_sc::impl::get_options -empty_label "disabled" -contract_name auth_getdoc]}}
}
{process_doc_impl_id:integer(select),optional
{label "ProcessDocument implementation"}
- {options {[acs_sc::impl::get_options -empty_option -contract_name auth_processdoc]}}
+ {options {[acs_sc::impl::get_options -empty_label "disabled" -contract_name auth_processdoc]}}
}
}
@@ -132,38 +132,29 @@
-mode $ad_form_mode \
-form $form_widgets \
-edit_request {
-
+
auth::authority::get -authority_id $authority_id -array element_array
set page_title $element_array(pretty_name)
foreach element_name [array names element_array] {
set $element_name $element_array($element_name)
}
-
+
if { !$local_authority_p } {
+ # Set the value of the help_contact_text element - both contents and format attributes
set help_contact_text [template::util::richtext::create]
set help_contact_text [template::util::richtext::set_property contents $help_contact_text $element_array(help_contact_text)]
-
if { [empty_string_p $element_array(help_contact_text_format)] } {
set element_array(help_contact_text_format) "text/enhanced"
}
-
- set help_contact_text [template::util::richtext::set_property format $help_contact_text $element_array(help_contact_text_format)]
-
- # Parameter links for implementations
- foreach element_name [auth::authority::get_sc_impl_columns] {
- # Only offer link if there is an implementation chosen
- if { [exists_and_not_null element_array($element_name)] } {
- set old_label [element get_property authority $element_name label]
- set configure_url [export_vars -base authority-parameters { authority_id {column_name $element_name}}]
- element set_properties authority $element_name -label "$old_label set parameters"
- }
- }
+ set help_contact_text [template::util::richtext::set_property format $help_contact_text $element_array(help_contact_text_format)]
}
} -new_data {
+ set page_title $pretty_name
+
foreach var_name [template::form::get_elements -no_api authority] {
set element_array($var_name) [set $var_name]
}
@@ -220,6 +211,9 @@
label "Problems"
html { align right }
}
+ short_message {
+ label "Message"
+ }
interactive_pretty {
label "Interactive"
html { align center }
@@ -229,7 +223,7 @@
set display_batch_history_p [expr $authority_exists_p && [string equal $ad_form_mode "display"]]
if { $display_batch_history_p } {
- db_multirow -extend { job_url start_time_pretty end_time_pretty interactive_pretty } batch_jobs select_batch_jobs {
+ db_multirow -extend { job_url start_time_pretty end_time_pretty interactive_pretty short_message } batch_jobs select_batch_jobs {
select job_id,
to_char(job_start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time_ansi,
to_char(job_end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time_ansi,
@@ -241,7 +235,8 @@
from auth_batch_job_entries e2
where e2.job_id = auth_batch_jobs.job_id
and e2.success_p = 'f') as num_problems,
- interactive_p
+ interactive_p,
+ message
from auth_batch_jobs
where authority_id = :authority_id
} {
@@ -251,19 +246,31 @@
set end_time_pretty [lc_time_fmt $end_time_ansi "%x %X"]
set interactive_pretty [ad_decode $interactive_p "t" "Yes" "No"]
+
+ set short_message [string_truncate -len 30 $message]
}
}
set context [list [list "." "Authentication"] $page_title]
set batch_sync_run_url [export_vars -base batch-job-run { authority_id }]
-if { $authority_exists_p && !$local_authority_p && [empty_string_p [element get_property authority help_contact_text value]] } {
- error hello
- # TODO: Ask Lars how we can avoid the problem with the empty format field
- # without this kludge
- set help_contact_text [template::util::richtext::create]
- set help_contact_text [template::util::richtext::set_property format $help_contact_text "text/enhanced"]
+# This code should be executed for non-local authorities in the following types of requests:
+# - initial request of the form (display mode)
+# - The form is being submitted (display mode)
+set initial_request_p [empty_string_p [form get_action authority]]
+set submit_p [form is_valid authority]
+if { ($initial_request_p || $submit_p) && !$local_authority_p } {
- element set_properties authority help_contact_text -value $help_contact_text
-}
\ No newline at end of file
+ # Add parameter links for implementations in display mode
+ foreach element_name [auth::authority::get_sc_impl_columns] {
+ # Only offer link if there is an implementation chosen and that implementation has
+ # parameters to configure
+ if { [exists_and_not_null element_array($element_name)] &&
+ ![empty_string_p [auth::driver::get_parameters -impl_id $element_array($element_name)]]} {
+
+ set configure_url [export_vars -base authority-parameters { authority_id {column_name $element_name}}]
+ element set_properties authority $element_name -after_html "(Configure)"
+ }
+ }
+}