From a131c11c4cb5637648dbd6faa4925b69bd694510 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Mon, 9 Sep 2024 20:45:46 +0530 Subject: [PATCH] Add `email` and `generate-password` options in `occ user:add` (#11160) Signed-off-by: Anupam Kumar --- .../configuration_server/occ_command.rst | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/admin_manual/configuration_server/occ_command.rst b/admin_manual/configuration_server/occ_command.rst index ba69f2847..8a7981cfc 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/configuration_server/occ_command.rst @@ -1361,7 +1361,7 @@ report showing how many users you have, and when a user was last logged in:: You can create a new user with their display name, login name, and any group memberships with the ``user:add`` command. The syntax is:: - user:add [--password-from-env] [--display-name[="..."]] [-g|--group[="..."]] + user:add [--password-from-env] [--generate-password] [--display-name[="..."]] [-g|--group[="..."]] [--email EMAIL] uid The ``display-name`` corresponds to the **Full Name** on the Users page in your @@ -1412,6 +1412,26 @@ You may also use ``password-from-env`` to reset passwords:: layla' Successfully reset password for layla +``generate-password`` allows you to set a securely generated password for the user. +This is never shown in the output and can be used to create users with temporary +passwords. This can be used in conjunction with the ``email`` option to create +users with a temporary password and send a welcome email to the user's email +address without user interaction:: + + sudo -u www-data php occ user:add layla --generate-password --email layla@example.tld + The account "layla" was created successfully + Welcome email sent to layla@example.tld + +The ``email`` option allows you to set the user's email address when creating +the user. A welcome email will be sent to the user's email address if +``newUser.sendEmail`` is set to ``yes`` in ``core``'s app config or not set at all:: + + sudo -u www-data php occ user:add layla --email layla@example.tld + Enter password: + Confirm password: + The account "layla" was created successfully + Welcome email sent to layla@example.tld + You can delete users:: sudo -u www-data php occ user:delete fred