Index: openacs-4/packages/dotlrn/www/register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/dotlrn/www/register.tcl 29 Jun 2018 17:27:19 -0000 1.22 +++ openacs-4/packages/dotlrn/www/register.tcl 29 Jan 2019 13:59:35 -0000 1.23 @@ -31,9 +31,9 @@ set redirect_to [parameter::get -parameter SelfRegistrationRedirectTo -package_id [dotlrn::get_package_id] -default ""] if { $redirect_to ne "" } { - ad_returnredirect $redirect_to + ad_returnredirect $redirect_to } else { - ad_returnredirect "not-allowed" + ad_returnredirect "not-allowed" } ad_script_abort } @@ -61,8 +61,8 @@ # This should prevent most double clicks, leaving # the catch below to trap the rest. -if { [dotlrn_community::member_p $community_id $user_id] || - ($join_policy eq "needs approval" +if { [dotlrn_community::member_p $community_id $user_id] || + ($join_policy eq "needs approval" && [dotlrn_community::member_pending_p -community_id $community_id -user_id $user_id] ) } { @@ -75,7 +75,7 @@ switch -exact $join_policy { "open" { dotlrn_community::add_user -member_state approved $community_id $user_id - dotlrn_community::send_member_email -community_id $community_id -to_user $user_id + dotlrn_community::send_member_email -community_id $community_id -to_user $user_id } "needs approval" { dotlrn_community::add_user -member_state "needs approval" $community_id $user_id @@ -95,7 +95,7 @@ set subject "$full_name ($email) has requested to join $community_name." set message "$full_name ($email) has requested to join $community_name. - + Visit this link to approve or reject this request: $community_url/members @@ -111,20 +111,19 @@ -subject $subject \ -message $message \ -query $query - } } } errmsg]} { - # Check to see if they are already a member + # Check to see if they are already a member # (in which case this was likely a double click) - + if {[dotlrn_community::member_p $community_id $user_id]} { ad_returnredirect $referer ad_script_abort } else { ns_log Error "register.tcl failed: $errmsg\n$::errorInfo" - + ad_return_error \ "Error adding user to community" \ "An error occurred while trying to add a user to a community. This error has been logged."