auth::password::email_password (private)

 auth::password::email_password -username username \
    -authority_id authority_id -password password \
    [ -subject_msg_key subject_msg_key ] \
    [ -body_msg_key body_msg_key ] [ -from from ]

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

Send an email to the user with given username and authority with the new password.

Switches:
-username (required)
-authority_id (required)
-password (required)
-subject_msg_key (optional, defaults to "acs-subsite.email_subject_Forgotten_password")
The message key you wish to use for the email subject.
-body_msg_key (optional, defaults to "acs-subsite.email_body_Forgotten_password")
The message key you wish to use for the email body.
-from (optional)
The email's from address. Can be in email@foo.com format. Defaults to ad_system_owner.
Returns:
Does not return anything. Any errors caused by acs_mail_lite::send are propagated
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 auth::local::registration::Register auth::local::registration::Register (private) auth::password::email_password auth::password::email_password auth::local::registration::Register->auth::password::email_password auth::password::reset auth::password::reset (public) auth::password::reset->auth::password::email_password auth::password::retrieve auth::password::retrieve (public) auth::password::retrieve->auth::password::email_password _ _ (public) auth::password::email_password->_ acs_mail_lite::send acs_mail_lite::send (public) auth::password::email_password->acs_mail_lite::send acs_user::get_by_username acs_user::get_by_username (public) auth::password::email_password->acs_user::get_by_username ad_conn ad_conn (public) auth::password::email_password->ad_conn ad_pad ad_pad (public) auth::password::email_password->ad_pad

Testcases:
No testcase defined.
Source code:
    set user_id    [acs_user::get_by_username -authority_id $authority_id -username $username]
    set user_info  [person::get_person_info -person_id $user_id]
    set user_email [party::get -party_id $user_id -element email]

    # Set up variables for use in message key
    set reset_password_url [export_vars -base "[ad_url]/user/password-update" {
        user_id {old_password $password}
    }]
    set forgotten_password_url [auth::password::get_forgotten_url  -authority_id $authority_id  -username $username  -email $user_email]
    set subsite_info [security::get_register_subsite]
    if {[dict get $subsite_info url] ne "/"} {
        set forgotten_password_url [dict get $subsite_info url]$forgotten_password_url
    }
    set forgotten_password_url [security::get_qualified_url $forgotten_password_url]

    set system_owner [ad_system_owner]
    set system_name [ad_system_name]
    set system_url [ad_url]
    if { [auth::UseEmailForLoginP] } {
        set account_id_label [_ acs-subsite.Email]
        set account_id $user_email
    } else {
        set account_id_label [_ acs-subsite.Username]
        set account_id $username
    }
    set password_label [_ acs-subsite.Password]

    set length [expr {max([string length $account_id_label], [string length $password_label])}]
    set account_id_label [ad_pad -right $account_id_label $length " "]
    set password_label   [ad_pad -right $password_label $length " "]

    set first_names [dict get $user_info first_names]
    set last_name   [dict get $user_info last_name]

    if { [ad_conn untrusted_user_id] != 0 } {
        set admin [person::get_person_info  -person_id [ad_conn untrusted_user_id]]
        set admin_first_names [dict get $admin first_names]
        set admin_last_name   [dict get $admin last_name]
    } else {
        set admin_first_names {}
        set admin_last_name {}
    }

    set subject [_ $subject_msg_key]
    set body [_ $body_msg_key]

    if { $from eq "" } {
        set from [ad_system_owner]
    }

    # Send email
    acs_mail_lite::send -send_immediately  -to_addr $user_email  -from_addr $system_owner  -subject $subject  -body $body
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: