auth::local::password::RetrievePassword (private)

 auth::local::password::RetrievePassword username parameters

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

Implements the RetrievePassword operation of the auth_password service contract for the local account implementation.

Parameters:
username (required)
parameters (required)

Partial Call Graph (max 5 caller/called nodes):
test_auth_password_implementations auth_password_implementations (test acs-authentication) auth::local::password::RetrievePassword auth::local::password::RetrievePassword test_auth_password_implementations->auth::local::password::RetrievePassword _ _ (public) auth::local::password::RetrievePassword->_ acs_user::get_by_username acs_user::get_by_username (public) auth::local::password::RetrievePassword->acs_user::get_by_username ad_outgoing_sender ad_outgoing_sender (public) auth::local::password::RetrievePassword->ad_outgoing_sender ad_system_name ad_system_name (public) auth::local::password::RetrievePassword->ad_system_name ad_url ad_url (public) auth::local::password::RetrievePassword->ad_url AcsSc.auth_password.retrievepassword.local AcsSc.auth_password.retrievepassword.local (private) AcsSc.auth_password.retrievepassword.local->auth::local::password::RetrievePassword auth::local::password::register_impl auth::local::password::register_impl (private) auth::local::password::register_impl->auth::local::password::RetrievePassword

Testcases:
auth_password_implementations
Source code:
    set result(password_status) "ok"
    set result(password_message) [_ acs-subsite.Request_Change_Password_token_email]

    set user_id [acs_user::get_by_username -authority_id [auth::authority::local] -username $username]
    if {$user_id eq ""} {
        return [list password_status no_account]
    }
    db_transaction {
        if {![auth::token::lock_account $user_id]} {
            return [list password_status no_account]
        }
        lassign [auth::local::password::recovery_state $user_id] email context
        if {$email eq ""} {
            return [list password_status retrieve_error]
        }
        set token [auth::token::issue -purpose password_reset -user_id $user_id  -ttl 1800 -context $context]
    }

    set reset_url [export_vars -base "[ad_url]/user/password-reset" {token}]
    auth::email::send -template password-reset -user_id $user_id -to $email  -default_from [ad_outgoing_sender]  -values [list system_name [ad_system_name] username $username reset_url $reset_url]

    return [array get result]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-authentication/tcl/local-procs.xql

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