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.12 -r1.13 --- openacs-4/packages/acs-subsite/www/register/recover-password.tcl 20 Nov 2009 21:39:09 -0000 1.12 +++ openacs-4/packages/acs-subsite/www/register/recover-password.tcl 27 Oct 2014 16:40:01 -0000 1.13 @@ -5,7 +5,7 @@ @creation-date 2003-08-29 @cvs-id $Id$ } { - {authority_id:integer ""} + {authority_id:naturalnum ""} {username ""} {email ""} } @@ -30,8 +30,8 @@ # Display form to collect username and authority set authority_options [auth::authority::get_authority_options] -if { ![exists_and_not_null authority_id] } { - set authority_id [lindex [lindex $authority_options 0] 1] +if { (![info exists authority_id] || $authority_id eq "") } { + set authority_id [lindex $authority_options 0 1] } ad_form -name recover -edit_buttons [list [list [_ acs-kernel.common_continue] ok]] -form { {dummy:text(hidden),optional} } @@ -60,7 +60,7 @@ ad_form -extend -name recover -form [list [list username:text($username_widget) [list label "Username"]]] -validate { {username - { ![empty_string_p [acs_user::get_by_username -authority_id $authority_id -username $username]] } + { [acs_user::get_by_username -authority_id $authority_id -username $username] ne "" } { Could not find username at authority } } } @@ -80,7 +80,7 @@ # We handle form submission here, because otherwise we can't handle both the case where we use the form # and the case where we don't in one go -if { [form is_valid recover] || (![form is_submission recover] && ([exists_and_not_null username] || [exists_and_not_null email])) } { +if { [form is_valid recover] || (![form is_submission recover] && (([info exists username] && $username ne "") || ([info exists email] && $email ne ""))) } { array set recover_info [auth::password::recover_password \ -authority_id $authority_id \ -username $username \