auth::local::authentication::MergeUser (private)

 auth::local::authentication::MergeUser from_user_id to_user_id \
    [ authority_id ]

Defined in packages/acs-authentication/tcl/local-procs.tcl

Merge Implementation of local authentication. This will merge the names, emails, usernames, permissions, etc of the two users to merge.

Parameters:
from_user_id (required)
to_user_id (required)
authority_id (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_auth_authentication_implementations auth_authentication_implementations (test acs-authentication) auth::local::authentication::MergeUser auth::local::authentication::MergeUser test_auth_authentication_implementations->auth::local::authentication::MergeUser acs_user::update acs_user::update (public) auth::local::authentication::MergeUser->acs_user::update db_string db_string (public) auth::local::authentication::MergeUser->db_string db_transaction db_transaction (public) auth::local::authentication::MergeUser->db_transaction membership_rel::change_state membership_rel::change_state (public) auth::local::authentication::MergeUser->membership_rel::change_state party::update party::update (public) auth::local::authentication::MergeUser->party::update AcsSc.auth_authentication.mergeuser.local AcsSc.auth_authentication.mergeuser.local (private) AcsSc.auth_authentication.mergeuser.local->auth::local::authentication::MergeUser auth::local::authentication::register_impl auth::local::authentication::register_impl (private) auth::local::authentication::register_impl->auth::local::authentication::MergeUser

Testcases:
auth_authentication_implementations
Source code:
    ns_log Notice "Starting auth::local::authentication::MergeUser"
    db_transaction {
        ns_log Notice "  Merging user portraits"

        ns_log notice "  Merging username, email and basic info in general"

        set new_username "merged_$from_user_id"
        append new_username "_$to_user_id"

        # Shall we keep the domain for email?
        # Actually, the username 'merged_xxx_yyy'
        # won't be an email, so we will keep it without
        # domain
        set new_email $new_username

        set rel_id [db_string getrelid {}]
        membership_rel::change_state -rel_id $rel_id -state "merged"

        acs_user::update -user_id $from_user_id -username "$new_username" -screen_name "$new_username"
        party::update -party_id $from_user_id -email "$new_email"

    }
    ns_log notice "Finishing auth::local::authentication::MergeUser"
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="auth::local::authentication::MergeUser.getrelid">
    <querytext>
	select rel_id from cc_users where user_id = :from_user_id      
      </querytext>
</fullquery>
packages/acs-authentication/tcl/local-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: