chg: [user add] don't autocomplete username/password fields

pull/32/head
iglocska 2020-11-06 09:21:44 +01:00
parent 1d611b2df8
commit 76883145fb
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 9 additions and 3 deletions

View File

@ -13,6 +13,9 @@ class FormFieldMassageHelper extends Helper
$controlParams['data-dependence-option'] = h($fieldData['stateDependence']['option']);
}
$controlParams['id'] = $fieldData['field'] . '-field';
if (!empty($fieldData['autocomplete'])) {
$controlParams['autocomplete'] = $fieldData['autocomplete'];
}
$formFieldElement = $form->control($fieldData['field'], $controlParams);
if (!empty($fieldData['hidden'])) {
$formFieldElement = '<span class="hidden">' . $formFieldElement . '</span>';

View File

@ -11,19 +11,22 @@
'options' => $dropdownData['individual']
],
[
'field' => 'username'
'field' => 'username',
'autocomplete' => 'off'
],
[
'field' => 'password',
'label' => __('Password'),
'type' => 'password',
'required' => $this->request->getParam('action') === 'add' ? 'required' : false
'required' => $this->request->getParam('action') === 'add' ? 'required' : false,
'autocomplete' => 'new-password'
],
[
'field' => 'confirm_password',
'label' => __('Confirm Password'),
'type' => 'password',
'required' => $this->request->getParam('action') === 'add' ? 'required' : false
'required' => $this->request->getParam('action') === 'add' ? 'required' : false,
'autocomplete' => 'off'
],
[
'field' => 'role_id',