From 03af2b486aeef4b928ef8bafceefdffbe8442482 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Thu, 14 Mar 2024 20:50:54 +0530 Subject: [PATCH] Add `email` and `generate-password` options in `user:add` 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 ccd967e16..793d57558 100644 --- a/admin_manual/configuration_server/occ_command.rst +++ b/admin_manual/configuration_server/occ_command.rst @@ -1360,7 +1360,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 @@ -1411,6 +1411,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