Index: openacs-4/contrib/packages/simulation/www/simplay/enroll.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/simplay/Attic/enroll.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/contrib/packages/simulation/www/simplay/enroll.tcl 20 Jan 2004 14:11:21 -0000 1.6 +++ openacs-4/contrib/packages/simulation/www/simplay/enroll.tcl 21 Jan 2004 15:55:36 -0000 1.7 @@ -17,18 +17,22 @@ ad_script_abort } +set user_invited_p [simulation::template::user_invited_p -workflow_id $workflow_id] + # Check that the user has permission to enroll if { [string equal $simulation(enroll_type) "open"] } { # Open simulation - anybody can enroll so the user is authorized - # Check that we are within the enrollment period - if { [clock scan $simulation(enroll_start)] > [clock seconds] || [clock scan $simulation(enroll_end)] < [clock seconds] } { - # We are not in the enrollment period - ad_return_forbidden "Cannot enroll in simulation" "The enrollment period for simulation \"$simulation(pretty_name)\" is between $simulation(enroll_start) and $simulation(enroll_end) and you cannot enroll at this time. Contact your administrator if you believe this is an error. Thank you!" - ad_script_abort + + if { !$user_invited_p } { + # User not invited - check that we are within the enrollment period + if { [clock scan $simulation(enroll_start)] > [clock seconds] || [clock scan $simulation(enroll_end)] < [clock seconds] } { + # We are not in the enrollment period + ad_return_forbidden "Cannot enroll in simulation" "The enrollment period for simulation \"$simulation(pretty_name)\" is between $simulation(enroll_start) and $simulation(enroll_end) and you cannot enroll at this time. Contact your administrator if you believe this is an error. Thank you!" + ad_script_abort + } } } else { # Closed enrollment. The user needs to be invited to enroll - set user_invited_p [simulation::template::user_invited_p -workflow_id $workflow_id] if { !$user_invited_p } { acs_user::get -user_id $user_id -array user