ad_change_password (public)
ad_change_password \ [ -password_hash_algorithm password_hash_algorithm ] user_id \ new_password
Defined in packages/acs-tcl/tcl/security-procs.tcl
Change the user's password
- Switches:
- -password_hash_algorithm (optional, defaults to
"salted-sha1"
)- Parameters:
- user_id (required)
- new_password (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_change_check_password
Source code: if { $user_id eq "" } { error "No user_id supplied" } # # The hash algorithms are called in standard OpenACS with a salt # size of 20 bytes (in hex format), which corresponds to 160-bit. # set salt [sec_random_token] set new_password [::security::hash::$password_hash_algorithm $new_password $salt] db_dml password_update { update users set password = :new_password, salt = :salt, password_hash_algorithm = :password_hash_algorithm, password_changed_date = current_timestamp where user_id = :user_id }Generic XQL file: packages/acs-tcl/tcl/security-procs.xql
PostgreSQL XQL file: packages/acs-tcl/tcl/security-procs-postgresql.xql
Oracle XQL file: packages/acs-tcl/tcl/security-procs-oracle.xql