Commit 4dc931a1 authored by Project Open's avatar Project Open

Lexcelera V5.1 Customizations

parent 5a95fce9
......@@ -317,7 +317,7 @@ ad_proc -private auth::local::password::ChangePassword {
return [array get result]
}
ad_proc -private auth::local::password::RetrievePassword {
ad_proc -private auth::local::password::RetrievePassword_vanilla {
username
parameters
} {
......@@ -344,6 +344,45 @@ ad_proc -private auth::local::password::RetrievePassword {
return [array get result]
}
ad_proc -private auth::local::password::RetrievePassword {
username
parameters
} {
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]"
acs_mail_lite::send \
-send_immediately \
-to_addr $email \
-from_addr [ad_outgoing_sender] \
-subject $subject \
-body $body
return [array get result]
}
ad_proc -private auth::local::password::ResetPassword {
username
parameters
......
......@@ -530,6 +530,16 @@ ad_proc -private auth::password::email_password {
# 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 up variables for use in message key
if { [im_user_is_customer_p $user_id] } {
set reset_password_url [export_vars -base "https://client.lexcelera.com/user/password-update" {user_id {old_password $password}}]
}
if { [im_user_is_freelance_p $user_id] } {
set reset_password_url [export_vars -base "https://provider.lexcelera.com/user/password-update" {user_id {old_password $password}}]
}
set forgotten_password_url [auth::password::get_forgotten_url \
-authority_id $authority_id \
-username $user(username) \
......@@ -540,6 +550,10 @@ ad_proc -private auth::password::email_password {
}
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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment