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.2 -r1.1.2.3 --- openacs-4/packages/acs-admin/tcl/merge-procs.tcl 8 Jun 2005 11:22:17 -0000 1.1.2.2 +++ openacs-4/packages/acs-admin/tcl/merge-procs.tcl 8 Jun 2005 21:46:41 -0000 1.1.2.3 @@ -8,6 +8,37 @@ } +namespace eval merge { + ad_proc -public 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 + } + } + + ns_log notice " Merging acs_objects" + + db_dml acs_objs_upd {*SQL*} + } + ns_log Notice "Finishing merge::MergeUserInfo" + } +} + ad_proc -callback MergePackageUser { -from_user_id:required -to_user_id:required @@ -21,4 +52,3 @@ Merge two accounts } - - Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-admin/tcl/merge-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-authentication/tcl/local-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/local-procs.tcl,v diff -u -r1.29.2.1 -r1.29.2.2 --- openacs-4/packages/acs-authentication/tcl/local-procs.tcl 8 Jun 2005 11:11:49 -0000 1.29.2.1 +++ openacs-4/packages/acs-authentication/tcl/local-procs.tcl 8 Jun 2005 21:46:40 -0000 1.29.2.2 @@ -111,24 +111,6 @@ db_transaction { ns_log Notice " Merging user portraits" - 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 - } - } - - ns_log notice " Merging acs_objects" - db_dml acs_objs_upd {*SQL*} - ns_log notice " Merging username, email and basic info in general" set new_username "merged_$from_user_id" Index: openacs-4/packages/acs-authentication/tcl/local-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/local-procs.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-authentication/tcl/local-procs.xql 8 Jun 2005 11:11:49 -0000 1.1.2.1 +++ openacs-4/packages/acs-authentication/tcl/local-procs.xql 8 Jun 2005 21:46:40 -0000 1.1.2.2 @@ -2,55 +2,6 @@ - - - select c.item_id - from acs_rels a, cr_items c - where a.object_id_two = c.item_id - and a.object_id_one = :to_user_id - and a.rel_type = 'user_portrait_rel' - - - - - - select c.item_id - from acs_rels a, cr_items c - where a.object_id_two = c.item_id - and a.object_id_one = :from_user_id - and a.rel_type = 'user_portrait_rel' - - - - - - update acs_rels - set object_id_one = :to_user_id - where object_id_one = :from_user_id - and rel_type = 'user_portrait_rel' - - - - - - select object_id as from_oid, privilege as from_priv from acs_permissions where grantee_id = :from_user_id - - - - - - select count(*) from acs_permissions where object_id = :from_oid and grantee_id = :to_user_id - - - - - - update acs_objects - set creation_user = :to_user_id - where creation_user = :from_user_id - - - select rel_id from cc_users where user_id = :from_user_id