Password¶
New in version 12.0
The TCA type password
has been introduced. It replaces the
eval=password
and eval=saltedPassword
option of
TCA type input
.
New in version 13.0
When using the password
type, TYPO3 takes care of
generating the according database field.
A developer does not need to define this field in an extension's
ext_tables.sql
file.
The TCA type password
should be used for input values that represent
passwords.
Examples¶
A simple password field:¶
[
'columns' => [
'password_1' => [
'label' => 'password_1',
'description' => 'type=password',
'config' => [
'type' => 'password',
],
],
],
]
A password field with password generator¶
[
'columns' => [
'password_6' => [
'label' => 'password_6',
'description' => 'type=password fieldControl=passwordGenerator - all character sets',
'config' => [
'type' => 'password',
'fieldControl' => [
'passwordGenerator' => [
'renderType' => 'passwordGenerator',
'options' => [
'title' => 'Create random password',
'passwordRules' => [
'specialCharacters' => true,
],
],
],
],
],
],
],
]
For more options on generating passwords see Property passwordGenerator.
Migration¶
The migration from eval='password'
and eval='saltedPassword'
to
type=password
is done like following:
// Before
'password_field' => [
'label' => 'Password',
'config' => [
'type' => 'input',
'eval' => 'trim,password,saltedPassword',
]
]
// After
'password_field' => [
'label' => 'Password',
'config' => [
'type' => 'password',
]
]
// Before
'another_password_field' => [
'label' => 'Password',
'config' => [
'type' => 'input',
'eval' => 'trim,password',
]
]
// After
'another_password_field' => [
'label' => 'Password',
'config' => [
'type' => 'password',
'hashed' => false,
]
]
An automatic TCA migration is performed on the fly, migrating all occurrences
to the new TCA type and triggering a PHP E_USER_DEPRECATED
error
where code adoption has to take place.
Note
The value of TCA type password
column is automatically trimmed before
being stored (and optionally hashed) in the database. Therefore, the eval=trim
option is no longer needed and should be removed from the TCA configuration.