Implements the RetrievePassword operation of the auth_password
service contract for the local account implementation.
}{
set result(password_status)"ok"
set result(password_message)[_ acs-subsite.Request_Change_Password_token_email]
db_1row get_usr_id_and_password_hash {SELECT user_id, password as password_hash FROM users WHERE username = :username}
set email [party::email -party_id $user_id]
# TODO: This email message text should go in the recipient user language, english or every language supported
set subject "[ad_system_name]: [_ acs-subsite.change_password_email_subject]$username"
set reset_password_url "[ad_url]/user/password-reset"
if {[im_user_is_customer_p $user_id]}{
set reset_password_url "https://client.lexcelera.com/user/password-reset"
}
if {[im_user_is_freelance_p $user_id]}{
set reset_password_url "https://provider.lexcelera.com/user/password-reset"
}
set password [ad_generate_random_string]
ad_change_password $user_id $password
# set body "[_ acs-subsite.change_password_email_body_0]\n\n[export_vars -base $reset_password_url {user_id password_hash}]\n\n[_ acs-subsite.change_password_email_body_1]"
set body "[_ acs-subsite.change_password_email_body_0_bis]\n\n$password\n\n[_ acs-subsite.change_password_email_body_1]"