Index: openacs-4/packages/acs-subsite/acs-subsite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v diff -u -r1.76 -r1.77 --- openacs-4/packages/acs-subsite/acs-subsite.info 4 Jun 2005 12:38:26 -0000 1.76 +++ openacs-4/packages/acs-subsite/acs-subsite.info 9 Jun 2005 18:52:10 -0000 1.77 @@ -24,17 +24,16 @@ - + - + - + - - + @@ -64,8 +63,9 @@ - + + 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.10 -r1.11 --- openacs-4/packages/acs-subsite/lib/user-new.tcl 2 Mar 2005 22:38:46 -0000 1.10 +++ openacs-4/packages/acs-subsite/lib/user-new.tcl 9 Jun 2005 18:52:10 -0000 1.11 @@ -37,20 +37,17 @@ ad_user_logout } -if {[apm_package_installed_p "assessment"]} { - set exist_assessment [parameter::get -parameter AsmForRegisterId] -} else { - set exist_assessment "" -} +# Redirect to the registration assessment if there is one, if not, continue with the regular +# registration form. -if { $exist_assessment != "" && $exist_assessment!=0} { - set package_id [db_string package_id {select package_id from cr_folders where folder_id=(select context_id from acs_objects where object_id=:exist_assessment)}] - set url [apm_package_url_from_id $package_id] +set url [callback -catch -impl url user::registration] - ad_returnredirect "${url}assessment?assessment_id=$exist_assessment&return_url=$return_url" -} else { +if { ![empty_string_p $url] } { + ad_returnredirect "$url" +} + # Pre-generate user_id for double-click protection set user_id [db_nextval acs_object_id_seq] @@ -60,7 +57,7 @@ ad_form -extend -name register -form { {rel_group_id:integer(hidden),optional} } - + if { [permission::permission_p -object_id $rel_group_id -privilege "admin"] } { ad_form -extend -name register -form { {rel_type:text(select) @@ -79,9 +76,9 @@ ad_form -extend -name register -on_request { # Populate elements from local variables - + } -on_submit { - + db_transaction { array set creation_info [auth::create_user \ -user_id $user_id \ @@ -96,15 +93,15 @@ -url $url \ -secret_question $secret_question \ -secret_answer $secret_answer] - + if { [string equal $creation_info(creation_status) "ok"] && [exists_and_not_null rel_group_id] } { group::add_member \ -group_id $rel_group_id \ -user_id $user_id \ -rel_type $rel_type } } - + # Handle registration problems switch $creation_info(creation_status) { @@ -118,15 +115,15 @@ set first_elm [lindex [concat $reg_elms(required) $reg_elms(optional)] 0] form set_error register $first_elm $creation_info(creation_message) } - + # Element messages foreach { elm_name elm_error } $creation_info(element_messages) { form set_error register $elm_name $elm_error } break } } - + switch $creation_info(account_status) { ok { # Continue below @@ -137,23 +134,23 @@ ad_script_abort } } - + } -after_submit { - + if { ![empty_string_p $next_url] } { # Add user_id and account_message to the URL ad_returnredirect [export_vars -base $next_url {user_id password {account_message $creation_info(account_message)}}] ad_script_abort } - - + + # User is registered and logged in if { ![exists_and_not_null return_url] } { # Redirect to subsite home page. set return_url [subsite::get_element -element url] } - + # If the user is self registering, then try to set the preferred # locale (assuming the user has set it as a anonymous visitor # before registering). @@ -167,7 +164,7 @@ ad_set_cookie -replace t -max_age 0 "ad_locale" "" } } - + # Handle account_message if { ![empty_string_p $creation_info(account_message)] && $self_register_p } { # Only do this if user is self-registering @@ -180,4 +177,3 @@ ad_script_abort } } -} \ No newline at end of file Index: openacs-4/packages/acs-subsite/tcl/callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/callback-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/tcl/callback-procs.tcl 22 Mar 2005 00:57:59 -0000 1.1 +++ openacs-4/packages/acs-subsite/tcl/callback-procs.tcl 9 Jun 2005 18:52:11 -0000 1.2 @@ -10,11 +10,11 @@ -user_id } { used to generate html fragments for display on the /pvt/home page. - + The html fragment should have an h2 header for sectioning. - + @param user_id - the user to display - + @see callback::user::workspace::impl::acs-subsite } - @@ -24,3 +24,10 @@ } { return [template::adp_include /packages/acs-subsite/lib/user-subsites [list user_id $user_id]] } + +ad_proc -public -callback user::registration { + -package_id +} { + used to verify if there is another registration process. + The implementation must return the url of the registration page. +} - Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/set-reg-assessment.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/set-reg-assessment.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/set-reg-assessment.xql'. Fisheye: No comparison available. Pass `N' to diff?