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:
Linty 2024-06-28 18:49:34 +02:00
parent 834b339860
commit c8d7503d4e
9 changed files with 385 additions and 119 deletions

View file

@ -224,12 +224,14 @@ if (isset($_GET['key']) and !is_a_guest())
if (isset($_GET['key']) and !isset($_POST['submit']))
{
$first_login = false;
$user_id = check_password_reset_key($_GET['key']);
if (is_numeric($user_id))
{
$userdata = getuserdata($user_id, false);
$page['username'] = $userdata['username'];
$template->assign('key', $_GET['key']);
$first_login = first_connexion($user_id);
if (!isset($page['action']))
{
@ -278,6 +280,10 @@ if ('lost' == $page['action'])
$template->assign('username_or_email', htmlspecialchars(stripslashes($_POST['username_or_email'])));
}
}
else if ('reset' == $page['action'] and isset($first_login) and $first_login)
{
$title = l10n('Welcome');
}
$page['body_id'] = 'thePasswordPage';