Password generator examples
Include special characters
Example: qe8)i2W1it-
A password generator using special chars.
[
'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',
'passwordPolicy' => 'styleguideAllCharacters',
],
],
],
],
],
],
]
Only digits, length 8 (minimum length)
Example: 28233371
A generated 8 digit number
[
'columns' => [
'password_7' => [
'label' => 'password_7',
'description' => 'type=password fieldControl=passwordGenerator length=8 - only digits',
'config' => [
'type' => 'password',
'fieldControl' => [
'passwordGenerator' => [
'renderType' => 'passwordGenerator',
'options' => [
'title' => 'Create random number',
'passwordPolicy' => 'styleguideDigits',
],
],
],
],
],
],
]
Hexadecimal random bytes, length 30
Example: 0d95c0936c54b97bf908a3c963b508.
A generated 30 characters long random hex string
The following example will generate a 30 characters long random hex string, which could be used for secret tokens or similar:
[
'columns' => [
'password_4' => [
'label' => 'password_4',
'description' => 'type=password fieldControl=passwordGenerator random=hex',
'config' => [
'type' => 'password',
'fieldControl' => [
'passwordGenerator' => [
'renderType' => 'passwordGenerator',
'options' => [
'title' => 'Create random hex string',
'passwordPolicy' => 'styleguideHex',
],
],
],
],
],
],
]
Base64 random bytes, readonly
Example: zrt8s
A password generator using base64 random bytes, readonly.
[
'columns' => [
'password_5' => [
'label' => 'password_5',
'description' => 'type=password fieldControl=passwordGenerator random=base64 allowEdit=false',
'config' => [
'type' => 'password',
'fieldControl' => [
'passwordGenerator' => [
'renderType' => 'passwordGenerator',
'options' => [
'title' => 'Create random base64 string',
'allowEdit' => false,
'passwordPolicy' => 'styleguideBase64',
],
],
],
],
],
],
]
Properties
Field control options
title
title
-
- Path
$GLOBALS['TCA'] [$table] ['columns'] [$field] ['config'] ['field Control'] ['password Generator'] ['options'] ['title'] - Type
- String / localized string
- Default
LLL:core. core: labels. generate Password
Define a title for the control button.
allowEdit
allowEdit
-
- Path
$GLOBALS['TCA'] [$table] ['columns'] [$field] ['config'] ['field Control'] ['password Generator'] ['options'] ['allow Edit'] - Type
- boolean
- Default
true
If set to
false, the user cannot edit the generated password.
Password policy
passwordPolicy
-
- Path
$GLOBALS['TCA'] [$table] ['columns'] [$field] ['config'] ['field Control'] ['password Generator'] ['options'] ['password Policy'] - Type
- string
- Default
default
New in version 14.2
This option can be used to configure which Password policy should be used for the password field. Use the key of the policy as defined in
$GLOBALS.['TYPO3_ CONF_ VARS'] ['SYS'] ['password Policies'] If the policy defines a
generatorsection, the field control uses that generator.EXT:my_extension/Configuration/TCA/Overrides/fe_users.php