auth::local::password::ChangePassword (private)

 auth::local::password::ChangePassword username new_password \
    [ old_password ] [ parameters ] [ authority_id ]

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

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

Parameters:
username (required)
new_password (required)
old_password (optional)
parameters (optional)
authority_id (optional)

Partial Call Graph (max 5 caller/called nodes):
test_auth_password_implementations auth_password_implementations (test acs-authentication) auth::local::password::ChangePassword auth::local::password::ChangePassword test_auth_password_implementations->auth::local::password::ChangePassword acs_user::get_by_username acs_user::get_by_username (public) auth::local::password::ChangePassword->acs_user::get_by_username ad_change_password ad_change_password (public) auth::local::password::ChangePassword->ad_change_password ad_check_password ad_check_password (public) auth::local::password::ChangePassword->ad_check_password ad_log ad_log (public) auth::local::password::ChangePassword->ad_log ad_try ad_try (public) auth::local::password::ChangePassword->ad_try AcsSc.auth_password.changepassword.local AcsSc.auth_password.changepassword.local (private) AcsSc.auth_password.changepassword.local->auth::local::password::ChangePassword auth::local::password::register_impl auth::local::password::register_impl (private) auth::local::password::register_impl->auth::local::password::ChangePassword

Testcases:
auth_password_implementations
Source code:
    array set result {
        password_status {}
        password_message {}
    }

    set user_id [acs_user::get_by_username -authority_id $authority_id -username $username]
    if { $user_id eq "" } {
        set result(password_status) "no_account"
        return [array get result]
    }

    if { $old_password ne "" } {
        if { ![ad_check_password $user_id $old_password] } {
            set result(password_status) "old_password_bad"
            return [array get result]
        }
    }

    ad_try {
        ad_change_password $user_id $new_password
    } on error {errorMsg} {
        set result(password_status) "change_error"
        ad_log Error "Error changing local password for username $username, user_id $user_id: $errorMsg"
        return [array get result]
    }

    set result(password_status) "ok"

    auth::local::password::notify_changed $user_id
    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: