Index: openacs-4/packages/acs-subsite/lib/user-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/user-new.tcl,v diff -u -r1.19.2.4 -r1.19.2.5 --- openacs-4/packages/acs-subsite/lib/user-new.tcl 23 Apr 2017 20:36:14 -0000 1.19.2.4 +++ openacs-4/packages/acs-subsite/lib/user-new.tcl 24 Apr 2017 13:19:08 -0000 1.19.2.5 @@ -61,13 +61,21 @@ # Pre-generate user_id for double-click protection set user_id [db_nextval acs_object_id_seq] -ad_form -name register -export {next_url user_id return_url} -form [auth::get_registration_form_elements] -validate { +ad_form -name register -export {next_url user_id return_url} -form [auth::get_registration_form_elements] + +# +# Standard validator +# +set validate { {email {[string equal "" [party::get_by_email -email $email]]} "[_ acs-subsite.Email_already_exists]" } } +# +# Handling of additional groups +# if { $rel_group_id ne "" } { ad_form -extend -name register -form { {rel_group_id:integer(hidden),optional} @@ -89,6 +97,12 @@ } } +# +# Register the validators after all form-fields were added (in case +# conditional fields were added needing validators). +# +ad_form -extend -name register -validate $validate + ad_form -extend -name register -on_request { # Populate elements from local variables