mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
related to #2165 new add user popin
- add field for add user - in the `pwg.users.add` method, the params `send_password_by_mail` does nothing anymore. Because we no longer want to send passwords in clear text. - in the `pwg.users.add` add a new `auto_password` parameter to generate a random password when a user is created - use this parameter (`auto_password`) in user_list.js - change mail content et password page on first login
This commit is contained in:
@@ -392,13 +392,18 @@ function ws_users_add($params, &$service)
|
||||
}
|
||||
}
|
||||
|
||||
if ($params['auto_password'])
|
||||
{
|
||||
$params['password'] = generate_key(rand(15, 20));
|
||||
}
|
||||
|
||||
$user_id = register_user(
|
||||
$params['username'],
|
||||
$params['password'],
|
||||
$params['email'],
|
||||
false, // notify admin
|
||||
$errors,
|
||||
$params['send_password_by_mail']
|
||||
false // $params['send_password_by_mail']
|
||||
);
|
||||
|
||||
if (!$user_id)
|
||||
@@ -1006,7 +1011,15 @@ function ws_users_generate_reset_password_link($params, &$service)
|
||||
|
||||
if ($params['send_by_mail'] and !empty($user_lost['email']))
|
||||
{
|
||||
$email_params = pwg_generate_reset_password_mail($user_lost['username'], $generate_link['reset_password_link'], $conf['gallery_title']);
|
||||
$first_login = first_connexion($params['user_id']);
|
||||
if ($first_login)
|
||||
{
|
||||
$email_params = pwg_generate_set_password_mail($user_lost['username'], $generate_link['reset_password_link'], $conf['gallery_title']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$email_params = pwg_generate_reset_password_mail($user_lost['username'], $generate_link['reset_password_link'], $conf['gallery_title']);
|
||||
}
|
||||
// Here we remove the display of errors because they prevent the response from being parsed
|
||||
if (@pwg_mail($user_lost['email'], $email_params))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user