Index: openacs-4/packages/acs-subsite/www/register/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/user-new-2.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/register/user-new-2.tcl 20 Jun 2002 18:54:39 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/register/user-new-2.tcl 6 Jul 2002 14:56:23 -0000 1.7 @@ -61,7 +61,7 @@ if {$exception_count > 0} { ad_return_complaint $exception_count $exception_text - return + ad_script_abort } # Get whether they requre some sort of approval @@ -86,9 +86,11 @@ set user_id [ad_user_new $email $first_names $last_name $password $question $answer $url $email_verified_p $member_state $user_id] if { !$user_id } { ad_return_error "User Creation Failed" "We were unable to create your user record in the database." + ad_script_abort } } +set script_abort 0 if { $member_state == "approved" && $email_verified_p == "t"} { # user is ready to go if { [ad_check_password $user_id $password] } { @@ -97,8 +99,10 @@ } ad_returnredirect $return_url - ad_script_abort - +# JCD: DO NOT return or ad_script_abort since we may need to fall through +# to notify admin of a new registration. Instead set a flag to abort at end... + set script_abort 1 + } elseif { $email_verified_p == "f" } { # this user won't be able to use the system until he has answered his email @@ -121,15 +125,8 @@ } set notification_address [ad_parameter NewRegistrationEmailAddress "security" [ad_system_owner]] +set errmsg {} -if {[ad_parameter NotifyAdminOfNewRegistrationsP "security" 0]} { - # we're supposed to notify the administrator when someone new registers - ns_sendmail $notification_address $email "New registration at [ad_url]" " -$first_names $last_name ($email) registered as a user of -[ad_url] -" -} - if { !$double_click_p } { if { $email_verified_p == "f" } { @@ -151,5 +148,17 @@ ns_log Warning "Error sending registration confirmation to $email in user-new-2" } } + + if {[ad_parameter NotifyAdminOfNewRegistrationsP "security" 0]} { + # we're supposed to notify the administrator when someone new registers + ns_sendmail $notification_address $email "New registration at [ad_url]" " +$first_names $last_name ($email) registered as a user of +[ad_url] +$errmsg +" + } } +if {$script_abort} { + ad_script_abort +}