fixes #2281 use template for reset/activation mail

and change is_first_connection to has_already_logged_in for better naming
This commit is contained in:
Linty 2024-11-20 21:06:02 +01:00
parent f6a3d0749f
commit 6e45a8f426
4 changed files with 5 additions and 5 deletions

View file

@ -1039,7 +1039,7 @@ function pwg_generate_reset_password_mail($username, $password_link, $gallery_ti
return array(
'subject' => '['.$gallery_title.'] '.l10n('Password Reset'),
'content' => $message,
'email_format' => 'text/plain',
'content_format' => 'text/plain',
);
}
@ -1078,7 +1078,7 @@ function pwg_generate_set_password_mail($username, $set_password_link, $gallery_
return array(
'subject' => l10n('Welcome to ') . '['.$gallery_title.']',
'content' => $message,
'email_format' => 'text/plain',
'content_format' => 'text/plain',
);
}

View file

@ -1927,7 +1927,7 @@ function userprefs_get_param($param, $default_value=null)
* @param int $user_id
* @return bool true if first connexion else false
*/
function is_first_connection($user_id)
function has_already_logged_in($user_id)
{
$query = '
SELECT COUNT(*)

View file

@ -1020,7 +1020,7 @@ function ws_users_generate_password_link($params, &$service)
return new PwgError(403, 'You cannot perform this action');
}
$first_login = is_first_connection($params['user_id']);
$first_login = has_already_logged_in($params['user_id']);
$generate_link = generate_password_link($params['user_id'], $first_login);
$send_by_mail_response = null;

View file

@ -231,7 +231,7 @@ if (isset($_GET['key']) and !isset($_POST['submit']))
$userdata = getuserdata($user_id, false);
$page['username'] = $userdata['username'];
$template->assign('key', $_GET['key']);
$first_login = is_first_connection($user_id);
$first_login = has_already_logged_in($user_id);
if (!isset($page['action']))
{