Index: openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl,v diff -u -r1.12.2.32 -r1.12.2.33 --- openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl 28 Jun 2021 08:41:36 -0000 1.12.2.32 +++ openacs-4/packages/acs-subsite/tcl/test/acs-subsite-procs.tcl 22 Aug 2022 14:51:23 -0000 1.12.2.33 @@ -762,6 +762,54 @@ } } +aa_register_case -cats { + api + web + smoke +} -procs { + auth::UseEmailForLoginP + parameter::set_value + ad_acs_kernel_id + parameter::get + acs::test::reply_has_status_code + acs::test::http +} -urls { + /register/recover-password +} password_recovery_page { + + Ensure the password recovery page works. + +} { + set use_email_for_login_p [auth::UseEmailForLoginP] + + aa_equals "auth::UseEmailForLoginP returns the expected value" \ + [parameter::get -boolean -parameter UseEmailForLoginP \ + -package_id [ad_acs_kernel_id] -default 1] \ + $use_email_for_login_p + + try { + set d [acs::test::http /register/recover-password] + acs::test::reply_has_status_code $d 200 + + aa_log "Flip UseEmailForLoginP" + parameter::set_value \ + -package_id [ad_acs_kernel_id] \ + -parameter UseEmailForLoginP -value [expr {!$use_email_for_login_p}] + + aa_equals "auth::UseEmailForLoginP returns the expected value" \ + [auth::UseEmailForLoginP] \ + [expr {!$use_email_for_login_p}] + + set d [acs::test::http /register/recover-password] + acs::test::reply_has_status_code $d 200 + + } finally { + parameter::set_value \ + -package_id [ad_acs_kernel_id] \ + -parameter UseEmailForLoginP -value $use_email_for_login_p + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/acs-subsite/www/register/recover-password.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/recover-password.tcl,v diff -u -r1.16.2.4 -r1.16.2.5 --- openacs-4/packages/acs-subsite/www/register/recover-password.tcl 11 Mar 2021 14:56:35 -0000 1.16.2.4 +++ openacs-4/packages/acs-subsite/www/register/recover-password.tcl 22 Aug 2022 14:51:23 -0000 1.16.2.5 @@ -49,11 +49,12 @@ set user_id_widget_name email set focus "email" } else { + set authority_options [auth::authority::get_authority_options] if { [llength $authority_options] > 1 } { ad_form -extend -name recover -form { {authority_id:integer(select) {label {[_ acs-kernel.authentication_authority]}} - {options [auth::authority::get_authority_options]} + {options $authority_options} } } }