Password expiration
Upgrade an existing project
- add the skeleton repository as a remoteshell
git remote add skeleton git@git.xalok.com:HML/skeleton-2021.git git fetch skeleton
- cherry pick the update commitsshell
git cherry-pick 908659b927684cbf5cecdc15079d428064bc1518
- run the migrationshell
./app/admin/console doctrine:migrations:migrate
- if the project does not use
security_access_control.yml
fromwfcms/standard
, add this line to thesecurity_access_control.yml
in project- for v6 projects
shell- { path: ^/user/profile/change-password, role: [ROLE_USER] }
- for v7 projects
shell- { path: ^/((%regex_locales%)/)?user/profile/change-password, role: [ROLE_USER] }
Password related settings
Password min length
( password-min-length = 8
)
Sets a constraint with the minimum length of characters allowed for passwords. By default, the passwords requires at least one letter and one special character.
Password lifetime duration
(password-expires-days = 0
)
The life span, in days, of a password since it was last changed.
Setting this to 0 (zero) will deactivate the functionality of password expiration check and the sending of e-mails with notifications to users when the password is close to expiration limit (see below setting).
Password notice before expiration
(password-notice-days = 5
)
This setting is used by the mailer script and represents the days before the password expiration date. For example, if the value 5 is added the user will receive an e-mail (on the email set in his account) five days before his password is about to expire.
This setting is also used to show a banner below the header with the message that the password is about to expire soon and a link that takes the user to the change password page. The banner will show every time the user refreshes the page until the password expires or the user changes his password.
Password expiration e-mail notification
(password-expires-email-subject and password-expires-email-body
)
This fields will be used by the mailer to set the subject and the body of the e-mail.
There are two placeholders in the body that will be translated to values:
__USERNAME__ -> The username set for the specific user in the database
__LOGIN_URL__ -> Absolute url to the admin login page (http://{domain}/login)
Mailer configuration parameters
Make sure the mailer is configured and working with the following parameters before running the command:
mailer_transport: smtp
mailer_host: smtp.gmail.com
mailer_user: xxx@mail.com
mailer_password: xxxxxxxx
E-mail notification command
app/admin/console --env=prod wf:cms:password-expiration-notice