exp:expuserresetpassword
Reset a user's password: send the "reset your password" link, set a generated password shown once, or one read from standard input; optionally require a new password at the next sign-in (a dry run unless --apply).
Script bin/php/expuserresetpassword.php, code in kernel/private/classes/commands/expuserresetpassword.php. Run it from the installation root, as the user the web server runs as:
./console exp:expuserresetpassword --help
./console exp:user:reset-password --help
php bin/php/expuserresetpassword.php --helpHelp text
Reset a user's password
Choose one way: --send-link sends the mail of "Forgot password" with its one-time link (the
password stays until the person uses the link); --generate sets a generated password that passes
the password rules and prints it once; --password-stdin sets the password read from standard input
(never from the command line). --generate and --password-stdin end the account's sessions;
--require-change makes the person choose a new password at the next sign-in. The password is
never written to a log or the audit. In demo mode an administrator's password is never changed.
Without --apply nothing is changed and no mail is sent.
./console exp:user:reset-password jane --send-link --apply
./console exp:user:reset-password jane --generate --require-change --apply
./console exp:user:reset-password ci-bot --password-stdin --apply < secret-fileOptions
| Option | Value | Help |
|---|---|---|
--send-link | Send the "reset your password" mail with its one-time link (the password stays until the link is used) | |
--generate | Set a generated password that passes the password rules, print it once and end the account's sessions | |
--password-stdin | Read the password from standard input (one line), never from the command line (create and reset-password: it must pass the password rules) | |
--require-change | The account must choose a new password at its next sign-in | |
--apply | Make the change; without it the command only lists what it would change (a dry run) | |
--dry-run | The default, kept for scripts that pass it: list what would change, change nothing | |
--as | required | Act as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it |
--format | required | text (default) or json (the machine output exp-user/1) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [user].
Related
Generated by ./console exp:help:examples from bin/php/expuserresetpassword.php, kernel/private/classes/commands/expuserresetpassword.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.