mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-27 19:59:56 +03:00
fixes #2287 switch language before sending the email
This commit is contained in:
parent
e2fbf45cd8
commit
bb8f3d5715
2 changed files with 7 additions and 1 deletions
|
@ -1023,7 +1023,9 @@ function ws_users_generate_password_link($params, &$service)
|
||||||
$first_login = has_already_logged_in($params['user_id']);
|
$first_login = has_already_logged_in($params['user_id']);
|
||||||
$generate_link = generate_password_link($params['user_id'], $first_login);
|
$generate_link = generate_password_link($params['user_id'], $first_login);
|
||||||
$send_by_mail_response = null;
|
$send_by_mail_response = null;
|
||||||
|
$lang_to_use = $first_login ? get_default_language() : $user_lost['language'];
|
||||||
|
|
||||||
|
switch_lang_to($lang_to_use);
|
||||||
if ($params['send_by_mail'] and !empty($user_lost['email']))
|
if ($params['send_by_mail'] and !empty($user_lost['email']))
|
||||||
{
|
{
|
||||||
if ($first_login)
|
if ($first_login)
|
||||||
|
@ -1044,6 +1046,7 @@ function ws_users_generate_password_link($params, &$service)
|
||||||
$send_by_mail_response = false;
|
$send_by_mail_response = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
switch_lang_back();
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'generated_link' => $generate_link['password_link'],
|
'generated_link' => $generate_link['password_link'],
|
||||||
|
|
|
@ -80,9 +80,12 @@ function process_password_request()
|
||||||
|
|
||||||
// $userdata['activation_key'] = $generate_link['activation_key'];
|
// $userdata['activation_key'] = $generate_link['activation_key'];
|
||||||
|
|
||||||
|
switch_lang_to($userdata['language']);
|
||||||
$email_params = pwg_generate_reset_password_mail($userdata['username'], $generate_link['password_link'], $conf['gallery_title'], $generate_link['time_validation']);
|
$email_params = pwg_generate_reset_password_mail($userdata['username'], $generate_link['password_link'], $conf['gallery_title'], $generate_link['time_validation']);
|
||||||
|
$send_email = pwg_mail($userdata['email'], $email_params);
|
||||||
|
switch_lang_back();
|
||||||
|
|
||||||
if (pwg_mail($userdata['email'], $email_params))
|
if ($send_email)
|
||||||
{
|
{
|
||||||
$page['infos'][] = l10n('Check your email for the confirmation link');
|
$page['infos'][] = l10n('Check your email for the confirmation link');
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue