Index: openacs-4/packages/acs-admin/www/users/merge-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/merge-confirm.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-admin/www/users/merge-confirm.tcl 7 Aug 2017 23:47:45 -0000 1.5 +++ openacs-4/packages/acs-admin/www/users/merge-confirm.tcl 30 May 2018 15:20:51 -0000 1.6 @@ -11,9 +11,9 @@ } -properties { context:onevalue } -validate { - if_diff_authority { - set from_authority_id [db_string gettoa {select authority_id from cc_users where user_id = :from_user_id}] - set to_authority_id [db_string getfroma {select authority_id from cc_users where user_id = :to_user_id}] + if_diff_authority { + set from_authority_id [acs_user::get_element -user_id $from_user_id -element authority_id] + set to_authority_id [acs_user::get_element -user_id $to_user_id -element authority_id] if { $from_authority_id ne $to_authority_id } { ad_complain "Merge only works for users from the same authority" } @@ -33,14 +33,21 @@ # information of from_user_id -db_1row from_get_info {} +set from_user [acs_user::get -user_id $from_user_id] +set from_first_names [dict get $from_user first_names] +set from_last_name [dict get $from_user last_name] +set from_email [dict get $from_user email] # information of to_user_id -db_1row to_get_info {} +set to_user [acs_user::get -user_id $to_user_id] +set to_first_names [dict get $to_user first_names] +set to_last_name [dict get $to_user last_name] +set to_email [dict get $to_user email] + # information of user_id one -if { [db_0or1row to_user_portrait {}] } { +if { [acs_user::get_portrait_id -user_id $to_user_id] != 0 } { set to_img_src "[subsite::get_element -element url]shared/portrait-bits.tcl?user_id=$to_user_id" } else { set to_img_src "/resources/acs-admin/not_available.gif" Index: openacs-4/packages/acs-admin/www/users/merge-confirm.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/Attic/merge-confirm.xql,v diff -u -N --- openacs-4/packages/acs-admin/www/users/merge-confirm.xql 4 Jun 2006 00:45:20 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ - - - - - - select - first_names as from_first_names, - last_name as from_last_name, - email as from_email - from cc_users - where user_id = :from_user_id - - - - - - select - first_names as to_first_names, - last_name as to_last_name, - email as to_email - from cc_users - where user_id = :to_user_id - - - - - - - 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' - - - - -