Index: openacs-4/packages/acs-admin/tcl/merge-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/merge-procs.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/acs-admin/tcl/merge-procs.tcl 8 Jun 2005 21:46:41 -0000 1.1.2.3 +++ openacs-4/packages/acs-admin/tcl/merge-procs.tcl 7 Jul 2005 22:57:45 -0000 1.1.2.4 @@ -8,47 +8,46 @@ } -namespace eval merge { - ad_proc -public MergeUserInfo { - -from_user_id:required - -to_user_id:required - } { +namespace eval merge {} - ns_log Notice "Running merge::MergeUserInfo" - db_transaction { - if { ![db_0or1row to_user_portrait {*SQL*}] && [db_0or1row from_user_portrait {*SQL*}] } { - db_dml upd_portrait {*SQL*} +ad_proc -public merge::MergeUserInfo { + -from_user_id:required + -to_user_id:required +} { + ns_log Notice "Running merge::MergeUserInfo" + db_transaction { + if { ![db_0or1row to_user_portrait {*SQL*}] && [db_0or1row from_user_portrait {*SQL*}] } { + db_dml upd_portrait {*SQL*} + } + + # get the permissions of the from_user_id + # and grant them to the to_user_id + db_foreach getfromobjs {*SQL*} { + # revoke the permissions of from_user_id + permission::revoke -object_id $from_oid -party_id $from_user_id -privilege $from_priv + if { ![db_string touserhas {*SQL*} ] } { + # grant the permissions to to_user_id + permission::grant -object_id $from_oid -party_id $to_user_id -privilege $from_priv } - - # get the permissions of the from_user_id - # and grant them to the to_user_id - db_foreach getfromobjs {*SQL*} { - # revoke the permissions of from_user_id - permission::revoke -object_id $from_oid -party_id $from_user_id -privilege $from_priv - if { ![db_string touserhas {*SQL*} ] } { - # grant the permissions to to_user_id - permission::grant -object_id $from_oid -party_id $to_user_id -privilege $from_priv - } - } - - ns_log notice " Merging acs_objects" - - db_dml acs_objs_upd {*SQL*} } - ns_log Notice "Finishing merge::MergeUserInfo" + + ns_log notice " Merging acs_objects" + + db_dml acs_objs_upd {*SQL*} } + ns_log Notice "Finishing merge::MergeUserInfo" } -ad_proc -callback MergePackageUser { +ad_proc -callback merge::MergePackageUser { -from_user_id:required -to_user_id:required } { Merge two accounts } - -ad_proc -callback MergeShowUserInfo { +ad_proc -callback merge::MergeShowUserInfo { -user_id:required } { - Merge two accounts + Show information of accounts to merge } -